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

Vue Mocha Unit Tests without Browser Environment (jsdom) #5246

Open
ryanmtaylor opened this issue Mar 5, 2020 · 0 comments
Open

Vue Mocha Unit Tests without Browser Environment (jsdom) #5246

ryanmtaylor opened this issue Mar 5, 2020 · 0 comments

Comments

@ryanmtaylor
Copy link

What problem does this feature solve?

I'm trying to unit test Firebase with Coffeescript and using the vue-cli. Unfortunately, vue add unit-mocha and jsdom cause firebase testing to think it's in a browser and then try to access all these browser features that are unavailable (and crash).

Anybody doing testing with vue and firebase is apt to run into this issue, and while you could argue it's a firebase issue – it would seem easy to make the jsdom setup hook optional through the unit-mocha plugin.

(Took me an extremely long time to figure out what was wrong)

What does the proposed API look like?

Just a commandline argument passed to vue-cli-service test:unit -- perhaps:

vue-cli-service test:unit --no-jsdom

@ryanmtaylor ryanmtaylor changed the title Vue Mocha Unit Tests without Browser Environment Vue Mocha Unit Tests without Browser Environment (jsdom) Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants