You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Stencil Version
2.18.1
Current Behavior
When running Stencil tests with the --json flag, previously, JSON would be output on a successful test run. With Stencil v2.18.1, it appears that this flag no longer works as expected - no output is created when tests are run with this flag.
Expected Behavior
JSON is output when stencil test --json is run with for a project.
This works on a project using v2.16:
npx stencil test --spec --json -- my-component.spec.ts
[36:14.5] @stencil/core
[36:14.6] v2.16.1 🎻
[36:14.7] testing spec files
[36:14.7] jest args: --json -- my-component.spec.ts --spec --max-workers=8
PASS src/components/my-component/my-component.spec.ts
my-component
✓ renders (9 ms)
✓ renders with values (2 ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 0.24 s, estimated 1 s
Ran all test suites matching /my-component.spec.ts|--spec|--max-workers=8/i.
{"numFailedTestSuites":0,"numFailedTests":0,"numPassedTestSuites":1,"numPassedTests":2,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":0,"numTodoTests":0,"numTotalTestSuites":1,"numTotalTests":2,"openHandles":[],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1666028175170,"success":true,"testResults":[{"assertionResults":[{"ancestorTitles":["my-component"],"failureMessages":[],"fullName":"my-component renders","location":null,"status":"passed","title":"renders"},{"ancestorTitles":["my-component"],"failureMessages":[],"fullName":"my-component renders with values","location":null,"status":"passed","title":"renders with values"}],"endTime":1666028175407,"message":"","name":"/private/tmp/json-test/src/components/my-component/my-component.spec.ts","startTime":1666028175184,"status":"passed","summary":""}],"wasInterrupted":false}
Steps to Reproduce
Generate a new project using the create-stencil CLI: npm init stencil component json-test
cd json-test && npm i to get dependencies
Run:
npx stencil test --spec --json -- my-component.spec.ts
[56:20.5] @stencil/core
[56:20.6] v2.18.1 😛
[56:20.7] testing spec files
[56:20.7] jest args: -- my-component.spec.ts --spec --json --max-workers=8
PASS src/components/my-component/my-component.spec.ts
my-component
✓ renders (10 ms)
✓ renders with values (2 ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 0.264 s, estimated 1 s
Ran all test suites matching /my-component.spec.ts|--spec|--json|--max-workers=8/i.
Note the line at the end:
Ran all test suites matching /my-component.spec.ts|--spec|--json|--max-workers=8/i.
To see the program working:
2. npm i @stencil/[email protected]
3. Run:
npx stencil test --spec --json -- my-component.spec.ts
[57:44.0] @stencil/core
[57:44.1] v2.16.1 🎻
[57:44.2] testing spec files
[57:44.2] jest args: --json -- my-component.spec.ts --spec --max-workers=8
PASS src/components/my-component/my-component.spec.ts
my-component
✓ renders (10 ms)
✓ renders with values (2 ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 0.259 s, estimated 1 s
Ran all test suites matching /my-component.spec.ts|--spec|--max-workers=8/i.
{"numFailedTestSuites":0,"numFailedTests":0,"numPassedTestSuites":1,"numPassedTests":2,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":0,"numTodoTests":0,"numTotalTestSuites":1,"numTotalTests":2,"openHandles":[],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1666029464728,"success":true,"testResults":[{"assertionResults":[{"ancestorTitles":["my-component"],"failureMessages":[],"fullName":"my-component renders","location":null,"status":"passed","title":"renders"},{"ancestorTitles":["my-component"],"failureMessages":[],"fullName":"my-component renders with values","location":null,"status":"passed","title":"renders with values"}],"endTime":1666029464984,"message":"","name":"/private/tmp/json-test/src/components/my-component/my-component.spec.ts","startTime":1666029464751,"status":"passed","summary":""}],"wasInterrupted":false}
Note on 2.16, we got
Ran all test suites matching /my-component.spec.ts|--spec|--max-workers=8/i.
This has been fixed in Stencil v2.19.0, which was just released. I'm going to close this issue as a result. If this bug should reappear, feel free to open a new issue. Thanks!
Prerequisites
Stencil Version
2.18.1
Current Behavior
When running Stencil tests with the
--json
flag, previously, JSON would be output on a successful test run. With Stencil v2.18.1, it appears that this flag no longer works as expected - no output is created when tests are run with this flag.Expected Behavior
JSON is output when
stencil test --json
is run with for a project.This works on a project using v2.16:
Steps to Reproduce
npm init stencil component json-test
cd json-test && npm i
to get dependenciesNote the line at the end:
To see the program working:
2.
npm i @stencil/[email protected]
3. Run:
Note on 2.16, we got
Code Reproduction URL
Stencil Component Starter
Additional Information
Originally seen in https://stencil-worldwide.slack.com/archives/C79EANFL7/p1666027278669499
The text was updated successfully, but these errors were encountered: