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

grep doesn't work with nested tests #61

Open
jfirebaugh opened this issue May 27, 2015 · 3 comments
Open

grep doesn't work with nested tests #61

jfirebaugh opened this issue May 27, 2015 · 3 comments

Comments

@jfirebaugh
Copy link

test.js:

var test = require('prova');

test('a', function(t) {
    t.test('b', function(t) {
        t.equal(2 + 2, 4);
        t.end();
    });
});

I expect -g b to run this test, but:

$ prova test.js 

    1 passed assertions.

$ prova test.js -g b

    0 passed assertions.

@azer
Copy link
Owner

azer commented May 27, 2015

someone else mentioned this before but I never use nested tests personally

@jfirebaugh
Copy link
Author

It's pretty common to approximate a BDD syntax like mocha:

test('Array', function(t){
  t.test('#indexOf()', function(t){
    t.test('returns -1 when the value is not present', function(){
      t.equal(-1, [1,2,3].indexOf(5));
      t.equal(-1, [1,2,3].indexOf(0));
      t.end();
    })
  })
})

@azer
Copy link
Owner

azer commented May 27, 2015

yeah... I just do like test('index of returns #@$!%. u can send a PR for this if you'd like to have this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants