You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/09/26 10:15:17 UTC

[GitHub] [incubator-superset] zhaoyongjie opened a new pull request #11079: fix(jest): using UTC mock date

zhaoyongjie opened a new pull request #11079:
URL: https://github.com/apache/incubator-superset/pull/11079


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   My local environment timezone is UTF+8, when I run jest, failed.
   ```
   $  jest spec/javascripts/explore/components/DateFilterControl_spec.jsx
   .....
     ● DateFilterControl › renders the correct time range in tooltip
   
       expect(received).toEqual(expected) // deep equality
   
       Expected: "2020-09-06 < col < 2020-09-07"
       Received: "2020-09-05 < col < 2020-09-06"
   ```
   
   the root cause is , new Date('09/07/2020') => Date Mon Sep 07 2020 00:00:00 GMT+0800 (China Standard Time).
   
   so we need construct a UTC datetime using new Date('2020-09-07')
   
   reference: 
   https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai merged pull request #11079: fix(jest): using UTC mock date

Posted by GitBox <gi...@apache.org>.
nytai merged pull request #11079:
URL: https://github.com/apache/incubator-superset/pull/11079


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org