-
Notifications
You must be signed in to change notification settings - Fork 34
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
WIP - Fix failing test due to timezone + hardcoded fixture #107
Conversation
Codecov Report
@@ Coverage Diff @@
## master #107 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 69 69
Branches 10 10
=========================================
Hits 69 69
Continue to review full report at Codecov.
|
Hi Drew! Thanks for the PR. |
@shazron cool 👍 - sounds like the right choice to me. Will get an update pushed in a little while. |
(wrong button 🤦♂) |
Thanks @DrewML |
Hey thanks for finishing this up @purplecabbage - have been playing catch up on some other things. |
Description
Hey Friends!
I'm from the @magento side of the house, working on some integrations with Adobe I/O.
I wanted to work against the latest
aio-cli
inmaster
regularly to try and help catch any bugs prior to releases.When cloning + running tests locally, I currently get one test failure from
discover.test.js
:It looks like we're not setting an explicit timezone in our call to
Date.prototype.toLocaleDateString
, so it's defaulting to the local timezone.I marked this as a breaking change but that's debatable. This fixes unit tests, but it means that dates spit to stdout from the
discover
command won't be localized.Some alternatives I considered:
process.env.NODE_ENV === 'test'
check, and useUTC
only in testsLet me know if you'd prefer one of these options instead.
Related Issue
Motivation and Context
Fix tests for users in other timezones
How Has This Been Tested?
npm test
locallyScreenshots (if appropriate):
Before
![image](https://user-images.githubusercontent.com/5233399/73473086-c1241200-4351-11ea-917c-cc6970716110.png)
After
![image](https://user-images.githubusercontent.com/5233399/73473122-d13bf180-4351-11ea-8fc1-af67e229c5c2.png)
Types of changes
Checklist: