Skip to content

Commit 8951c57

Browse files
committed
fix: correct syntax in placeholders
1 parent d1b3ff8 commit 8951c57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/HookPatcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class HookPatcher {
1515
this._beforeHooks.has(fn) ? undefined : (this._beforeHooks.add(fn), fn(...args));
1616

1717
wrapper.toString = () =>
18-
this._beforeHooks.has(fn) ? '() => /* patched beforeAll */' : fn.toString();
18+
this._beforeHooks.has(fn) ? '() => { /* patched beforeAll */ }' : fn.toString();
1919

2020
beforeEach(wrapper, timeout);
2121
};
@@ -28,15 +28,15 @@ export class HookPatcher {
2828
this._testFailed ? (this._afterHooks.add(fn), fn(...args)) : undefined;
2929

3030
wrapperEach.toString = () =>
31-
this._testFailed ? fn.toString() : '() => /* patched afterAll */';
31+
this._testFailed ? fn.toString() : '() => { /* patched afterAll */ }';
3232

3333
const wrapperAll =
3434
fn.length === 1
3535
? (done: Function) => (this._afterHooks.has(fn) ? done() : fn(done))
3636
: (...args: unknown[]) => (this._afterHooks.has(fn) ? undefined : fn(...args));
3737

3838
wrapperAll.toString = () =>
39-
this._afterHooks.has(fn) ? '() => /* patched afterAll */' : fn.toString();
39+
this._afterHooks.has(fn) ? '() => { /* patched afterAll */ }' : fn.toString();
4040

4141
afterEach(wrapperEach, timeout);
4242
afterAll(wrapperAll, timeout);

0 commit comments

Comments
 (0)