grep doesn't work with nested tests
jfirebaugh opened this issue · comments
John Firebaugh commented
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 Koçulu commented
someone else mentioned this before but I never use nested tests personally
John Firebaugh commented
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 Koçulu commented
yeah... I just do like test('index of returns #@$!%
. u can send a PR for this if you'd like to have this feature