Skip to content

Commit

Permalink
update tests for no-callback-literal
Browse files Browse the repository at this point in the history
  • Loading branch information
delaguilaluis committed Apr 18, 2018
1 parent f0bc288 commit 64f91a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/no-callback-literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ruleTester.run('no-callback-literal', rule, {
'callback(x)',
'callback(new Error("error"))',
'callback(friendly, data)',
'callback(undefined, data)',
'callback(null, data)',
'callback(x, data)',
'callback(new Error("error"), data)',
Expand All @@ -41,6 +42,7 @@ ruleTester.run('no-callback-literal', rule, {
'cb()',
'cb(undefined)',
'cb(null)',
'cb(undefined, "super")',
'cb(null, "super")',

// custom callback
Expand All @@ -52,13 +54,11 @@ ruleTester.run('no-callback-literal', rule, {

invalid: [
// callback
{ code: 'callback(undefined, "snork")', errors: [{ message: 'Expected "null" instead of "undefined" in error position of callback.' }] },
{ code: 'callback(false, "snork")', errors: [{ message: 'Unexpected literal in error position of callback.' }] },
{ code: 'callback("help")', errors: [{ message: 'Unexpected literal in error position of callback.' }] },
{ code: 'callback("help", data)', errors: [{ message: 'Unexpected literal in error position of callback.' }] },

// cb
{ code: 'cb(undefined, "snork")', errors: [{ message: 'Expected "null" instead of "undefined" in error position of callback.' }] },
{ code: 'cb(false)', errors: [{ message: 'Unexpected literal in error position of callback.' }] },
{ code: 'cb("help")', errors: [{ message: 'Unexpected literal in error position of callback.' }] },
{ code: 'cb("help", data)', errors: [{ message: 'Unexpected literal in error position of callback.' }] },
Expand Down

0 comments on commit 64f91a5

Please sign in to comment.