You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/rules/no-test-callback.ts
+71-65
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ export default createRule({
11
11
},
12
12
messages: {
13
13
illegalTestCallback: 'Illegal usage of test callback',
14
+
suggestWrappingInPromise: 'Wrap in `new Promise({{ callback }} => ...`',
14
15
useAwaitInsteadOfCallback:
15
16
'Use await instead of callback in async functions',
16
17
},
@@ -55,71 +56,76 @@ export default createRule({
55
56
context.report({
56
57
node: argument,
57
58
messageId: 'illegalTestCallback',
58
-
fix(fixer){
59
-
const{ body }=callback;
60
-
61
-
/* istanbul ignore if https://github.com/typescript-eslint/typescript-eslint/issues/734 */
62
-
if(!body){
63
-
thrownewError(
64
-
`Unexpected null when attempting to fix ${context.getFilename()} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`,
`Unexpected null when attempting to fix ${context.getFilename()} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`,
/* istanbul ignore if https://github.com/typescript-eslint/typescript-eslint/issues/734 */
67
+
if(!body){
68
+
thrownewError(
69
+
`Unexpected null when attempting to fix ${context.getFilename()} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`,
`Unexpected null when attempting to fix ${context.getFilename()} - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`,
0 commit comments