File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,19 @@ global.displayTestStats = function() {
4444} ;
4545
4646/**
47- * Wraps test functions that use both `async` and a `done` callback, which Jasmine 5
48- * does not support. This converts `async (done) => { ... }` to a promise-based
49- * function so Jasmine does not throw :
47+ * Transitional compatibility shim for Jasmine 5.
48+ *
49+ * Jasmine 5 throws when a test or hook function uses both `async` and a `done` callback :
5050 * "An asynchronous before/it/after function was defined with the async keyword
5151 * but also took a done callback."
52+ *
53+ * Many existing tests use `async (done) => { ... done(); }`. This wrapper converts
54+ * those to promise-based functions by intercepting the `done` callback and resolving
55+ * a promise instead, so Jasmine sees a plain async function.
56+ *
57+ * To remove this shim, convert each file below so that tests and hooks use plain
58+ * `async () => {}` without a `done` parameter, then remove the file from this list.
59+ * Once the list is empty, delete this function and its call in `helper.js`.
5260 */
5361global . normalizeAsyncTests = function ( ) {
5462 function wrapDoneCallback ( fn ) {
You can’t perform that action at this time.
0 commit comments