-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use jest to mask account number in snapshot #21
Conversation
setupFilesAfterEnv: ["./jest.setup.js"], | ||
transformIgnorePatterns: ["node_modules/(?!@guardian/private-infrastructure-config)"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 2 and 3 were added because of the instructions here: https://github.com/guardian/private-infrastructure-config?tab=readme-ov-file#using-with-jest
testMatch: ["<rootDir>/lib/**/*.test.ts"], | ||
transform: {"^.+\\.tsx?$": "ts-jest"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 4 and 5 were taken from the package.json and moved here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - looks like it does exactly what we wanted :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this change?
The DevEx team have recommended using jest to mask the account number in the snapshot.
Following the steps outlined here https://github.com/guardian/private-infrastructure-config?tab=readme-ov-file#using-with-jest seems to have done the trick.