-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add tests #3559
Add tests #3559
Conversation
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.
Looking good! I would only change the forth test case (see my comment on the diff)
src/constructFrom/test.ts
Outdated
it('should create a new custom Date instance using a number as the reference date', () => { | ||
class CustomDate extends Date {} | ||
const referenceDate = new CustomDate(1635158400000) // October 25, 2023 | ||
const value = new CustomDate('2023-10-26T12:00:00') | ||
|
||
const result = constructFrom(referenceDate, value) | ||
|
||
assert.ok(result instanceof CustomDate) | ||
assert.deepStrictEqual(result, value) | ||
assert.strictEqual(result.constructor, CustomDate) | ||
}) |
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.
This case is equal to the previous one, it doesn't matter for the function how you create CustomDate
.
For the symmetry, you better add test case where both referenceDate
and value
are numbers.
To fix the tests, please rebase to main |
01e498a
to
d86a793
Compare
Can you please rebase again? 🙏 |
737f9ba
to
fceef14
Compare
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.
Let's go!
No description provided.