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

chore: Run tests in real browser #292

Merged
merged 2 commits into from
Nov 4, 2021
Merged

chore: Run tests in real browser #292

merged 2 commits into from
Nov 4, 2021

Conversation

Feiyang1
Copy link
Contributor

@Feiyang1 Feiyang1 commented Nov 4, 2021

We currently run tests using mocha (nodejs) + jsdom to emulate a browser environment. It loads the Nodejs version of the Firestore SDK which throws TypeError: Invalid URL: index.node.cjs.js because jsdom confuses it to think it's executing in a browser.

The PR changes the tests to run in a real browser (chrome) to workaround this issue, and it's a more reliable test setup because tests will execute in the same environment where the SDK will be used.

Copy link
Collaborator

@lemuel-stripe lemuel-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! but before I merge I'm going to take a closer look at the linter error & try to fix that

@lemuel-stripe
Copy link
Collaborator

thanks for fixing the linter error @Feiyang1

@lemuel-stripe lemuel-stripe merged commit 06f680a into web-sdk Nov 4, 2021
This was referenced Nov 4, 2021
@jsteele-stripe jsteele-stripe deleted the fei-browser-test branch August 23, 2022 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants