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

[feature request] Undefined tests shouldn't return successful. #148

Open
awatson1978 opened this issue Dec 16, 2015 · 2 comments
Open

[feature request] Undefined tests shouldn't return successful. #148

awatson1978 opened this issue Dec 16, 2015 · 2 comments

Comments

@awatson1978
Copy link

Hi!
So, I've been digging into test coverage for a half-dozen packages, and would like to suggest a very needed feature: if Gagarin doesn't find an expect() statement to parse, it shouldn't return a green success in the test runner. Preferably, it should return yellow or undefined. I'm finding that it's quite common to write a test, think that it's passing, only to discover that the I wasn't in the correct scope, and Gagarin hadn't run the tests at all. I have a few other ideas that could make Gagarin more usable; but that's the really critical one that is going to frustrate people, I think.

Just my $0.02.

@apendua
Copy link
Member

apendua commented Dec 16, 2015

@awatson1978 I think it's a good idea. I will think more about it in the morning.

@apendua
Copy link
Member

apendua commented Dec 20, 2015

I was thinking a little how to implement this and it feels like it may not be trivial to do so. Consider the following example:

it('a not-so-obvious test case', function () {
  if (someCondition) {
    expect(someValue).to.fulfill.some.condition;
  }
});

Would you consider this a valid test case? One one hand it's correct because it contains assertion. On the other hand, the assertion may not be executed if someCondition fails. So there's a dilemma if we should apporach this problem by looking at the syntax only, or by veryfying if the assertion function was called at least once.

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