Stencil: Providing a "Context" object for components in unit tests

Created on 25 Jun 2018  路  8Comments  路  Source: ionic-team/stencil

Stencil version:

 @stencil/[email protected] 

I'm submitting a:

[ ] bug report
[X] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:
As per #802 which was closed as "stale", there is no way to provide a context object for unit tests.

I personally currently use a workaround that involves attaching the data to window, which works although it means I can't run the tests in parallel.

Other information:
Please see previous ticket #802 which provides examples.

Feel free to close this and re-open #802, I just don't want this issue lost.

triage

Most helpful comment

Given that this issue effectively blocks any tests for components relying on the context, I'm quite surprised that it does not seem to get any attention, either by a technical option or at least a documentation on how to get around it.

All 8 comments

Thanks @lupiter, I was just about opening this again.

Just a small friendly ping to prevent this issue from becoming auto-closed again...
It's somewhat unlikely that something that basic does not work, especially since its usage is that obviously mentioned in the docs.

I'd really like to help fixing or at least getting around this, just don't know where to start :thinking:

Given that this issue effectively blocks any tests for components relying on the context, I'm quite surprised that it does not seem to get any attention, either by a technical option or at least a documentation on how to get around it.

Just a small friendly ping to prevent this issue from becoming auto-closed by that more-or-less-likely bot again, since this is still an issue ...

Reopened #802.

@DorianGrey I am experiencing this issue at the moment. Any luck on your end?

Unfortunately not.
In #802, it was mentioned that

This is no longer applicable with the latest releases. Thanks

Which is true because the whole testing API changed drastically, and the docs got updated, but not in a very detailed way. Did not find any solution for it, thus stopped working on it.

Ok, thanks

Was this page helpful?
0 / 5 - 0 ratings