Skip to content
Snippets Groups Projects

Step 2 - Setup `useFakeDate` by default in Jest

Merged Paul Slaughter requested to merge 236004-use-fake-date-everywhere into master
All threads resolved!

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Paul Slaughter
  • Paul Slaughter added 95 commits

    added 95 commits

    Compare with previous version

  • Paul Slaughter added 2 commits

    added 2 commits

    • 2ffd7c0e - Use fake date in spec environment
    • 542ddf7d - Fix specs for global useFakeDate

    Compare with previous version

  • Paul Slaughter added 1 commit

    added 1 commit

    • 17bc6774 - Fix specs for global useFakeDate

    Compare with previous version

  • Thanks @pslaughter! On the whole this looks great, but I am concerned about the non-local effects of useFakeDate. That it doesn't affect only the scope you call it in leads to some potential surprises/gotchas that I think we should try to avoid.

    This is actually something your useSmartResource would be ideally suited to, but I got the impression other engineers pushed back against it :shrug: :disappointed:

    Let me know your thoughts!

    Edited by Mark Florian
  • Paul Slaughter added 1 commit

    added 1 commit

    • f4e32bd4 - Update useFakeDate to setup / teardown

    Compare with previous version

  • Paul Slaughter added 3 commits

    added 3 commits

    • 8f6174c6 - Update useFakeDate to setup / teardown
    • f3d219ba - Revert setting default date to match rails fixture
    • 73bf5543 - Update FE guide docs for fake date

    Compare with previous version

  • Paul Slaughter added 627 commits

    added 627 commits

    Compare with previous version

  • Paul Slaughter added 3 commits

    added 3 commits

    • 729160b9 - Update useFakeDate to setup / teardown
    • 2a523502 - Fix specs for global useFakeDate
    • 4d3e298f - Update FE guide docs for fake date

    Compare with previous version

  • Paul Slaughter added 3 commits

    added 3 commits

    • 9eee01b3 - Update useFakeDate to setup / teardown
    • 1d803b50 - Fix specs for global useFakeDate
    • 8a8428fc - Update FE guide docs for fake date

    Compare with previous version

  • Paul Slaughter added 3 commits

    added 3 commits

    • fe1c445f - Update useFakeDate to setup / teardown
    • 12dcd38c - Fix specs for global useFakeDate
    • 1d10637b - Update FE guide docs for fake date

    Compare with previous version

  • Paul Slaughter mentioned in merge request !53540 (closed)

    mentioned in merge request !53540 (closed)

  • Paul Slaughter changed the description

    changed the description

  • Paul Slaughter added 2 commits

    added 2 commits

    • 2b639e58 - Fix specs for global useFakeDate
    • ec08ccd9 - Update FE guide docs for fake date

    Compare with previous version

  • Author Maintainer

    It probably doesn't matter, but maybe the frontend and backend should use the same fixed date of 2015-07-03T10:00:00.000Z?

    update: To help with cutting down the size of this MR, I moved this to a new step !53540 (closed)

    The focus of this MR is now just setGlobalDateToFakeDate in test_setup and environmnet + make useFakeDate clean up after itself.

  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Paul Slaughter
  • Author Maintainer

    Thanks so much for the review, collaboration, and thoughtful comments @markrian! As we talked synchronously, I've updated the approach (please see !39496 (comment 503084734)).

    Also, please note that I moved updating the default date to 2015-07-03T10:00:00.000Z to a follow-up MR. I feel a lot better about this approach and updating the existing specs, I can already tell it's a lot more robust and intuitive. WDYT?

    Back to you! :soccer:

  • Paul Slaughter added 43 commits

    added 43 commits

    Compare with previous version

  • Mark Florian
  • Mark Florian
  • Mark Florian
  • Mark Florian
  • Mark Florian
  • Mark Florian
  • mentioned in issue #320781 (closed)

  • Mark Florian
  • Mark Florian approved this merge request

    approved this merge request

  • Thanks @pslaughter! This is looking excellent. I've left various comments, but basically I think they're all non-blocking. Still, I'd like to hear your thoughts before merging.

  • Paul Slaughter mentioned in issue #320883

    mentioned in issue #320883

  • Paul Slaughter added 202 commits

    added 202 commits

    Compare with previous version

  • Paul Slaughter added 1 commit

    added 1 commit

    • 8c01e68f - Update FE guide docs for fake date

    Compare with previous version

  • Author Maintainer

    Thanks again so much @markrian! I made a few updates and responses based on your comments. Back to you! :soccer:

    Edited by Paul Slaughter
  • Paul Slaughter mentioned in merge request !53576 (merged)

    mentioned in merge request !53576 (merged)

  • Mark Florian resolved all threads

    resolved all threads

  • Thanks @pslaughter! Can't wait for this to merge :tada:

  • Mark Florian enabled an automatic merge when the pipeline for 18fab372 succeeds

    enabled an automatic merge when the pipeline for 18fab372 succeeds

  • merged

  • Mark Florian mentioned in commit 10f905d8

    mentioned in commit 10f905d8

  • Author Maintainer

    Thanks again for reviewing and collaborating on this @markrian! :tada:

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • Paul Slaughter mentioned in merge request !55660 (merged)

    mentioned in merge request !55660 (merged)

  • Paul Slaughter changed the description

    changed the description

  • Lukas Eipert mentioned in merge request !65570 (merged)

    mentioned in merge request !65570 (merged)

  • added typemaintenance label and removed tooling (archive) label

  • Please register or sign in to reply
    Loading