Skip to content

Commit

Permalink
Adapt jest.useFakeTimers for jest upgrade (#743)
Browse files Browse the repository at this point in the history
This is a preparation for the jest upgrade #616
  • Loading branch information
sven-urbanski-freiheit-com authored Jun 21, 2023
1 parent d8f6214 commit 3e61faa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/frontend-service/src/ui/App/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const getWrapper = () => render(getNode());

describe('App uses the API', () => {
beforeAll(() => {
jest.useFakeTimers('modern');
jest.useFakeTimers();
});

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Relative Date Calculation', () => {
describe.each(data)('calculates the right date and time', (testcase) => {
it(testcase.name, () => {
// given
jest.useFakeTimers('modern'); // fake time is now "0"
jest.useFakeTimers(); // fake time is now "0"
jest.setSystemTime(testcase.systemTime.valueOf()); // time is now at the exact moment when release was created
const { container } = render(<FormattedDate createdAt={testReleaseDate} />);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Test Auxiliary Functions for Lock Display', () => {

describe.each(cases)(`Tests each isOutdated`, (testcase) => {
beforeAll(() => {
jest.useFakeTimers('modern');
jest.useFakeTimers();
jest.setSystemTime(new Date(2022, 1, 1));
});

Expand Down

0 comments on commit 3e61faa

Please sign in to comment.