Moving Jest setup and consolidating
This commit is contained in:
parent
2904519ff5
commit
fcba4b75ec
@ -29,7 +29,7 @@
|
||||
],
|
||||
"jest": {
|
||||
"clearMocks": true,
|
||||
"setupTestFrameworkScriptFile": "<rootDir>/src/setup-jest.js",
|
||||
"setupTestFrameworkScriptFile": "<rootDir>/src/setup/jest.js",
|
||||
"snapshotSerializers": [
|
||||
"enzyme-to-json/serializer"
|
||||
],
|
||||
|
@ -3,18 +3,9 @@ import { shallow } from 'enzyme';
|
||||
|
||||
import { Header } from 'components/Header';
|
||||
|
||||
const env = { ...process.env };
|
||||
|
||||
describe('Header', () => {
|
||||
afterEach(() => {
|
||||
process.env = env;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
process.env = {
|
||||
...process.env,
|
||||
BANNER: 'testing'
|
||||
};
|
||||
process.env.BANNER = 'testing';
|
||||
});
|
||||
|
||||
test('rendering', () => {
|
||||
|
@ -1,4 +0,0 @@
|
||||
import Enzyme from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
Enzyme.configure({ adapter: new Adapter() });
|
16
src/setup/jest.js
Normal file
16
src/setup/jest.js
Normal file
@ -0,0 +1,16 @@
|
||||
import Enzyme from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
Enzyme.configure({ adapter: new Adapter() });
|
||||
|
||||
const env = { ...process.env };
|
||||
|
||||
beforeEach(() => {
|
||||
process.env = {
|
||||
...process.env
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.env = env;
|
||||
});
|
Loading…
Reference in New Issue
Block a user