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

Handle tests without a "exports.lab" gracefully #157

Closed
martinheidegger opened this issue Aug 13, 2014 · 5 comments · Fixed by #159
Assignees
Labels
bug
Milestone

Comments

@martinheidegger
Copy link
Contributor

@martinheidegger martinheidegger commented Aug 13, 2014

In lab 4 you introduced the new requirement that a test had to add "exports.lab = lab;". Unfortunately it seems that if you forget to write that lab just silently quits without anything. It would be better if there were some information on which file it broke or what the problem was. It wasn't clear to me so I assume other users might be confused as well.

(To be honest I am not a fan of this change...)

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 13, 2014

Do you get the message that 0 tests complete? In the case of 0 tests being run would you expect a message that tries to provide hints of possible causes?

@geek geek added the request label Aug 13, 2014
@martinheidegger

This comment has been minimized.

Copy link
Contributor Author

@martinheidegger martinheidegger commented Aug 13, 2014

I didn't get the message 0 tests compete. It just stopped. But even if it passes. I would expect lab to tell me that the amount of "Lab.script()" calls is not equal to the amount of lab tests run and that I "perhaps forgot to export.lab" some test?

screenshot 2014-08-14 03 52 58

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 13, 2014

Hmm... so keep a count of how many times Lab.script() is called and compare it to the number of exported lab variables?

@martinheidegger

This comment has been minimized.

Copy link
Contributor Author

@martinheidegger martinheidegger commented Aug 13, 2014

Yes, but just to make sure: that is two different issues:

  1. More important: When I don't pass a module.export in one test then it will just stop executing (no error or anything.
    screenshot 2014-08-14 04 23 26
    screenshot 2014-08-14 04 23 41

  2. Nice to have: lab telling me if I defined a test but it wasn't run. (Either by counting or by verifying on process exit)

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 13, 2014

Thanks, I can confirm that this is a bug.

@geek geek added this to the 4.0.3 milestone Aug 13, 2014
@geek geek added bug and removed request labels Aug 13, 2014
@geek geek self-assigned this Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.