Skip to content

Commit

Permalink
Fix Jest console.assert
Browse files Browse the repository at this point in the history
See console.assert not throwing with v22.4.0 jestjs/jest#5634
  • Loading branch information
tkrotoff committed Apr 23, 2018
1 parent 3e49b14 commit a754b18
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
setupFiles: ['../react-form-with-constraints/src/SetupEnzyme.ts'],
setupFiles: ['../react-form-with-constraints/src/JestSetup.ts'],

transform: {
'^.+\\.tsx?$': 'ts-jest'
Expand All @@ -9,6 +9,5 @@ module.exports = {

collectCoverageFrom: [
'src/**/*.{ts,tsx}'
],
mapCoverage: true
]
};
5 changes: 2 additions & 3 deletions packages/react-form-with-constraints-native/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
preset: 'react-native',

setupFiles: ['../react-form-with-constraints/src/SetupEnzyme.ts'],
setupFiles: ['../react-form-with-constraints/src/JestSetup.ts'],

transform: {
'^.+\\.tsx?$': 'ts-jest',
Expand All @@ -12,6 +12,5 @@ module.exports = {

collectCoverageFrom: [
'src/**/*.{ts,tsx}'
],
mapCoverage: true
]
};
5 changes: 2 additions & 3 deletions packages/react-form-with-constraints-tools/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
setupFiles: ['../react-form-with-constraints/src/SetupEnzyme.ts'],
setupFiles: ['../react-form-with-constraints/src/JestSetup.ts'],

transform: {
'^.+\\.tsx?$': 'ts-jest'
Expand All @@ -9,6 +9,5 @@ module.exports = {

collectCoverageFrom: [
'src/**/*.{ts,tsx}'
],
mapCoverage: true
]
};
6 changes: 2 additions & 4 deletions packages/react-form-with-constraints/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module.exports = {
setupFiles: ['./src/SetupEnzyme.ts'],
setupFiles: ['./src/JestSetup.ts'],

transform: {
'^.+\\.tsx?$': 'ts-jest'
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js'],

mapCoverage: true
moduleFileExtensions: ['ts', 'tsx', 'js']
};
8 changes: 8 additions & 0 deletions packages/react-form-with-constraints/src/JestSetup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({adapter: new Adapter()});

// FIXME See console.assert not throwing with v22.4.0 https://github.com/facebook/jest/issues/5634
import assert from 'assert';
console.assert = assert;
4 changes: 0 additions & 4 deletions packages/react-form-with-constraints/src/SetupEnzyme.ts

This file was deleted.

0 comments on commit a754b18

Please sign in to comment.