Skip to content
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

Merged
merged 3 commits into from
Mar 12, 2024
Merged

Add tests #3559

merged 3 commits into from
Mar 12, 2024

Conversation

tan75
Copy link
Contributor

@tan75 tan75 commented Oct 26, 2023

No description provided.

Copy link
Member

@kossnocorp kossnocorp left a 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)

Comment on lines 39 to 47
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)
})
Copy link
Member

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.

@kossnocorp
Copy link
Member

To fix the tests, please rebase to main

@kossnocorp
Copy link
Member

Can you please rebase again? 🙏

Copy link
Member

@kossnocorp kossnocorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

@kossnocorp kossnocorp merged commit 3611e63 into main Mar 12, 2024
14 checks passed
@kossnocorp kossnocorp deleted the constructFrom-add-tests branch March 12, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants