jest-date
jest-date copied to clipboard
:date: Custom jest matchers to compare dates against eachother
With other primitives in Jest you can do something like: ``` expect(myFunction).toHaveBeenCalledWith( expect.stringMatching('test'), expect.closeTo(2), ); ``` It would be cool to have something similar to this.
Hello, thanks for writing this extension. I am having an issue getting it set up. When I add the import statement into the setup file as you describe I get...
We have a use-case here where we set a resource to expiry after 30d. Would be nice to match if our date is 30d after the other one. I'm happy...
An assertion like ```javascript const expectedDate = ...; const realDate = getDate(); expect(realDate).toBeSameHourAs(expectedDate); // Usually pass ``` can fail in this circumstance: ```javascript const expectedDate = new Date('2022-12-29 8:59 AM');...