--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx test("something", (done) => { done(); }); test("something", (done) => { done(); }); test("something", (finished) => { finished(); }); test("something", (done) => { done(); }); test("something", (done) => done()); test("something", (done) => done()); test("something", function (done) { done(); }); test("something", function (done) { done(); }); test("something", async (done) => { done(); }); test("something", async (done) => done()); test("something", async function (done) { done(); }); test("something", (done) => { done(); }); beforeAll((done) => { done(); }); beforeAll((finished) => { finished(); }); beforeEach((done) => { done(); }); afterAll((done) => done()); afterEach((done) => done()); beforeAll(function (done) { done(); }); afterEach(function (done) { done(); }); beforeAll(async (done) => { done(); }); beforeAll(async (done) => done()); beforeAll(async function (done) { done(); }); beforeEach((done) => { done(); }); beforeEach((done) => { done(); }); it.each``("something", ({ a, b }, done) => {}); test.each``("something", ({ a, b }, done) => {}); ``` # Diagnostics ``` invalid.js:1:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. > 1 │ test("something", (done) => { │ ^^^^ 2 │ done(); 3 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:4:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 2 │ done(); 3 │ }); > 4 │ test("something", (done) => { │ ^^^^ 5 │ done(); 6 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:7:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 5 │ done(); 6 │ }); > 7 │ test("something", (finished) => { │ ^^^^^^^^ 8 │ finished(); 9 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:10:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 8 │ finished(); 9 │ }); > 10 │ test("something", (done) => { │ ^^^^ 11 │ done(); 12 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:13:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 11 │ done(); 12 │ }); > 13 │ test("something", (done) => done()); │ ^^^^ 14 │ test("something", (done) => done()); 15 │ test("something", function (done) { i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:14:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 12 │ }); 13 │ test("something", (done) => done()); > 14 │ test("something", (done) => done()); │ ^^^^ 15 │ test("something", function (done) { 16 │ done(); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:15:29 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 13 │ test("something", (done) => done()); 14 │ test("something", (done) => done()); > 15 │ test("something", function (done) { │ ^^^^ 16 │ done(); 17 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:18:29 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 16 │ done(); 17 │ }); > 18 │ test("something", function (done) { │ ^^^^ 19 │ done(); 20 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:21:26 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 19 │ done(); 20 │ }); > 21 │ test("something", async (done) => { │ ^^^^ 22 │ done(); 23 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:24:26 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 22 │ done(); 23 │ }); > 24 │ test("something", async (done) => done()); │ ^^^^ 25 │ test("something", async function (done) { 26 │ done(); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:25:35 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 23 │ }); 24 │ test("something", async (done) => done()); > 25 │ test("something", async function (done) { │ ^^^^ 26 │ done(); 27 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:28:20 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 26 │ done(); 27 │ }); > 28 │ test("something", (done) => { │ ^^^^ 29 │ done(); 30 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:31:12 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 29 │ done(); 30 │ }); > 31 │ beforeAll((done) => { │ ^^^^ 32 │ done(); 33 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:34:12 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 32 │ done(); 33 │ }); > 34 │ beforeAll((finished) => { │ ^^^^^^^^ 35 │ finished(); 36 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:37:13 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 35 │ finished(); 36 │ }); > 37 │ beforeEach((done) => { │ ^^^^ 38 │ done(); 39 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:40:11 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 38 │ done(); 39 │ }); > 40 │ afterAll((done) => done()); │ ^^^^ 41 │ afterEach((done) => done()); 42 │ beforeAll(function (done) { i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:41:12 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 39 │ }); 40 │ afterAll((done) => done()); > 41 │ afterEach((done) => done()); │ ^^^^ 42 │ beforeAll(function (done) { 43 │ done(); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:42:21 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 40 │ afterAll((done) => done()); 41 │ afterEach((done) => done()); > 42 │ beforeAll(function (done) { │ ^^^^ 43 │ done(); 44 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:45:21 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 43 │ done(); 44 │ }); > 45 │ afterEach(function (done) { │ ^^^^ 46 │ done(); 47 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:48:18 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 46 │ done(); 47 │ }); > 48 │ beforeAll(async (done) => { │ ^^^^ 49 │ done(); 50 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:51:18 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 49 │ done(); 50 │ }); > 51 │ beforeAll(async (done) => done()); │ ^^^^ 52 │ beforeAll(async function (done) { 53 │ done(); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:52:27 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 50 │ }); 51 │ beforeAll(async (done) => done()); > 52 │ beforeAll(async function (done) { │ ^^^^ 53 │ done(); 54 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:55:13 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 53 │ done(); 54 │ }); > 55 │ beforeEach((done) => { │ ^^^^ 56 │ done(); 57 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:58:13 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 56 │ done(); 57 │ }); > 58 │ beforeEach((done) => { │ ^^^^ 59 │ done(); 60 │ }); i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:61:35 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 59 │ done(); 60 │ }); > 61 │ it.each``("something", ({ a, b }, done) => {}); │ ^^^^ 62 │ test.each``("something", ({ a, b }, done) => {}); 63 │ i Return a Promise instead of relying on callback parameter. ``` ``` invalid.js:62:37 lint/nursery/noDoneCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Disallow using a callback in asynchronous tests and hooks. 60 │ }); 61 │ it.each``("something", ({ a, b }, done) => {}); > 62 │ test.each``("something", ({ a, b }, done) => {}); │ ^^^^ 63 │ i Return a Promise instead of relying on callback parameter. ```