From e48d045db5496d31286e4b5f6590c6816d40818c Mon Sep 17 00:00:00 2001 From: Jan W Date: Thu, 3 Oct 2024 15:20:16 +0200 Subject: [PATCH 1/2] fix: forward timeout in .each() --- src/jest.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jest.js b/src/jest.js index 37576e4..f4312bd 100644 --- a/src/jest.js +++ b/src/jest.js @@ -51,7 +51,7 @@ const eachCallerLocation = [] const makeEach = (impl) => (list, ...rest) => - (template, fn) => { + (template, fn, timeout) => { eachCallerLocation.unshift(getCallerLocation()) // Hack for common testing with simple arrow functions, until we can disable esbuild minification const formatArg = (x) => (x && x instanceof Function && `${x}` === '()=>{}' ? '() => {}' : x) @@ -86,7 +86,7 @@ const makeEach = if (length > 0) name = utilFormat(name, ...args.slice(0, length).map(formatArg)) } - impl(name, () => (Array.isArray(args) ? fn(...args) : fn(args))) + impl(name, () => (Array.isArray(args) ? fn(...args) : fn(args)), timeout) } eachCallerLocation.shift() From 77dcdc12e2934abc01835ba2b4209d2f3afdc24d Mon Sep 17 00:00:00 2001 From: Jan W Date: Thu, 3 Oct 2024 15:28:37 +0200 Subject: [PATCH 2/2] fix: spread --- src/jest.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jest.js b/src/jest.js index f4312bd..ed1c9a5 100644 --- a/src/jest.js +++ b/src/jest.js @@ -51,7 +51,7 @@ const eachCallerLocation = [] const makeEach = (impl) => (list, ...rest) => - (template, fn, timeout) => { + (template, fn, ...restArgs) => { eachCallerLocation.unshift(getCallerLocation()) // Hack for common testing with simple arrow functions, until we can disable esbuild minification const formatArg = (x) => (x && x instanceof Function && `${x}` === '()=>{}' ? '() => {}' : x) @@ -86,7 +86,7 @@ const makeEach = if (length > 0) name = utilFormat(name, ...args.slice(0, length).map(formatArg)) } - impl(name, () => (Array.isArray(args) ? fn(...args) : fn(args)), timeout) + impl(name, () => (Array.isArray(args) ? fn(...args) : fn(args)), ...restArgs) } eachCallerLocation.shift()