Skip to content

Commit be9d321

Browse files
committed
use-t-well: Allow calling t.context as a function
Fixes #146
1 parent a986748 commit be9d321

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

rules/use-t-well.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const create = context => {
9999
}
100100

101101
if (name === 'context' || name === 'title') {
102-
if (members.length === 1 && isCallExpression(node)) {
102+
if (name === 'title' && members.length === 1 && isCallExpression(node)) {
103103
context.report({
104104
node,
105105
messageId: MESSAGE_ID_UNKNOWN_ASSERTION,

test/use-t-well.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ ruleTester.run('use-t-well', rule, {
6464
testCase('t.log(\'Unicorns\');'),
6565
testCase('a.foo();'),
6666
testCase('t.context.foo(a, a);'),
67+
testCase('t.context();'),
68+
testCase('t.context(\'arg\');'),
6769
testCase('foo.t.bar(a, a);'),
6870
testCase('t.teardown(() => {});'),
6971
testCase('t.timeout(100);'),
@@ -102,10 +104,6 @@ ruleTester.run('use-t-well', rule, {
102104
output: testCase('t.deepEqual.skip(a, a);'),
103105
errors: [error('misspelled')],
104106
},
105-
{
106-
code: testCase('t.context();'),
107-
errors: [error('unknown-assertion')],
108-
},
109107
{
110108
code: testCase('t.title();'),
111109
errors: [error('unknown-assertion')],

0 commit comments

Comments
 (0)