Skip to content

Commit

Permalink
feat(jest-runner): disable notifications (#1419)
Browse files Browse the repository at this point in the history
Turning off jest notifications when running with Stryker:
https://media.giphy.com/media/8UGFvYxcwWWDrblA77/giphy.gif
  • Loading branch information
ollelauribostrom authored and nicojs committed Feb 27, 2019
1 parent a3018d2 commit 948166b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/jest-runner/src/jestOverrideOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const JEST_OVERRIDE_OPTIONS = Object.freeze({

// Disable bail so the jest process does not quit with a non-zero exit code
bail: false,

// Disable notifications for test results, this will otherwise show a notification about
// the results each time Stryker runs the tests
notify: false
});

export default JEST_OVERRIDE_OPTIONS;
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Integration test for Jest ConfigEditor', () => {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'^react-native$': 'react-native-web'
},
notify: false,
rootDir: projectRoot,
setupFiles: [path.join(projectRoot, 'node_modules', 'react-app-polyfill', 'jsdom.js')],
setupTestFrameworkScriptFile: undefined,
Expand Down Expand Up @@ -107,6 +108,7 @@ describe('Integration test for Jest ConfigEditor', () => {
moduleNameMapper: {
'^react-native$': 'react-native-web'
},
notify: false,
rootDir: projectRoot,
setupFiles: [path.join(projectRoot, 'node_modules', 'react-scripts-ts', 'config', 'polyfills.js')],
setupTestFrameworkScriptFile: undefined,
Expand Down Expand Up @@ -142,6 +144,7 @@ describe('Integration test for Jest ConfigEditor', () => {
bail: false,
collectCoverage: false,
moduleFileExtensions: ['js', 'json', 'jsx', 'node'],
notify: false,
testEnvironment: 'jest-environment-jsdom',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
testResultsProcessor: undefined,
Expand All @@ -161,6 +164,7 @@ describe('Integration test for Jest ConfigEditor', () => {
bail: false,
collectCoverage: false,
moduleFileExtensions: ['js', 'json', 'jsx', 'node'],
notify: false,
testEnvironment: 'jest-environment-jsdom',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
testResultsProcessor: undefined,
Expand All @@ -178,6 +182,7 @@ describe('Integration test for Jest ConfigEditor', () => {
expect(config.jest.config).to.deep.equal({
bail: false,
collectCoverage: false,
notify: false,
testResultsProcessor: undefined,
verbose: false,
});
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-runner/test/unit/JestConfigEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ describe('JestConfigEditor', () => {
assert(reactScriptsTSJestConfigLoaderStub.loadConfig.calledOnce, 'ReactScriptsTSJestConfigLoader loadConfig not called');
});

it('should override verbose, collectCoverage, testResultsProcessor and bail on all loaded configs', () => {
it('should override verbose, collectCoverage, testResultsProcessor, notify and bail on all loaded configs', () => {
sut.edit(config);

expect(config.jest.config).to.deep.equal({
bail: false,
collectCoverage: false,
notify: false,
testResultsProcessor: undefined,
verbose: false
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"testURL": "http://localhost",
"collectCoverage": true,
"verbose": true,
"bail": false
"bail": false,
"notify": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
collectCoverage: true,
verbose: true,
testURL: "http://localhost",
bail: false
}
bail: false,
notify: true,
}

0 comments on commit 948166b

Please sign in to comment.