Closed
Description
We have this code construct everywhere:
CallExpression: function (node) {
// only check if we are within a test file, and if this CallExpression is within a test.
if (!ava.isTestFile || !ava.currentTestNode) {
return;
}
}
I propose we add some sugar to ava.merge()
that allows something like this:
'CallExpression:inTest': function (node) {
},
'VariableDeclaration:inTestFile': function (node) {
},
'CallExpression:inTest:inTestFile': function (node) {
},
While we are at it, we should define one (specifically for CallExpression), that checks the callee is a MemberExpression
of the form t.XXX
:
'AssertionCallExpression:inTest': function (node) {
}