Skip to content

Commit

Permalink
Support assertion message in `t.timeout()
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansamines authored Jul 4, 2020
1 parent 26a3732 commit 420c862
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rules/assertion-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const expectedNbArguments = {
},
timeout: {
min: 1,
max: 1
max: 2
}
};

Expand Down
6 changes: 3 additions & 3 deletions test/assertion-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ruleTester.run('assertion-arguments', rule, {
testCase(false, 't.snapshot(value, \'message\');'),
testCase(false, 't.context.plan();'),
testCase(false, 't.teardown(() => {});'),
testCase(false, 't.timeout(100);'),
testCase(false, 't.timeout(100, \'message\');'),
testCase(false, 'foo.t.plan();'),
// Shouldn't be triggered since it's not a test file
testCase(false, 't.true(true);', false, false),
Expand Down Expand Up @@ -106,7 +106,7 @@ ruleTester.run('assertion-arguments', rule, {
testCase('always', 't.is.skip(\'same\', \'same\', \'message\');'),
testCase('always', 't.snapshot(value, \'message\');'),
testCase('always', 't.teardown(() => {});'),
testCase('always', 't.timeout(100);'),
testCase('always', 't.timeout(100, \'message\');'),
testCase('always', 't.try(tt => tt.pass());'),
testCase('always', 't.try(tt => tt.pass(), 1, 2);'),
testCase('always', 't.try(\'title\', tt => tt.pass(), 1, 2);'),
Expand Down Expand Up @@ -215,7 +215,7 @@ ruleTester.run('assertion-arguments', rule, {
testCase(false, 't.is.skip(\'same\', \'same\', \'message\', \'extra argument\');', tooManyError(3)),
testCase(false, 't.snapshot(value, \'message\', \'extra argument\');', tooManyError(2)),
testCase(false, 't.teardown(() => {}, \'extra argument\');', tooManyError(1)),
testCase(false, 't.timeout(1, \'extra argument\');', tooManyError(1)),
testCase(false, 't.timeout(1, \'message\', \'extra argument\');', tooManyError(2)),

testCase('always', 't.pass();', missingError),
testCase('always', 't.fail();', missingError),
Expand Down

0 comments on commit 420c862

Please sign in to comment.