MCPcopy
hub / github.com/vitest-dev/vitest / safeCall

Function safeCall

test/core/test/jest-mock.test.ts:481–486  ·  view source on GitHub ↗
(fn: () => void)

Source from the content-addressed store, hash-verified

479
480 it('mockRejectedValue', async () => {
481 const safeCall = async (fn: () => void) => {
482 try {
483 await fn()
484 }
485 catch {}
486 }
487
488 const spy = vi.fn()
489 .mockRejectedValue(new Error('error'))

Callers 1

jest-mock.test.tsFile · 0.85

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected