diff --git a/.eslintrc b/.eslintrc index 3fc2057..1b83279 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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] }, diff --git a/jest.config.js b/jest.config.js index 8a393a4..0c2febe 100644 --- a/jest.config.js +++ b/jest.config.js @@ -45,7 +45,6 @@ module.exports = { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/__mocks__/fileMock.js', '\\.(css|scss)$': 'identity-obj-proxy', - "axios": "axios/dist/node/axios.cjs", }, // modulePathIgnorePatterns: [], // notify: false, @@ -65,19 +64,17 @@ module.exports = { // setupFiles: [], setupFilesAfterEnv: ['./__mocks__/client.js', 'jest-extended/all', '/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)$': '/node_modules/babel-jest', diff --git a/package.json b/package.json index 3bd4a3f..9e6afe4 100644 --- a/package.json +++ b/package.json @@ -38,12 +38,12 @@ "@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", @@ -51,19 +51,19 @@ "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", @@ -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" diff --git a/src/__tests__/App.test.js b/src/__tests__/App.test.js index 7c0f40d..d8d5ead 100644 --- a/src/__tests__/App.test.js +++ b/src/__tests__/App.test.js @@ -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'; @@ -53,9 +53,9 @@ describe('components/App', () => { test('renders correctly', () => { const store = mockStore(defaultStore); - const component = renderer.create(); + const { container } = render(); - expect(component.toJSON()).toMatchSnapshot(); + expect(container.firstChild).toMatchSnapshot(); expect(store.getActions()[0].type).toEqual(SIGNED_IN); expect(store.getActions()[0].user).not.toBeDefined(); diff --git a/src/__tests__/__snapshots__/App.test.js.snap b/src/__tests__/__snapshots__/App.test.js.snap index f821de1..e4e17bd 100644 --- a/src/__tests__/__snapshots__/App.test.js.snap +++ b/src/__tests__/__snapshots__/App.test.js.snap @@ -3,42 +3,40 @@ exports[`components/App renders correctly 1`] = `

Sponsored

Looking for iRacing Setups?

Grab a setup from Coach Dave Academy, developed by professional sim racers and engineers.

Browse Setups

@@ -307,90 +281,81 @@ exports[`components/App renders correctly 1`] = ` Filters

Type