-
Notifications
You must be signed in to change notification settings - Fork 2
first class JUnit support for Mocha/Jest #1133
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
aaf4116
90335cb
2977bd1
1402742
b49b777
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,9 +63,14 @@ export { JestSchema as schema } | |
| export default class Jest extends Task<{ task: typeof JestSchema }> { | ||
| async run({ cwd }: TaskRunContext): Promise<void> { | ||
| const args = ['--colors', this.options.configPath ? `--config=${this.options.configPath}` : ''] | ||
| const env: Record<string, string> = {} | ||
|
|
||
| if (this.options.ci) { | ||
| args.push('--ci') | ||
| args.push('--ci', '--reporters=default', '--reporters=jest-junit') | ||
|
|
||
| env.JEST_JUNIT_OUTPUT_DIR = 'test-results' | ||
ivomurrell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| env.JEST_JUNIT_ADD_FILE_ATTRIBUTE = 'true' | ||
|
|
||
| // only relevant if running on CircleCI, other CI environments might handle | ||
| // virtualisation completely differently | ||
| if (process.env.CIRCLECI) { | ||
|
|
@@ -77,7 +82,7 @@ export default class Jest extends Task<{ task: typeof JestSchema }> { | |
| } | ||
|
|
||
| this.logger.info(`running jest ${args.join(' ')}`) | ||
| const child = fork(jestCLIPath, args, { silent: true, cwd }) | ||
| const child = fork(jestCLIPath, args, { silent: true, cwd, env }) | ||
|
||
| hookFork(this.logger, 'jest', child) | ||
| return waitOnExit('jest', child) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ tasks: | |
|
|
||
| commands: | ||
| 'test:local': Mocha | ||
| 'test:ci': Mocha | ||
| 'test:ci': | ||
| Mocha: | ||
| ci: true | ||
|
|
||
| version: 2 | ||
Uh oh!
There was an error while loading. Please reload this page.