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

[FEE-524] Address dependabot issues #1241

Merged
merged 3 commits into from
Jun 20, 2024
Merged
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 jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config: Config.InitialOptions = {
setupFilesAfterEnv: ['<rootDir>src/tooling/helpers.ts'],
testEnvironment: 'jsdom',
coveragePathIgnorePatterns: ['tooling'],
resolver: `<rootDir>/src/tests/common/resolver.js`,
};

export default config;
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
},
"devDependencies": {
"@appfolio/eslint-config-appfolio-react": "^2.0.2",
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.24.7",
"@babel/core": "^7.24.7",
mdalpozzo marked this conversation as resolved.
Show resolved Hide resolved
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@chromatic-com/storybook": "^1.5.0",
"@jest/types": "^27.5.1",
"@jest/types": "^29.6.3",
mdalpozzo marked this conversation as resolved.
Show resolved Hide resolved
"@storybook/addon-a11y": "^8.1.5",
"@storybook/addon-actions": "^8.1.5",
"@storybook/addon-controls": "^8.1.5",
Expand All @@ -100,9 +100,9 @@
"@storybook/addon-viewport": "^8.1.5",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/react": "^8.1.5",
"@storybook/react-webpack5": "^8.1.5",
"@storybook/react-webpack5": "^8.1.6",
"@testing-library/dom": "^8.13.0",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^11.2.6",
"@testing-library/react-hooks": "^5.1.2",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -111,7 +111,7 @@
"@types/enzyme": "^3.10.8",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/invariant": "^2.2.35",
"@types/jest": "^27.4.1",
"@types/jest": "^29.5.12",
"@types/lodash.flow": "^3.5.6",
"@types/lodash.isequal": "^4.5.5",
"@types/lodash.noop": "^3.0.6",
Expand Down Expand Up @@ -143,7 +143,8 @@
"fs-extra": "10.0.1",
"glob": "^7.1.6",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^11.12.0",
"jsdom-global": "^3.0.2",
"prettier": "^2.5.1",
Expand Down
33 changes: 33 additions & 0 deletions src/tests/common/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// see the following docs for more info:
// https://jest-archive-august-2023.netlify.app/docs/28.x/upgrading-to-jest28/#packagejson-exports
// https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149

// Call the defaultResolver, so we leverage its cache, error handling, etc.
module.exports = (path, options) =>
options.defaultResolver(path, {
...options,
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb)
packageFilter: (pkg) => {
// This is a workaround for https://github.com/uuidjs/uuid/pull/616
//
// jest-environment-jsdom 28+ tries to use browser exports instead of default exports,
// but uuid only offers an ESM browser export and not a CommonJS one. Jest does not yet
// support ESM modules natively, so this causes a Jest error related to trying to parse
// "export" syntax.
//
// This workaround prevents Jest from considering uuid's module-based exports at all;
// it falls back to uuid's CommonJS+node "main" property.
//
// Once we're able to migrate our Jest config to ESM and a browser crypto
// implementation is available for the browser+ESM version of uuid to use (eg, via
// https://github.com/jsdom/jsdom/pull/3352 or a similar polyfill), this can go away.
if (pkg.name === 'uuid') {
delete pkg.exports;
delete pkg.module;
}
return pkg;
},
});
Loading
Loading