Skip to content

Commit

Permalink
test: re-enable fake Date on unit tests (AmadeusITGroup#2163)
Browse files Browse the repository at this point in the history
## Proposed change

The original issue sinonjs/fake-timers#437 was
fixed in `@sinonjs/fake-timers@>=12`
We get this dependency from `@jest/fake-timers` but it is still using
version 10
It seems that even in Jest 30 the dependency won't be updated to v12

## Related issues

- 🐛 Fixes #(issue)
- 🚀 Feature #(issue)

<!-- Please make sure to follow the contributing guidelines on
https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md -->
  • Loading branch information
fpaul-1A authored Sep 13, 2024
2 parents 86df5f4 + 9ac9809 commit dcdb453
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
}
],
"resolutions": {
"@sinonjs/fake-timers": "^13.0.0",
"@types/node": "^20.0.0",
"typescript-json-schema/typescript": "~5.5.4"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/@ama-sdk/core/testing/jest.config.ut.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ module.exports = {
displayName: require('../package.json').name,
rootDir,
fakeTimers: {
enableGlobally: true,
// TODO re-enable fake dates when issue fixed https://github.com/sinonjs/fake-timers/issues/437
doNotFake: ['Date']
enableGlobally: true
},
testPathIgnorePatterns: [
'<rootDir>/.*/templates/.*',
Expand Down
4 changes: 1 addition & 3 deletions packages/@o3r/forms/testing/jest.config.ut.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ module.exports = {
displayName: require('../package.json').name,
rootDir,
fakeTimers: {
enableGlobally: true,
// TODO re-enable fake dates when issue fixed https://github.com/sinonjs/fake-timers/issues/437
doNotFake: ['Date']
enableGlobally: true
},
testPathIgnorePatterns: [
'<rootDir>/.*/templates/.*',
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10937,7 +10937,7 @@ __metadata:
languageName: node
linkType: hard

"@sinonjs/commons@npm:^3.0.0":
"@sinonjs/commons@npm:^3.0.1":
version: 3.0.1
resolution: "@sinonjs/commons@npm:3.0.1"
dependencies:
Expand All @@ -10946,12 +10946,12 @@ __metadata:
languageName: node
linkType: hard

"@sinonjs/fake-timers@npm:^10.0.2":
version: 10.3.0
resolution: "@sinonjs/fake-timers@npm:10.3.0"
"@sinonjs/fake-timers@npm:^13.0.0":
version: 13.0.1
resolution: "@sinonjs/fake-timers@npm:13.0.1"
dependencies:
"@sinonjs/commons": "npm:^3.0.0"
checksum: 10/78155c7bd866a85df85e22028e046b8d46cf3e840f72260954f5e3ed5bd97d66c595524305a6841ffb3f681a08f6e5cef572a2cce5442a8a232dc29fb409b83e
"@sinonjs/commons": "npm:^3.0.1"
checksum: 10/fcb93349c52baead353336ce86442df14e3ee918162a0df1e88692c1fa9aec67b94094b0152bb95adcf8dc834eb20557e9a7e425c959fdee5b8cc67d17afcd67
languageName: node
linkType: hard

Expand Down

0 comments on commit dcdb453

Please sign in to comment.