Skip to content

Commit

Permalink
chore: update dependencies to latest minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Dec 6, 2021
1 parent fa81d93 commit 26a4ab8
Show file tree
Hide file tree
Showing 7 changed files with 1,230 additions and 1,555 deletions.
3 changes: 1 addition & 2 deletions __tests__/always-return.js
Expand Up @@ -82,8 +82,7 @@ ruleTester.run('always-return', rule, {
errors: [{ message }],
},
{
code:
'hey.then(function() { if (x) { return you.then(function() { return x; }); } })',
code: 'hey.then(function() { if (x) { return you.then(function() { return x; }); } })',
errors: [{ message }],
},
{
Expand Down
18 changes: 6 additions & 12 deletions __tests__/catch-or-return.js
Expand Up @@ -20,8 +20,7 @@ ruleTester.run('catch-or-return', rule, {

// arrow function use case
{
code:
'postJSON("/smajobber/api/reportJob.json")\n\t.then(()=>this.setState())\n\t.catch(()=>this.setState())',
code: 'postJSON("/smajobber/api/reportJob.json")\n\t.then(()=>this.setState())\n\t.catch(()=>this.setState())',
parserOptions: { ecmaVersion: 6 },
},

Expand All @@ -41,8 +40,7 @@ ruleTester.run('catch-or-return', rule, {
options: [{ allowThen: true }],
},
{
code:
'frank().then(go).then().then(null, function() { /* why bother */ })',
code: 'frank().then(go).then().then(null, function() { /* why bother */ })',
options: [{ allowThen: true }],
},
{
Expand All @@ -65,8 +63,7 @@ ruleTester.run('catch-or-return', rule, {
options: [{ allowThen: true }],
},
{
code:
'frank().then(a).then(b).then(null, function() { /* why bother */ })',
code: 'frank().then(a).then(b).then(null, function() { /* why bother */ })',
options: [{ allowThen: true }],
},

Expand All @@ -80,8 +77,7 @@ ruleTester.run('catch-or-return', rule, {
options: [{ allowThen: true }],
},
{
code:
'frank().then(go).then().then(function() {}, function() { /* why bother */ })',
code: 'frank().then(go).then().then(function() {}, function() { /* why bother */ })',
options: [{ allowThen: true }],
},
{
Expand All @@ -99,8 +95,7 @@ ruleTester.run('catch-or-return', rule, {
options: [{ allowFinally: true }],
},
{
code:
'frank().then(go).then().catch(function() { /* why bother */ }).finally(fn)',
code: 'frank().then(go).then().catch(function() { /* why bother */ }).finally(fn)',
options: [{ allowFinally: true }],
},

Expand Down Expand Up @@ -167,8 +162,7 @@ ruleTester.run('catch-or-return', rule, {
errors: [{ message: catchMessage }],
},
{
code:
'frank().then(go).then().catch(function() { /* why bother */ }).finally(fn)',
code: 'frank().then(go).then().catch(function() { /* why bother */ }).finally(fn)',
errors: [{ message: catchMessage }],
},

Expand Down
3 changes: 1 addition & 2 deletions __tests__/no-callback-in-promise.js
Expand Up @@ -67,8 +67,7 @@ ruleTester.run('no-callback-in-promise', rule, {
errors: [{ message: errorMessage, column: 24 }],
},
{
code:
'a.then(function(data) { callback(data) }, function(err) { callback(err) })',
code: 'a.then(function(data) { callback(data) }, function(err) { callback(err) })',
errors: [
{ message: errorMessage },
{ column: 59, message: errorMessage },
Expand Down
18 changes: 6 additions & 12 deletions __tests__/no-return-wrap.js
Expand Up @@ -101,25 +101,21 @@ ruleTester.run('no-return-wrap', rule, {

// needs to also look at weird paths
{
code:
'doThing().then(function(x) { if (x>1) { return Promise.resolve(4) } else { throw "bad" } })',
code: 'doThing().then(function(x) { if (x>1) { return Promise.resolve(4) } else { throw "bad" } })',
errors: [{ message: resolveMessage }],
},
{
code:
'doThing().then(function(x) { if (x>1) { return Promise.reject(4) } })',
code: 'doThing().then(function(x) { if (x>1) { return Promise.reject(4) } })',
errors: [{ message: rejectMessage }],
},
{
code:
'doThing().then(null, function() { if (true && false) { return Promise.resolve() } })',
code: 'doThing().then(null, function() { if (true && false) { return Promise.resolve() } })',
errors: [{ message: resolveMessage }],
},

// should do both
{
code:
'doThing().catch(function(x) {if (x) { return Promise.resolve(4) } else { return Promise.reject() } })',
code: 'doThing().catch(function(x) {if (x) { return Promise.resolve(4) } else { return Promise.reject() } })',
errors: [{ message: resolveMessage }, { message: rejectMessage }],
},

Expand Down Expand Up @@ -201,13 +197,11 @@ ruleTester.run('no-return-wrap', rule, {

// function bind
{
code:
'doThing().then((function() { return Promise.resolve(4) }).bind(this))',
code: 'doThing().then((function() { return Promise.resolve(4) }).bind(this))',
errors: [{ message: resolveMessage }],
},
{
code:
'doThing().then((function() { return Promise.resolve(4) }).bind(this).bind(this))',
code: 'doThing().then((function() { return Promise.resolve(4) }).bind(this).bind(this))',
errors: [{ message: resolveMessage }],
},

Expand Down
3 changes: 1 addition & 2 deletions __tests__/prefer-await-to-then.js
Expand Up @@ -37,8 +37,7 @@ ruleTester.run('prefer-await-to-then', rule, {
errors: [{ message }, { message }, { message }],
},
{
code:
'async function a() { hey.then(function() { }).then(function() { }) }',
code: 'async function a() { hey.then(function() { }).then(function() { }) }',
errors: [{ message }, { message }],
},
{
Expand Down

0 comments on commit 26a4ab8

Please sign in to comment.