test/helpers/shim-done.ts TYPESCRIPT 37 lines View on github.com → Search inside
1// wrap tests to support test('foo', done => {...}) interface2const _test = test34const wait = (): [() => void, Promise<void>] => {5  let done6  const p = new Promise<void>((resolve, reject) => {7    done = resolve8    done.fail = reject9  })10  return [done, p]11}1213const shimmed =14  ((global as any).it =15  (global as any).test =16    (desc: string, fn?: any, timeout?: number) => {17      if (fn && fn.length > 0) {18        _test(19          desc,20          () => {21            const [done, p] = wait()22            fn(done)23            return p24          },25          timeout26        )27      } else {28        _test(desc, fn, timeout)29      }30    })3132;['skip', 'only', 'todo', 'concurrent'].forEach(key => {33  shimmed[key] = _test[key]34})3536export {}

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.