ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.61k stars 791 forks source link

test fails on unmodified app-starter package #520

Closed stevefuzzy closed 6 years ago

stevefuzzy commented 6 years ago

Stencil version:

@stencil/starter@0.0.1 C:\Dev\my-app
`-- @stencil/core@0.4.0

I'm submitting a:

Current behavior:

test fails on a fresh pull of the starter package:

Expected behavior:

All test should pass

Steps to reproduce:

Follow the steps in getting started page: git clone https://github.com/ionic-team/stencil-app-starter my-app cd my-app git remote rm origin npm install npm run build npm test

Other information:

Note: running npm start properly brings up the initial Stencil App Starter welcome page. Running on Windows 7 64bit

node -v v8.9.4

npm -v 5.6.0

npm run test @stencil/starter@0.0.1 test C:\Dev\my-app jest --no-cache

FAIL dist\collection\dependencies\components__tests__\test-demo-three.js ● Test suite failed to run

C:\Dev\my-app\dist\collection\dependencies\components\__tests__\test-demo-three.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export class TestDemoThree {
                                                                                         ^^^^^^

SyntaxError: Unexpected token export

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
      at Generator.next (<anonymous>)
      at new Promise (<anonymous>)

FAIL dist\collection\dependencies\components__tests__\test-demo-six.js ● Test suite failed to run

C:\Dev\my-app\dist\collection\dependencies\components\__tests__\test-demo-six.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export class TestDemoSix {
                                                                                         ^^^^^^

SyntaxError: Unexpected token export

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
      at Generator.next (<anonymous>)
      at new Promise (<anonymous>)

FAIL dist\collection\dependencies\components__tests__\test-app.js ● Test suite failed to run

C:\Dev\my-app\dist\collection\dependencies\components\__tests__\test-app.js:22
export class TestApp {
^^^^^^

SyntaxError: Unexpected token export

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
      at Generator.next (<anonymous>)
      at new Promise (<anonymous>)

FAIL dist\collection\dependencies\components__tests__\test-demo-four.js ● Test suite failed to run

C:\Dev\my-app\dist\collection\dependencies\components\__tests__\test-demo-four.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export class TestDemoFour {
                                                                                         ^^^^^^

SyntaxError: Unexpected token export

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
      at Generator.next (<anonymous>)
      at new Promise (<anonymous>)

PASS src\components\my-app\my-app.spec.ts PASS src\components\app-home\app-home.spec.ts FAIL src\components\app-profile\app-profile.spec.ts ● app-profile › rendering › should not render any content if there is not a match

invalid testing root node

  at Object.<anonymous> (node_modules/@stencil/core/dist/testing/index.js:15183:19)
      at Generator.next (<anonymous>)
  at node_modules/@stencil/core/dist/testing/index.js:15111:71
      at new Promise (<anonymous>)
  at Object.<anonymous>.__awaiter$55 (node_modules/@stencil/core/dist/testing/index.js:15107:12)
  at Object.flush (node_modules/@stencil/core/dist/testing/index.js:15180:12)
  at Object.<anonymous> (src/components/app-profile/app-profile.spec.ts:63:60)
  at step (src/components/app-profile/app-profile.spec.ts:32:23)
  at Object.next (src/components/app-profile/app-profile.spec.ts:13:53)
  at src/components/app-profile/app-profile.spec.ts:7:71
      at new Promise (<anonymous>)
  at Object.<anonymous>.__awaiter (src/components/app-profile/app-profile.spec.ts:3:12)
  at Object.<anonymous> (src/components/app-profile/app-profile.spec.ts:60:90)
      at new Promise (<anonymous>)
      at <anonymous>
  at process._tickCallback (internal/process/next_tick.js:188:7)

● app-profile › rendering › should work with a name passed

TypeError: Cannot set property 'match' of null

  at Object.<anonymous> (src/components/app-profile/app-profile.spec.ts:75:39)
  at step (src/components/app-profile/app-profile.spec.ts:32:23)
  at Object.next (src/components/app-profile/app-profile.spec.ts:13:53)
  at src/components/app-profile/app-profile.spec.ts:7:71
      at new Promise (<anonymous>)
  at Object.<anonymous>.__awaiter (src/components/app-profile/app-profile.spec.ts:3:12)
  at Object.<anonymous> (src/components/app-profile/app-profile.spec.ts:71:67)
      at new Promise (<anonymous>)
      at <anonymous>
  at process._tickCallback (internal/process/next_tick.js:188:7)

Test Suites: 5 failed, 2 passed, 7 total Tests: 2 failed, 3 passed, 5 total Snapshots: 0 total Time: 8.242s Ran all test suites.

jgw96 commented 6 years ago

Hello, thanks for using Stencil! The underlying issue here is https://github.com/ionic-team/stencil/issues/428. Because of this I will be closing this one as a duplicate of that issue. Thanks again!