Skip to content

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

Open
@ryanmtaylor

Description

@ryanmtaylor

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions