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

Function createAsyncMockSchema

test/core/test/expect.test.ts:496–504  ·  view source on GitHub ↗
(validate: StandardSchemaV1['~standard']['validate'])

Source from the content-addressed store, hash-verified

494 }
495
496 function createAsyncMockSchema(validate: StandardSchemaV1['~standard']['validate']): StandardSchemaV1 {
497 return {
498 '~standard': {
499 version: 1,
500 vendor: 'mock-async',
501 validate: value => Promise.resolve(validate(value)),
502 },
503 }
504 }
505
506 const stringSchema = createMockSchema(value =>
507 typeof value === 'string' ? { issues: undefined, value } : { issues: [{ message: 'Expected string' }] },

Callers 1

expect.test.tsFile · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected