Skip to content

Fix fake date when called as function

Paul Slaughter requested to merge ps-fix-fake-date into master

What does this MR do?

Fixes #276433 (closed)

It looks like FakeDate wasn't actually using the DEFAULT_ARGS when Date was being called like a function. It turns out that Date() doesn't accept any args, so this call was replaced with new Date(...).toString().

Also, replaced the test assertions with toMatchInlineSnapshot so we have visibility on what these values actually are + introduces a testing oracle outside of the Date implementation.

Merge request reports