-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(testing): Support default Webstorm test runner #1467
feat(testing): Support default Webstorm test runner #1467
Conversation
b2863fb
to
a6b5ae2
Compare
Hey thanks for the contribution! How did you setup Webstorm exactly? The default test runner for me runs |
The default settings settings correctly configure the test runner as The specific issue is Webstorm passes arguments that are supported by jest but not implemented by the builder. The unsupported arguments result in the command failing due to unknown options. My pull request implements the additional arguments that are supported by jest. /Users/bxd5017/.nvm/versions/node/v12.2.0/bin/node
--require "/Users/bxd5017/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-1/191.7479.14/WebStorm.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js"
/Users/bxd5017/tmp/usom-client/node_modules/@angular/cli/bin/ng test
test-project
--colors
--reporters "/Users/bxd5017/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-1/191.7479.14/WebStorm.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js" --verbose "
--testPathPattern='^/Users/bxd5017/tmp/test-workspace/apps/test-app/src/app/app.component\.spec\.ts$'
Unknown option: '--colors'
Unknown option: '--reporters /Users/bxd5017/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-1/191.7479.14/WebStorm.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js'
Unknown option: '--verbose'
Unknown option: '--testPathPattern' The exact webstorm and node version is in the above output. I used the default setup and was able to reproduce with multiple different versions of webstorm. The versions were installed with the jetbrains toolbox and the license comes from an enterprise license server. This means each install is defaults only and no settings were transferred from my personal jetbrains account. |
One way that allows webstorm to debug properly and not continue with the zonejs issue:
The test config object was also deleted from the angular.json. That is probably not be necessary since we're using the package.json to setup jest. For now...hope this helps others that have run into this. |
@@ -76,6 +91,13 @@ | |||
"description": "Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/en/cli#testnamepattern-regex)", | |||
"type": "string" | |||
}, | |||
"testPathPattern": { | |||
"description": "A regexp pattern string that is matched against all tests paths before executing the test.", | |||
"type": "array", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be type string
docs/api-jest/builders/jest.md
Outdated
@@ -110,6 +128,12 @@ Type: `string` | |||
|
|||
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/en/cli#testnamepattern-regex) | |||
|
|||
### testPathPattern | |||
|
|||
Type: `array` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be type string
@dopsonbr could you rebase? |
3569a53
to
54d5826
Compare
a6b5ae2
to
4db3049
Compare
Update jest builer to support the options config, colors, reporters, verbose, and testPathPattern.
4db3049
to
fbf3e8d
Compare
@vsavkin after rebasing it looks like my changes were already merged/made in a different branch. I'll check the webstorm later today with a clean project, but I'm closing the PR for now. |
Because I landed here via google... #1439 (comment) was the solution which worked for me.
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
feat(testing): Support default Webstorm test runner
This change adds additional jest options to builder's
schema.json
and maps them injest.impl.ts
.Expected Behavior
Webstorm is able to run jest tests without updating the configuration.
Webstorm should be able to open a spec file, click the play icon for the relevant test, and the test should run without an error.
Current Behavior
Webstorm attempts to run the tests with options supported by jest but the builder.
The unknown options cause the IDE test runner to error with out running the tests.
The specific options are config, colors, reporters, verbose, and testPathPattern.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.