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

unit tests fail #39

Closed aleksandr-shukletcov closed 6 years ago

aleksandr-shukletcov 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-name@0.0.1 C:\projects\stencil\stencil-component-starter
`-- @stencil/core@0.0.8-6

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: 4 of 5 unit tests fail

Expected behavior: all tests pass

Steps to reproduce: npm install npm test

Other information: @stencil/core/renderer return null instead of an element

> node -v
v8.4.0
> npm -v
5.0.3
> npm test

> my-name@0.0.1 test C:\projects\stencil\stencil-component-starter
> jest --no-cache

 FAIL  src\components\my-component\my-component.spec.ts
  my-component
    √ should build (3ms)
    rendering
      × should work without parameters (1098ms)
      × should work with a first name (16ms)
      × should work with a last name (14ms)
      × should work with both a first and a last name (23ms)

  ● my-component › rendering › should work without parameters

    TypeError: Cannot read property 'textContent' of null

      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:66:27)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● my-component › rendering › should work with a first name

    TypeError: Cannot set property 'first' of null

      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:72:39)
      at step (src/components/my-component/my-component.spec.ts:32:23)
      at Object.next (src/components/my-component/my-component.spec.ts:13:53)
      at src/components/my-component/my-component.spec.ts:7:71
          at Promise (<anonymous>)
      at Object.<anonymous>.__awaiter (src/components/my-component/my-component.spec.ts:3:12)
      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:68:66)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● my-component › rendering › should work with a last name

    TypeError: Cannot set property 'last' of null

      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:85:38)
      at step (src/components/my-component/my-component.spec.ts:32:23)
      at Object.next (src/components/my-component/my-component.spec.ts:13:53)
      at src/components/my-component/my-component.spec.ts:7:71
          at Promise (<anonymous>)
      at Object.<anonymous>.__awaiter (src/components/my-component/my-component.spec.ts:3:12)
      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:81:65)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● my-component › rendering › should work with both a first and a last name

    TypeError: Cannot set property 'first' of null

      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:98:39)
      at step (src/components/my-component/my-component.spec.ts:32:23)
      at Object.next (src/components/my-component/my-component.spec.ts:13:53)
      at src/components/my-component/my-component.spec.ts:7:71
          at Promise (<anonymous>)
      at Object.<anonymous>.__awaiter (src/components/my-component/my-component.spec.ts:3:12)
      at Object.<anonymous> (src/components/my-component/my-component.spec.ts:94:82)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

Test Suites: 1 failed, 1 total
Tests:       4 failed, 1 passed, 5 total
Snapshots:   0 total
Time:        3.32s
Ran all test suites.
adriancarriger commented 6 years ago

@aleksandr-shukletcov try pinning @stencil/core to 0.0.8-5. It looks like this repo isn't updated to reflect some recent changes.

aleksandr-shukletcov commented 6 years ago

thanks @adriancarriger I'll try it later this week. Also will try the latest version of @stencil/core

jgw96 commented 6 years ago

Hello all! This is a known issue in Stencil and is being tracked in this issue https://github.com/ionic-team/stencil/issues/355. Thanks!