-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing component logic results in warning #2275
Comments
This is the expected behaviour, we recommend to use newSpecPage() instead of |
@manucorporat but a few lines below you can find a chapter named 'Testing Component Class Logic' https://stenciljs.com/docs/unit-testing#testing-component-class-logic which shows an instatiation example with new. Inconsistency in the code or outdated documentation? |
See corresponding issue against stencil docs site here. Either the stencil cli or docs site needs a fix. |
@manucorporat Why was this issue closed? The warning message is kinda misleading considering both in docs and the app created through the CLI has the usage mentioned here |
@manucorporat agree with op, could you please reopen and handle the issue ? |
Stencil version:
I'm submitting a:
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Running a unit test in .spec.ts for component logic gives out a warning:
console.warn node_modules/@stencil/core/internal/testing/index.js:2900 Use newSpecPage() to instanciate component instances.
Comment out the component logic test and the warning disappears. Example of component logic test:
it('builds', () => { expect(new Note()).toBeTruthy(); });
Expected behavior:
No warning should come out.
Steps to reproduce:
Already described above
Related code:
Already shown above
// insert any relevant code here
Other information:
The text was updated successfully, but these errors were encountered: