diff --git a/test/tools/runner/hooks/configuration.ts b/test/tools/runner/hooks/configuration.ts index 8c3f7be29dc..2201f22cc9b 100644 --- a/test/tools/runner/hooks/configuration.ts +++ b/test/tools/runner/hooks/configuration.ts @@ -104,10 +104,12 @@ const testSkipBeforeEachHook = async function () { /** * TODO: NODE-3891 - fix tests that are broken with auth enabled and remove this hook - * @param {{ skippedTests: string[] }} skippedTests - define list of tests to skip + * @param skippedTests - define list of tests to skip * @returns */ -const skipBrokenAuthTestBeforeEachHook = function ({ skippedTests } = { skippedTests: [] }) { +const skipBrokenAuthTestBeforeEachHook = function ( + { skippedTests }: { skippedTests: string[] } = { skippedTests: [] } +) { return function () { if (process.env.AUTH === 'auth' && skippedTests.includes(this.currentTest.title)) { this.currentTest.skipReason = 'TODO: NODE-3891 - fix tests broken when AUTH enabled';