-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Unable to run Jest spec files from subdirectory or absolute path #3785
Comments
|
found a few issues which might be related: playwright-community/jest-playwright#665 and jestjs/jest#11267 (comment) Unfortunately upgrading Jest in framework doesn't fix it :/ |
also I've found that in addition to the commands @rwaskiewicz mentioned above, the following works:
while the following does not
the only difference being the trailing slash. So something odd is going on here! |
Ok so this is actually some sort of caching thing, I think on Jest’s side of things but I’m not sure. Basically if you run a command like this one multiple times in a row:
it will alternate between running correctly and failing. The same applies for doing npm run tsc.spec , passing other sub-directories, etc. |
Aaaallright so the issue was caused by having different versions of |
This harmonizes the versions of Jest installed in Framework to address an issue reported in Stencil here: ionic-team/stencil#3785 The issue is essentially that certain test commands, such as this one: ``` npx stencil test --spec --max-workers=2 src/utils/keyboard/test/ ``` will, at present, alternate between running the tests as expected and failing. Not good! The issue is caused by having different @jest/core, on the one hand, and jest and jest-cli on the other. After updating jest and jest-cli in a to match the version of @jest/core (27.5.1) and the issue can no longer be reproduced.
…ching This harmonizes the versions of Jest installed in Framework to address an issue reported in Stencil here: ionic-team/stencil#3785 The issue is essentially that certain test commands, such as this one: ``` npx stencil test --spec --max-workers=2 src/utils/keyboard/test/ ``` will, at present, alternate between running the tests as expected and failing. Not good! The issue is caused by having different @jest/core, on the one hand, and jest and jest-cli on the other. After updating jest and jest-cli in a to match the version of @jest/core (27.5.1) and the issue can no longer be reproduced.
…ching This harmonizes the versions of Jest installed in Framework to address an issue reported in Stencil here: ionic-team/stencil#3785 The issue is essentially that certain test commands, such as this one: ``` npx stencil test --spec --max-workers=2 src/utils/keyboard/test/ ``` will, at present, alternate between running the tests as expected and failing. Not good! The issue is caused by having different versions of `@jest/core`, on the one hand, and `jest` and `jest-cli` on the other. After updating `jest` and `jest-cli` to match the version of `@jest/core` (`27.5.1`) and the issue can no longer be reproduced.
…ching (#26320) This harmonizes the versions of Jest installed in Framework to address an issue reported in Stencil here: ionic-team/stencil#3785 The issue is essentially that certain test commands, such as this one: ``` npx stencil test --spec --max-workers=2 src/utils/keyboard/test/ ``` will, at present, alternate between running the tests as expected and failing. Not good! The issue is caused by having different versions of `@jest/core`, on the one hand, and `jest` and `jest-cli` on the other. After updating `jest` and `jest-cli` to match the version of `@jest/core` (`27.5.1`) and the issue can no longer be reproduced.
Closing, as we received feedback from the Framework team that ionic-team/ionic-framework#26320 resolved the issue |
Prerequisites
Stencil Version
v2.19.2
Current Behavior
When running
stencil test --spec
in Ionic Framework (main
), we are only able to run tests for the entiresrc/utils
directory with the following command:If we provide an additional sub directory or absolute path to our spec file, we receive the following error:
This occurs with any of the following:
The test runs and passes correctly if we run from
src/utils
.Expected Behavior
Developers should be able to run the
stencil test --spec
command with any valid directory or absolute path and the spec files should execute consistently; regardless of if ran exclusively or as part of a larger directory.Steps to Reproduce
main
branchnpm run test.spec src/utils
npm run test.spec src/utils/keyboard
Code Reproduction URL
https://github.com/ionic-team/ionic-framework
Additional Information
No response
The text was updated successfully, but these errors were encountered: