Skip to content

Commit

Permalink
Merge pull request #326 from etn-ccis/feature/blui-5239-update-test-c…
Browse files Browse the repository at this point in the history
…onfig

Blui 5239 update test config & remove enzyme
  • Loading branch information
joebochill authored Feb 1, 2024
2 parents f48ed7d + 750a16e commit 927a725
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1,373 deletions.
9 changes: 0 additions & 9 deletions login-workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
"@react-navigation/stack": "^5.2.3",
"@testing-library/react-native": "^11.5.0",
"@types/color": "^3.0.3",
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/jest": "^29.0.3",
"@types/lodash.clonedeep": "^4.5.6",
"@types/node": "^18.7.16",
Expand All @@ -109,9 +107,6 @@
"@typescript-eslint/parser": "^6.19.0",
"babel-jest": "^25.0.0",
"date-fns": "^2.11.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.4",
"eslint": "^8.23.1",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react": "^7.31.0",
Expand All @@ -121,7 +116,6 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.1.2",
"jest-enzyme": "^7.1.2",
"jest-junit": "^10.0.0",
"jsdom": "^16.2.2",
"metro-react-native-babel-preset": "^0.56.0",
Expand Down Expand Up @@ -150,9 +144,6 @@
"lines": 80
}
},
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"testEnvironment": "node",
"preset": "react-native",
"verbose": true,
Expand Down
18 changes: 2 additions & 16 deletions login-workflow/setup-tests.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import 'react-native';
import 'jest-enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import '@testing-library/react-native';
import 'jest';

// https://github.com/ProminentEdge/mobile-boilerplate/blob/master
const url = 'http://localhost';
Expand All @@ -24,16 +23,3 @@ global.navigator = {
userAgent: 'node.js',
};
copyProps(window, global);

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

const originalConsoleError = console.error;
console.error = (message) => {
// see: https://jestjs.io/docs/en/tutorial-react.html#snapshot-testing-with-mocks-enzyme-and-react-16
// see https://github.com/Root-App/react-native-mock-render/issues/6
if (message.startsWith('Warning:')) {
return;
}

originalConsoleError(message);
};
Loading

0 comments on commit 927a725

Please sign in to comment.