Skip to content
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

Strip out enzyme and react-test-renderer #140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"ImportDeclaration": { "minProperties": 12, "multiline": true, "consistent": true },
"ExportDeclaration": { "minProperties": 12, "multiline": true, "consistent": true }
}],
"react/no-invalid-html-attribute": [0],
"react/jsx-props-no-spreading": [0],
"quote-props": [0]
},
Expand Down
11 changes: 4 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module.exports = {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': 'identity-obj-proxy',
"axios": "axios/dist/node/axios.cjs",
},
// modulePathIgnorePatterns: [],
// notify: false,
Expand All @@ -65,19 +64,17 @@ module.exports = {
// setupFiles: [],
setupFilesAfterEnv: ['./__mocks__/client.js', 'jest-extended/all', '<rootDir>/test/setup.js'],
// slowTestThreshold: 5,
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jsdom',
// testEnvironmentOptions: {},
// testLocationInResults: false,
// testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)"
],
testPathIgnorePatterns: [],
// testRegex: [],
// testResultsProcessor: undefined,
// testRunner: "jasmine2",
testURL: 'http://localhost',
// timers: "real",
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
Expand Down
69 changes: 34 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@
"@babel/preset-flow": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@babel/register": "^7.10.5",
"@blueprintjs/core": "^3.31.0",
"@blueprintjs/core": "^5.10.1",
"@formatjs/intl-datetimeformat": "^6.0.2",
"@root/file-cookie-store": "^1.0.1",
"autoprefixer": "^10.4.0",
"axios": "^1.6.2",
"babel-loader": "^8.1.0",
"babel-loader": "^9.1.3",
"babel-plugin-jest-hoist": "^29.0.2",
"bootstrap-sass": "^3.3.6",
"classnames": "^2.2.6",
"cli-table": "^0.3.1",
"core-js": "^3.26.1",
"crypto-js": "^4.2.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^4.0.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"css-modules-flow-types-loader": "^2.0.0",
"enzyme": "^3.11.0",
"es5-shim": "^4.5.14",
"file-loader": "^6.0.0",
"firebase": "^9.6.0",
"firebase": "^10.10.0",
"flow-typed": "^3.2.1",
"html-webpack-plugin": "^5.5.0",
"html5shiv": "^3.7.3",
"http-cookie-agent": "^4.0.2",
"i18next": "^21.10.0",
"i18next-browser-languagedetector": "^6.0.1",
"http-cookie-agent": "^6.0.3",
"i18next": "^23.10.1",
"i18next-browser-languagedetector": "^7.2.1",
"ignore-styles": "^5.0.1",
"jest-environment-jsdom": "^29.7.0",
"lodash.debounce": "^4.0.8",
"lodash.difference": "^4.5.0",
"lodash.flatten": "^4.4.0",
Expand All @@ -76,60 +76,59 @@
"mini-css-extract-plugin": "^2.4.5",
"moment": "^2.29.2",
"postcss": "^8.4.31",
"postcss-loader": "^7.0.1",
"postcss-loader": "^8.1.1",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-hot-loader": "^4.12.21",
"react-i18next": "^11.18.6",
"react-modal": "^3.11.2",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"react-i18next": "14.1.0",
"react-redux": "9.1.0",
"redux": "5.0.1",
"redux-localstorage": "^1.0.0-rc5",
"redux-localstorage-filter": "^0.1.1",
"redux-thunk": "^2.3.0",
"respond.js": "^1.4.2",
"sass": "^1.44.0",
"sass-loader": "^13.0.2",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.2.5",
"tough-cookie": "^4.1.3",
"url-loader": "^4.1.0",
"util.promisify": "^1.1.1",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"devDependencies": {
"@jest/globals": "^27.4.2",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^12.1.2",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.5",
"@jest/globals": "^29.7.0",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@testing-library/user-event": "^14.5.2",
"babel-eslint": "^10.1.0",
"enzyme-to-json": "^3.5.0",
"eslint": "^7.10.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-flowtype": "^5.2.0",
"babel-jest": "^29.7.0",
"eslint": "8.57.0",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-jest": "27.9.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.21.3",
"eslint-plugin-react-hooks": "^4.1.2",
"flow-bin": "^0.173.0",
"flow-bin": "0.233.0",
"flush-promises": "^1.0.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.4.3",
"jest": "^29.7.0",
"jest-css-modules-transform": "^4.0.1",
"jest-extended": "^1.2.0",
"jsdom": "^20.0.2",
"jest-extended": "^4.0.2",
"jsdom": "^24.0.0",
"mockdate": "^3.0.2",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.2.0",
"redux-logger": "^3.0.6",
"redux-mock-store": "^1.5.4",
"regenerator-runtime": "^0.13.7",
"snapshot-diff": "^0.9.0",
"snapshot-diff": "^0.10.0",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-dev-server": "^4.6.0"
"webpack-dev-server": "^5.0.4"
},
"resolutions": {
"@root/file-cookie-store/**/tough-cookie": "^4.1.3"
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/App.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, test } from '@jest/globals';
import moment from 'moment';
import React from 'react';
import renderer from 'react-test-renderer';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
Expand Down Expand Up @@ -53,9 +53,9 @@ describe('components/App', () => {

test('renders correctly', () => {
const store = mockStore(defaultStore);
const component = renderer.create(<Provider store={store}><App /></Provider>);
const { container } = render(<Provider store={store}><App /></Provider>);

expect(component.toJSON()).toMatchSnapshot();
expect(container.firstChild).toMatchSnapshot();
expect(store.getActions()[0].type).toEqual(SIGNED_IN);
expect(store.getActions()[0].user).not.toBeDefined();

Expand Down
Loading
Loading