ionic-team / stencil-component-starter

Minimal starter project for building shareable web components with Stencil
https://github.com/ionic-team/stencil
MIT License
278 stars 128 forks source link

Usage of deprecated API in tests. #52

Closed Serabe closed 5 years ago

Serabe commented 6 years ago

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

 ➜ npm list @stencil/core
my-component@0.0.1 /Users/serabe/programming/play/stencil-component-starter
└── @stencil/core@0.7.22

I'm submitting a ... (check one with "x") [x] bug report [ ] 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: When running tests (npm run test) a warning about render and flush being deprecated is shown.

Expected behavior: No deprecation by default.

Steps to reproduce:

git clone git@github.com:ionic-team/stencil-component-starter.git my-component
cd my-component
git checkout 0e753321b5ff171b2674e9eaeaa72d9b3337ff54 # Latest commit as of today
npm install
npm run test
`npm run test` output

➜ npm run test

> my-component@0.0.1 test /Users/serabe/programming/play/stencil-component-starter
> jest --no-cache

 PASS  src/components/my-component/my-component.spec.ts
  my-component
    ✓ should build (3ms)
    rendering
      ✓ should work without parameters (828ms)
      ✓ should work with a first name (8ms)
      ✓ should work with a last name (5ms)
      ✓ should work with both a first and a last name (4ms)

  console.warn node_modules/@stencil/core/dist/testing/index.js:9565
    Testing "render()" has been deprecated in favor of using "TestWindow".
    Instead of "render(opts)", please use "const window = new TestWindow(); window.load(opts);".
    This update allows testing to better simulate the standardized window and document objects.

  console.warn node_modules/@stencil/core/dist/testing/index.js:9584
    Testing "flush()" has been deprecated in favor of using "TestWindow".
    Instead of "flush(elm)", please use the TestWindow "flush()" method.
    This update allows testing to better simulate the standardized window and document objects.

Test Suites: 1 passed, 1 total
Tests:       5 passed, 5 total
Snapshots:   0 total
Time:        3.089s
Ran all test suites.

Working on a PR.

kensodemann commented 5 years ago

Thanks for the heads up on that. This was initially fixed a while ago and this issue never got closed out. Sorry about that.

With 0.13.x this has changed once again. The unit test should now be completely up to date. An example e2e test will be added in the future.

Thank-you for using Ionic.