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

Change some packages including Webpack, Jest and Babel to sort vulnerabilities #338

Merged
merged 9 commits into from
Jan 23, 2025
8 changes: 5 additions & 3 deletions bootstrapping-lambda/src/middleware/auth-middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { AuthenticatedRequest, getAuthMiddleware } from "./auth-middleware";
import { Response } from "express";
import { userHasPermission } from "../permissionCheck";
import { getVerifiedUserEmail } from "../panDomainAuth";
import { mocked } from "ts-jest/utils";
import { mocked } from "jest-mock";

jest.mock("../permissionCheck");
jest.mock("../panDomainAuth");

const mockedGetVerifiedUserEmail = mocked(getVerifiedUserEmail, true);
const mockedUserHasPermission = mocked(userHasPermission, true);
const mockedGetVerifiedUserEmail = mocked(getVerifiedUserEmail, {
shallow: true,
});
const mockedUserHasPermission = mocked(userHasPermission, { shallow: true });

const mockNextFunction = jest.fn();

Expand Down
10 changes: 5 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"react-shadow": "^19.0.2"
},
"devDependencies": {
"@babel/core": "^7.17.4",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@emotion/babel-preset-css-prop": "^11.2.0",
"@prefresh/webpack": "^3.3.3",
"@svgr/webpack": "^6.2.1",
Expand All @@ -48,8 +48,8 @@
"jest-environment-node": "^26.6.2",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.2.0",
"webpack-merge": "^5.8.0"
}
}
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ module.exports = {
"<rootDir>/fileTransformer.js",
},
testEnvironment: "jest-environment-node",
snapshotFormat: {
// Use pre v28 Jest snapshot defaults, to prevent incompatible snapshots
escapeString: true,
printBasicPrototype: true,
},
moduleNameMapper: {
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
"^uuid$": require.resolve("uuid"),
},
};
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@graphql-codegen/typescript": "^4.1.2",
"@guardian/node-riffraff-artifact": "0.3.2",
"@types/aws-lambda": "^8.10.114",
"@types/jest": "^26.0.22",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.1",
"@types/node-fetch": "^2.6.3",
"@types/prompts": "^2.0.14",
Expand All @@ -50,15 +50,16 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-react": "^7.21.5",
"husky": "^7.0.0",
"jest": "^26.6.3",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
"lint-staged": ">=10",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.6",
"prompts": "^2.4.2",
"ts-jest": "^26.5.4",
"ts-jest": "^29.2.5",
"tsafe": "^1.0.1",
"typescript": "^5.7.2",
"wsrun": "^5.2.4",
"yarn-run-all": "^3.1.1"
"typescript": "^5.7.3",
"wsrun": "^5.2.4"
},
"lint-staged": {
"**/*.{ts, tsx}": "eslint --fix",
Expand Down
Loading
Loading