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

Treat assert() as a branch #290

Closed
dapetcu21 opened this issue Dec 30, 2014 · 3 comments
Closed

Treat assert() as a branch #290

dapetcu21 opened this issue Dec 30, 2014 · 3 comments

Comments

@dapetcu21
Copy link

Right now, assert()s don't matter in coverage (they're always considered covered), which makes them easy to skip when writing tests. Is there any way to change that behaviour?

@ghost
Copy link

ghost commented Mar 24, 2015

You could use an if statement instead of an assert which would make this show up as a branch.

@dapetcu21
Copy link
Author

True, but that looks considerably uglier (3 lines instead of 1), especially in a block of aprox. 10 consecutive asserts. I'm just suggesting that assert could be a frequent enough use case to warrant special behaviour.

@gotwarlost
Copy link
Owner

Not doing this. In the general case, there is no way for the instrumenter to know what the function being executed actually is unless it does a scope analysis and puts in all sorts of assumptions about how things work in node

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

3 participants