Skip to content

Commit 0a953ca

Browse files
committed
Add more tests to catch-or-return
1 parent 9de64fd commit 0a953ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

__tests__/catch-or-return.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ ruleTester.run('catch-or-return', rule, {
193193
options: [{ allowFinally: true }],
194194
errors: [{ message: catchMessage }]
195195
},
196+
{
197+
code: 'frank().then(go).catch(doIt).finally(fn).foobar(foo)',
198+
options: [{ allowFinally: true }],
199+
errors: [{ message: catchMessage }]
200+
},
196201

197202
// terminationMethod=done - .done(null, fn)
198203
{
@@ -204,6 +209,12 @@ ruleTester.run('catch-or-return', rule, {
204209
code: 'frank().catch(go)',
205210
options: [{ terminationMethod: 'done' }],
206211
errors: [{ message: doneMessage }]
212+
},
213+
214+
// assume somePromise.ANYTHING() is a new promise
215+
{
216+
code: 'frank().catch(go).someOtherMethod()',
217+
errors: [{ message: catchMessage }]
207218
}
208219
]
209220
})

0 commit comments

Comments
 (0)