Skip to content
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

JS: Mock FileSaver when using Cypress #5457

Closed
2 tasks
IanLondon opened this issue Apr 21, 2020 · 0 comments · Fixed by #5943
Closed
2 tasks

JS: Mock FileSaver when using Cypress #5457

IanLondon opened this issue Apr 21, 2020 · 0 comments · Fixed by #5943
Assignees

Comments

@IanLondon
Copy link
Contributor

IanLondon commented Apr 21, 2020

Overview

It's bad to modify application code to support tests, let's avoid it!

Acceptance criteria

  • Remove references to process.env.CYPRESS / global.Cypress from PD/LC application code
  • Rely on webpack to mock FileSaver when process.env.CYPRESS === '1'

Implementation details

This override should happen using a mock for FileSaver that webpack (using the resolve) config or babel (using babel-plugin-module-resolver) shims in when the environment is Cypress rather than putting the override logic in application code

https://github.com/_render_node/MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDQxMjM2NzQ3Ng==/comments/review_comment_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants