From 49f2eac94c2a8ce0f586a95c1325f789eff341a2 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Wed, 11 Oct 2023 16:52:19 -0400 Subject: [PATCH 1/2] Update React, Stripes to Poppy versions --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 743d46be..3f7454d2 100644 --- a/package.json +++ b/package.json @@ -110,9 +110,9 @@ "formatjs-compile": "formatjs compile-folder --ast --format simple ./translations/ui-calendar ./translations/ui-calendar/compiled" }, "devDependencies": { - "@folio/eslint-config-stripes": "^6.3.0", - "@folio/stripes": "^8.0.0", - "@folio/stripes-cli": "^2.6.0", + "@folio/eslint-config-stripes": "^7.0.0", + "@folio/stripes": "^9.0.0", + "@folio/stripes-cli": "^3.0.0", "@folio/stripes-components": "^11.0.0", "@folio/stripes-core": "^9.0.0", "@folio/stripes-final-form": "^7.0.0", @@ -139,8 +139,8 @@ "jest-junit": "^14.0.0", "localforage": "^1.10.0", "prettier": "^2.7.0", - "react": "^17.0.2", - "react-dom": "^17.0.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-intl": "^6.4.4", "react-router-dom": "^5.2.0", "ts-jest": "^28.0.7", @@ -160,10 +160,10 @@ "utility-types": "^3.10.0" }, "peerDependencies": { - "@folio/stripes": "^8.0.0", + "@folio/stripes": "^9.0.0", "final-form": "^4.20.7", - "react": "^17.0.2", - "react-dom": "^17.0.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-final-form": "^6.5.9", "react-intl": "^6.4.4", "react-query": "^3.39.2", From ae356e3369c7b6cd0432f470c2ab25db3f63ca67 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Wed, 11 Oct 2023 17:14:20 -0400 Subject: [PATCH 2/2] Update more versions; assorted fixes --- jest.config.js | 12 +--- package.json | 59 ++++++++----------- src/index.test.tsx | 8 +-- .../WeekdayUtils.getLocaleWeekdays.test.ts | 2 +- 4 files changed, 33 insertions(+), 48 deletions(-) diff --git a/jest.config.js b/jest.config.js index 448033fb..81d3cb65 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,12 +1,12 @@ const { join } = require('path'); -/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { testEnvironment: 'jsdom', preset: 'ts-jest', transform: { - '^.+\\.(t|j)sx?$': 'ts-jest' + '^.+\\.(t|j)sx?$': ['ts-jest', { tsconfig: 'src/tsconfig.json' }] }, transformIgnorePatterns: ['node_modules/(?!@folio|ky)'], @@ -37,11 +37,5 @@ module.exports = { uuid: require.resolve('uuid') }, - slowTestThreshold: 10, - - globals: { - 'ts-jest': { - tsconfig: 'src/tsconfig.json' - } - } + slowTestThreshold: 10 }; diff --git a/package.json b/package.json index 3f7454d2..fde68174 100644 --- a/package.json +++ b/package.json @@ -113,50 +113,41 @@ "@folio/eslint-config-stripes": "^7.0.0", "@folio/stripes": "^9.0.0", "@folio/stripes-cli": "^3.0.0", - "@folio/stripes-components": "^11.0.0", - "@folio/stripes-core": "^9.0.0", - "@folio/stripes-final-form": "^7.0.0", - "@folio/stripes-form": "^8.0.0", - "@folio/stripes-smart-components": "^8.0.0", - "@folio/stripes-testing": "^4.2.0", - "@formatjs/cli": "^6.1.3", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^12.1.5", - "@testing-library/react-hooks": "^8.0.1", - "@testing-library/user-event": "^14.4.3", - "@types/jest": "^28.1.6", - "@types/memoizee": "^0.4.8", - "@types/react-router-dom": "^5.2.0", - "@typescript-eslint/eslint-plugin": "^5.33.0", - "@typescript-eslint/parser": "^5.33.0", - "babel-polyfill": "^6.26.0", - "element-is-visible": "^1.0.0", - "eslint": "^7.32.0", + "@formatjs/cli": "^6.2.0", + "@testing-library/jest-dom": "^6.1.3", + "@testing-library/react": "^14.0.0", + "@testing-library/user-event": "^14.5.1", + "@types/jest": "^29.5.5", + "@types/react": "^18.2.0", + "@typescript-eslint/eslint-plugin": "^6.7.2", + "@typescript-eslint/parser": "^6.7.2", + "eslint": "^8.49.0", "eslint-import-resolver-webpack": "^0.13.2", "identity-obj-proxy": "^3.0.0", - "jest": "^28.1.3", - "jest-environment-jsdom": "^28.1.3", - "jest-junit": "^14.0.0", - "localforage": "^1.10.0", - "prettier": "^2.7.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", + "prettier": "^3.0.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-intl": "^6.4.4", + "react-intl": "^6.4.7", "react-router-dom": "^5.2.0", - "ts-jest": "^28.0.7", - "typescript": "^4.7.4" + "ts-jest": "^29.1.1", + "typescript": "^5.2.2" }, "dependencies": { "@types/memoizee": "^0.4.8", - "@types/react-router-dom": "^5.2.0", - "classnames": "^2.3.1", - "dayjs": "^1.11.2", - "dom-helpers": "^5.2.1", - "dotenv": "^16.0.3", - "fuzzysort": "^2.0.1", - "history": "^4.9.0", + "@types/react-router-dom": "^5.3.3", + "classnames": "^2.3.2", + "dayjs": "^1.11.10", + "final-form": "^4.20.10", + "final-form-arrays": "^3.1.0", + "fuzzysort": "^2.0.4", + "history": "^5.3.0", "ky": "^0.31.1", "memoizee": "^0.4.15", + "react-final-form": "^6.5.9", + "react-final-form-arrays": "^3.1.4", "utility-types": "^3.10.0" }, "peerDependencies": { diff --git a/src/index.test.tsx b/src/index.test.tsx index 18dbbc77..1e31feb5 100644 --- a/src/index.test.tsx +++ b/src/index.test.tsx @@ -7,8 +7,8 @@ describe('Main index.tsx entry point', () => { it('renders appropriately when it should not be showing', () => { expectRender( true, connect: () => ({}) } as StripesType} + location={{ pathname: 'foo', search: '', state: undefined, hash: '', key: 'foo' }} forceRender={0} /> ).toContain('How did you get to foo?'); @@ -17,8 +17,8 @@ describe('Main index.tsx entry point', () => { it('renders appropriately when it should be showing', () => { expectRender( true, connect: () => ({}) } as StripesType} + location={{ pathname: 'foo', search: '', state: undefined, hash: '', key: 'foo' }} forceRender={0} showSettings /> diff --git a/src/utils/WeekdayUtils.getLocaleWeekdays.test.ts b/src/utils/WeekdayUtils.getLocaleWeekdays.test.ts index 81e8755e..f6ce9f6c 100644 --- a/src/utils/WeekdayUtils.getLocaleWeekdays.test.ts +++ b/src/utils/WeekdayUtils.getLocaleWeekdays.test.ts @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { IntlShape } from 'react-intl'; import * as Weekdays from '../test/data/Weekdays'; import getIntl from '../test/util/getIntl';