diff --git a/src/fromOpenApi/fromOpenApi.ts b/src/fromOpenApi/fromOpenApi.ts index 6290aec..71f4172 100644 --- a/src/fromOpenApi/fromOpenApi.ts +++ b/src/fromOpenApi/fromOpenApi.ts @@ -4,7 +4,7 @@ import SwaggerParser from '@apidevtools/swagger-parser' import { normalizeSwaggerUrl } from './utils/normalizeSwaggerUrl.js' import { getServers } from './utils/getServers.js' import { isAbsoluteUrl, joinPaths } from './utils/url.js' -import { createResponseResolver, createResponseResolverFromContent } from './utils/openApiUtils.js' +import { createResponseResolver } from './utils/openApiUtils.js' type SupportedHttpMethods = keyof typeof http const supportedHttpMethods = Object.keys( @@ -95,7 +95,6 @@ export async function fromOpenApi( requestHandlers.push(handler) } - } } } diff --git a/test/support/withHandlers.ts b/test/support/withHandlers.ts index f6dca5d..b58c31e 100644 --- a/test/support/withHandlers.ts +++ b/test/support/withHandlers.ts @@ -5,6 +5,9 @@ import { setupServer } from 'msw/node' * Creates an MSW `server` instance, populates it * with the given `handlers`, runs the `callback`, * and cleans up afterward. + * + * @deprecated Remove this once all tests are migrated + * NOT to use this. Use `inspectHandlers` instead. */ export async function withHandlers( handlers: Array, diff --git a/vitest.d.ts b/vitest.d.ts new file mode 100644 index 0000000..eeb6bba --- /dev/null +++ b/vitest.d.ts @@ -0,0 +1,13 @@ +import type { Assertion, AsymmetricMatchersContaining } from 'vitest' + +interface CustomMatchers { + /** + * Compare two `Uint8Array` arrays. + */ + toEqualBytes: (expected: Uint8Array) => R +} + +declare module 'vitest' { + interface Assertion extends CustomMatchers {} + interface AsymmetricMatchersContaining extends CustomMatchers {} +}