-
Notifications
You must be signed in to change notification settings - Fork 80
test(date): add test for dateToISO utility function #6308
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
Conversation
… Date objects can be passed into it
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.
LGTM, thanks for adding it! I added a comment about a potentially redundant test, but I'll leave it up to you
const date = new Date(2011, 10, 29); | ||
const expectedValue = "2011-11-29"; | ||
expect(dateToISO(date)).toEqual(expectedValue); | ||
}); |
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.
I think this test is redundant since the one below tests the same base case plus the zero padding. We could probably remove it, what do you think?
…xpand * origin/master: test(date): add test for dateToISO utility function (#6308)
Related Issue: #6289 (review)
Summary
Adds a spec test for
dateToISO
. Also updates the function to return a proper empty string value when any non-Date
value is passed in.