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

Tests Don't Run on New Project #70

Closed jherdman closed 5 years ago

jherdman commented 5 years ago

I'm starting a new Stencil Component project on macOS. The tests simply don't run. Here's an example terminal session:

$ npm init stencil
# --- snip ---
✔ Pick a starter › component
✔ Project name › fart

⠸ Preparing starter
✔ All setup  in 511 ms

  Next steps:
   $ cd fart
   $ npm start

  Further reading:
   - https://github.com/ionic-team/stencil-component-starter
$ cd fart
$ npm test

> fart@0.0.1 test /Users/james/fart
> stencil test --spec --e2e

[01:11.9]  Please wait while required dependencies are installed. This may take a few moments and will only be required for the initial run.
[01:11.9]  installing dependencies: @types/jest, jest, jest-cli, @types/puppeteer, puppeteer ...
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).

> puppeteer@1.8.0 install /Users/james/fart/node_modules/puppeteer
> node install.js

Downloading Chromium r588429 - 82.7 Mb [====================] 100% 0.0s
Chromium downloaded to /Users/james/fart/node_modules/puppeteer/.local-chromium/mac-588429
npm WARN fart@0.0.1 No repository field.

+ @types/puppeteer@1.12.2
+ @types/jest@23.3.14
+ jest@23.6.0
+ jest-cli@23.6.0
+ puppeteer@1.8.0
added 359 packages from 219 contributors in 19.476s
[01:31.9]  installing dependencies finished in 20.03 s
[01:32.0]  @stencil/core v0.16.2 🐣
[01:32.0]  testing e2e and spec files
[01:32.0]  build, mycomponent, dev mode, started ...
[01:32.1]  transpile started ...
[01:33.2]  transpile finished in 1.04 s
[01:33.2]  module map started ...
[01:33.2]  generate styles started ...
[01:33.5]  generate styles finished in 331 ms
[01:33.6]  module map finished in 378 ms
[01:33.6]  generate bundles started ...
[01:33.6]  generate bundles finished in 1 ms
[01:33.6]  generate app files started ...
[01:34.2]  generate app files finished in 575 ms
[01:34.6]  build finished in 2.64 s

At this point nothing happens at all.

Generated package.json:

{
  "name": "fart",
  "version": "0.0.1",
  "description": "Stencil Component Starter",
  "module": "dist/esm/index.js",
  "main": "dist/index.js",
  "unpkg": "dist/ionic.js",
  "types": "dist/types/components.d.ts",
  "collection": "dist/collection/collection-manifest.json",
  "files": [
    "dist/"
  ],
  "scripts": {
    "build": "stencil build --docs",
    "start": "stencil build --dev --watch --serve",
    "test": "stencil test --spec --e2e",
    "test.watch": "stencil test --spec --e2e --watchAll"
  },
  "dependencies": {},
  "devDependencies": {
    "@stencil/core": "~0.16.2",
    "@types/jest": "23.3.14",
    "@types/puppeteer": "1.12.2",
    "jest": "23.6.0",
    "jest-cli": "23.6.0",
    "puppeteer": "1.8.0"
  },
  "license": "MIT"
}
jgravois commented 5 years ago

i can't repro that (on Mojave)

+ @types/puppeteer@1.12.3
+ jest@23.6.0
+ @types/jest@23.3.14
+ jest-cli@23.6.0
+ puppeteer@1.8.0
added 360 packages from 220 contributors in 81.769s
[27:36.0]  installing dependencies finished in 83.09 s
[27:36.1]  @stencil/core v0.16.2 🐣
[27:36.1]  testing e2e and spec files
[27:36.1]  build, mycomponent, dev mode, started ...
[27:36.3]  transpile started ...
[27:37.1]  transpile finished in 848 ms
[27:37.1]  module map started ...
[27:37.1]  generate styles started ...
[27:37.4]  generate styles finished in 298 ms
[27:37.4]  module map finished in 329 ms
[27:37.4]  generate bundles started ...
[27:37.4]  generate bundles finished in 1 ms
[27:37.4]  generate app files started ...
[27:37.5]  generate app files finished in 15 ms
[27:38.0]  build finished in 1.83 s

 PASS  src/utils/utils.spec.ts
 PASS  src/components/my-component/my-component.e2e.ts

Test Suites: 2 passed, 2 total
Tests:       6 passed, 6 total
Snapshots:   0 total
Time:        3.324s
Ran all test suites.

what happens when you re-run npm test?

jherdman commented 5 years ago

Re-running this on a newly instantiated project and... it works! Yay! Closing and ¯\_(ツ)_/¯.

jgravois commented 5 years ago

Re-running this ... works.

👍. may you fart long into the night.