Skip to content

Add a testing guide #277

Closed
Closed
@ameesters

Description

@ameesters

So, i have been trying to find examples of unit tests and the lack of information i find disturbing...

For example, a couple of versions ago, functions and objects like ready and watch would show up green in the code coverage, and idem for the command-line coverage... now i have updated some projects to make use of mocha and suddenly my coverage dropped significantly! And further more i cannot find how to properly test ready() and watch, even the official examples do not include unit tests! I have tried asking on gitter as well, but it seems unit-testing isn't all that popular... But i really need it, since the company i work for considers Vue for a new big front-end, i need to show them that Vue is up to par with the other frameworks out there.

What i would really really need is a guide on how to properly test a single file component. For example, ready() is called by Vue itself, so should i mock this and spy on it to see if its called?! That seems like such a hassle and i would like to have the behavior that was before where it would just show up as covered... cause if there is a error in ready, stuff would already break, right?

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