Thanks you for the great recipe for mocking dates https://github.com/DevExpress/testcafe-examples/tree/master/examples/mock-date
I was able to get it to work using mockdate@v2.0.5. But the subsequent mockdate@v3x breaks.
mockdate@v3x moves the package to typescript and it looks like the build target has changed from UMD to CJS.
Attempting to load this CJS module via clientScripts({ module: 'mockdate' }) (as in the example) results in an error:
1) - Error in fixture.beforeEach hook -
An error occurred in the 'mockdate' module injected into the tested page.
Make sure that this module can be executed in the browser environment.
Error details:
ReferenceError: exports is not defined
If there is a way to wrap this CJS module so that the mock-date example continues to work please let me know and I'd be happy to open a PR to update the example.
Otherwise, I would be happy to open a PR to update the README to specify using mockdate@v2.
Thanks you for the great recipe for mocking dates https://github.com/DevExpress/testcafe-examples/tree/master/examples/mock-date
I was able to get it to work using
mockdate@v2.0.5. But the subsequentmockdate@v3xbreaks.mockdate@v3xmoves the package to typescript and it looks like the build target has changed from UMD to CJS.Attempting to load this CJS module via
clientScripts({ module: 'mockdate' })(as in the example) results in an error:If there is a way to wrap this CJS module so that the mock-date example continues to work please let me know and I'd be happy to open a PR to update the example.
Otherwise, I would be happy to open a PR to update the
READMEto specify usingmockdate@v2.