-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)pr welcome
Description
Describe the bug
Currently when the dates are not the same when using Temporal dates which I added based on the temporal-polyfill it will return that the dates are the same when using toStrictEqual on a object. Not sure if I am doing something wrong or if there is a issue.
Reproduction
Test:
it('should fail on different instant dates', () => {
const date = Temporal.Now.instant();
const object1 = {
id: '123',
lastUpdated: date,
};
const object2 = {
id: '123',
lastUpdated: date.add({ minutes: 30 }),
};
// This now passes when removing not
expect(object1).not.toStrictEqual(object2);
});
it('should fail on different zoned dates', () => {
const date = Temporal.Now.zonedDateTimeISO('UTC');
const object1 = {
id: '123',
lastUpdated: date,
};
const object2 = {
id: '123',
lastUpdated: date.add({ days: 1 }),
};
// This now passes when removing not
expect(object1).not.toStrictEqual(object2);
});
Package.json:
"dependencies": {
"temporal-polyfill": "0.3.0"
},
System Info
System:
OS: Windows 11 10.0.22631
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 12.81 GB / 63.73 GB
Binaries:
Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
npm: 11.3.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (130.0.2849.80)
Internet Explorer: 11.0.22621.3527
npmPackages:
@vitest/coverage-istanbul: ^3.1.3 => 3.1.3
@vitest/eslint-plugin: ^1.2.0 => 1.2.0
@vitest/spy: ^3.1.3 => 3.1.3
vitest: ~3.1.3 => 3.1.3Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)pr welcome
Type
Projects
Status
P2 - 2