Closed
Description
Or simply all methods on the test context t
.
I didn't really buy the use-case in #1255, but after that I've encountered some situations where it could have been useful.
Sometimes I need to skip an assert based on some condition:
test(t => {
const isTrue = condition ? t.true : t.skip.true;
isTrue('a', 'b');
});
The above results in an error:
TypeError {
message: 'Cannot read property \'_test\' of undefined',
}
Or use a different assertion. I realize it's not a very good practice, but sometimes it's just the best way to do it.
Right now I have to do:
test(t => {
const isTrue = (condition ? t.true : t.skip.true).bind(t);
isTrue('a', 'b');
});
Which is not very nice.