@jaypie/testkit 1.1.33 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -10
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/matchers/toBeMockFunction.matcher.d.ts +2 -10
- package/dist/mock/aws.d.ts +5 -7
- package/dist/mock/core.d.ts +13 -13
- package/dist/mock/datadog.d.ts +4 -4
- package/dist/mock/express.d.ts +10 -10
- package/dist/mock/index.d.ts +117 -84
- package/dist/mock/index.js +644 -9
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/kit.d.ts +2 -0
- package/dist/mock/llm.d.ts +4 -43
- package/dist/mock/logger.d.ts +5 -0
- package/dist/mock/matchers/toBeMockFunction.matcher.d.ts +2 -10
- package/dist/mock/mock/aws.d.ts +5 -7
- package/dist/mock/mock/core.d.ts +13 -13
- package/dist/mock/mock/datadog.d.ts +4 -4
- package/dist/mock/mock/express.d.ts +10 -10
- package/dist/mock/mock/index.d.ts +4 -2
- package/dist/mock/mock/kit.d.ts +2 -0
- package/dist/mock/mock/llm.d.ts +4 -43
- package/dist/mock/mock/logger.d.ts +5 -0
- package/dist/mock/mock/mongoose.d.ts +3 -3
- package/dist/mock/mock/original.d.ts +4 -0
- package/dist/mock/mock/textract.d.ts +2 -2
- package/dist/mock/mock/utils.d.ts +6 -5
- package/dist/mock/mongoose.d.ts +3 -3
- package/dist/mock/original.d.ts +4 -0
- package/dist/mock/textract.d.ts +2 -2
- package/dist/mock/utils.d.ts +6 -5
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _jaypie_core from '@jaypie/core';
|
|
|
2
2
|
import { Log, log } from '@jaypie/core';
|
|
3
3
|
import * as jest_json_schema from 'jest-json-schema';
|
|
4
4
|
import * as vitest from 'vitest';
|
|
5
|
-
import { Mock
|
|
5
|
+
import { Mock } from 'vitest';
|
|
6
6
|
|
|
7
7
|
declare const LOG: {
|
|
8
8
|
readonly LEVEL: {
|
|
@@ -114,15 +114,7 @@ declare const jsonApiSchema: {
|
|
|
114
114
|
readonly required: readonly ["data"];
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
declare
|
|
118
|
-
interface Assertion<T = any> {
|
|
119
|
-
toBeMockFunction(): T;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
declare function toBeMockFunction(this: Assertion, received: unknown): {
|
|
123
|
-
message: () => string;
|
|
124
|
-
pass: boolean;
|
|
125
|
-
};
|
|
117
|
+
declare function toBeMockFunction(received: unknown): MatcherResult;
|
|
126
118
|
|
|
127
119
|
declare const matchers: {
|
|
128
120
|
pass(message: string): any;
|
package/dist/index.js
CHANGED
|
@@ -195,10 +195,9 @@ const toBeJaypieError = (received) => {
|
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
function toBeMockFunction(received) {
|
|
198
|
-
const { equals, utils } = this;
|
|
199
198
|
const pass = typeof received === "function" && vi.isMockFunction(received);
|
|
200
199
|
return {
|
|
201
|
-
message: () => `expected ${
|
|
200
|
+
message: () => `expected ${received} ${pass ? "not " : ""}to be a mock function`,
|
|
202
201
|
pass,
|
|
203
202
|
};
|
|
204
203
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/constants.ts","../src/jsonApiSchema.module.ts","../src/matchers/toBeCalledAboveTrace.matcher.ts","../src/matchers/toBeCalledWithInitialParams.matcher.ts","../src/matchers/toBeClass.matcher.ts","../src/matchers/toBeJaypieError.matcher.ts","../src/matchers/toBeMockFunction.matcher.ts","../src/matchers/toMatch.matcher.ts","../src/matchers/toThrowError.matcher.ts","../src/matchers/toThrowJaypieError.matcher.ts","../src/matchers.module.ts","../src/mockLog.module.ts","../src/sqsTestRecords.function.ts"],"sourcesContent":["export const LOG = {\n LEVEL: {\n ALL: \"all\",\n DEBUG: \"debug\",\n ERROR: \"error\",\n FATAL: \"fatal\",\n INFO: \"info\",\n SILENT: \"silent\",\n TRACE: \"trace\",\n WARN: \"warn\",\n },\n} as const;\n\nexport const RE_BASE64_PATTERN = /^[a-zA-Z0-9\\\\+\\\\/]+$/;\nexport const RE_JWT_PATTERN = /^([^.]+)\\.([^.]+)\\.([^.]+)$/;\nexport const RE_MONGO_ID_PATTERN = /^[a-f0-9]{24}$/i;\nexport const RE_SIGNED_COOKIE_PATTERN = /^s:([^.]+)\\.([^.]+)$/;\nexport const RE_UUID_4_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_5_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?5[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\n","import { JsonApiData, JsonApiError } from \"./types/jaypie-testkit\";\n\nexport const jsonApiErrorSchema = {\n type: \"object\",\n properties: {\n errors: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n status: { type: \"number\" },\n title: { type: \"string\" },\n detail: { type: \"string\" },\n },\n required: [\"status\", \"title\"],\n },\n minItems: 1,\n },\n },\n required: [\"errors\"],\n} as const;\n\nexport const jsonApiSchema = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n type: { type: \"string\" },\n attributes: { type: \"object\" },\n links: { type: \"object\" },\n meta: { type: \"object\" },\n relationships: { type: \"object\" },\n },\n required: [\"id\", \"type\"],\n },\n meta: { type: \"object\" },\n },\n required: [\"data\"],\n} as const;\n\n// Type guards\nexport const isJsonApiError = (obj: unknown): obj is JsonApiError => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"errors\" in obj && Array.isArray((obj as JsonApiError).errors);\n};\n\nexport const isJsonApiData = (obj: unknown): obj is JsonApiData => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"data\" in obj && typeof (obj as JsonApiData).data === \"object\";\n};\n","import { LogMock, MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst calledAboveTrace = (log: LogMock): MatcherResult => {\n try {\n if (\n log.debug.mock.calls.length > 0 ||\n log.info.mock.calls.length > 0 ||\n log.warn.mock.calls.length > 0 ||\n log.error.mock.calls.length > 0 ||\n log.fatal.mock.calls.length > 0\n ) {\n return {\n message: () => `expected log not to have been called above trace`,\n pass: true,\n };\n }\n } catch (error) {\n throw Error(`[calledAboveTrace] log is not a mock object`);\n }\n\n return {\n message: () => `expected log not to have been called above trace`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default calledAboveTrace;\n","import { isDeepStrictEqual as isEqual } from \"node:util\";\nimport { Mock } from \"vitest\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeCalledWithInitialParams = (\n received: Mock,\n ...passed: unknown[]\n): MatcherResult => {\n let pass: boolean | undefined;\n\n if (!received || typeof received !== \"function\" || !received.mock) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected a mock function`,\n pass: false,\n };\n }\n\n received.mock.calls.forEach((call: unknown[]) => {\n if (call.length >= passed.length) {\n let matching = true;\n for (let i = 0; i < passed.length && matching; i += 1) {\n if (!isEqual(passed[i], call[i])) matching = false;\n }\n pass = pass || matching;\n }\n });\n\n if (pass === undefined) pass = false;\n\n if (pass) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected call beginning with [${passed},...]`,\n pass: true,\n };\n } else {\n return {\n message: () =>\n `Expectation \\`not.toBeCalledWithInitialParams\\` did not expect call beginning with [${passed},...]`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeCalledWithInitialParams;\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeClass = (received: unknown): MatcherResult => {\n let pass = false;\n if (typeof received === \"function\") {\n try {\n new (received as any)();\n pass = true;\n } catch (error) {\n pass = false;\n }\n }\n if (pass) {\n return {\n message: () => `expected ${received} not to be a class`,\n pass: true,\n };\n }\n return {\n message: () => `expected ${received} to be a class`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default toBeClass;\n","import { matchers as jsonSchemaMatchers } from \"jest-json-schema\";\nimport { jsonApiErrorSchema } from \"../jsonApiSchema.module\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper Functions\n//\n\nfunction isErrorObjectJaypieError(error: Error): MatcherResult {\n if (\"isProjectError\" in error) {\n return {\n message: () => `expected \"${error}\" not to be a Jaypie error`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${error}\" to be a Jaypie error`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nconst toBeJaypieError = (received: unknown): MatcherResult => {\n // See if it is an instance of error:\n if (received instanceof Error) {\n return isErrorObjectJaypieError(received);\n }\n\n const result = jsonSchemaMatchers.toMatchSchema(received, jsonApiErrorSchema);\n if (result.pass) {\n return {\n message: () => `expected ${received} not to be a Jaypie error`,\n pass: true,\n };\n } else {\n return {\n message: () => `expected ${received} to be a Jaypie error`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeJaypieError;\n","import { vi } from \"vitest\";\nimport type { Assertion } from \"vitest\";\n\ndeclare module \"vitest\" {\n interface Assertion<T = any> {\n toBeMockFunction(): T;\n }\n}\n\nexport function toBeMockFunction(this: Assertion, received: unknown) {\n const { equals, utils } = this;\n const pass = typeof received === \"function\" && vi.isMockFunction(received);\n\n return {\n message: () =>\n `expected ${utils.printReceived(received)} ${\n pass ? \"not \" : \"\"\n }to be a mock function`,\n pass,\n };\n}\n","import {\n RE_BASE64_PATTERN,\n RE_JWT_PATTERN,\n RE_MONGO_ID_PATTERN,\n RE_SIGNED_COOKIE_PATTERN,\n RE_UUID_4_PATTERN,\n RE_UUID_5_PATTERN,\n RE_UUID_PATTERN,\n} from \"../constants.js\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper\n//\n\ninterface ForSubjectToMatchPatternOptions {\n patternName?: string;\n}\n\nfunction forSubjectToMatchPattern(\n subject: string,\n pattern: RegExp,\n { patternName = \"pattern\" }: ForSubjectToMatchPatternOptions = {},\n): MatcherResult {\n if (pattern.test(subject)) {\n return {\n message: () => `expected \"${subject}\" not to match ${patternName}`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${subject}\" to match ${patternName}`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nexport const toMatchBase64 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_BASE64_PATTERN, {\n patternName: \"Base64\",\n });\n\nexport const toMatchJwt = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_JWT_PATTERN, {\n patternName: \"JWT\",\n });\n\nexport const toMatchMongoId = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_MONGO_ID_PATTERN, {\n patternName: \"MongoDbId\",\n });\n\nexport const toMatchSignedCookie = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_SIGNED_COOKIE_PATTERN, {\n patternName: \"Signed-Cookie\",\n });\n\nexport const toMatchUuid4 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_4_PATTERN, {\n patternName: \"UUIDv4\",\n });\n\nexport const toMatchUuid5 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_5_PATTERN, {\n patternName: \"UUIDv5\",\n });\n\n/**\n * Determines if subject matches a UUID pattern.\n * Does _NOT_ check if the UUID is valid.\n */\nexport const toMatchUuid = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_PATTERN, {\n patternName: \"UUID\",\n });\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\n\nconst toThrowError = async (\n received: ReceivedFunction,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n return {\n pass: false,\n message: () =>\n \"Expected function to throw an error, but it did not throw.\",\n };\n } catch (error) {\n return {\n pass: true,\n message: () =>\n `Expected function not to throw an error, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toThrowError;\n","import {\n BadGatewayError,\n BadRequestError,\n ConfigurationError,\n ForbiddenError,\n GatewayTimeoutError,\n InternalError,\n isJaypieError,\n NotFoundError,\n ProjectError,\n UnauthorizedError,\n UnavailableError,\n} from \"@jaypie/core\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n// Define a more specific type for ProjectError with _type field\ntype JaypieErrorWithType = ProjectError & { _type: string };\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\ntype ErrorConstructor = new () => ProjectError;\n\nfunction isErrorConstructor(value: unknown): value is ErrorConstructor {\n return typeof value === \"function\" && \"prototype\" in value;\n}\n\nconst toThrowJaypieError = async (\n received: ReceivedFunction,\n expected?: ProjectError | (() => ProjectError) | ErrorConstructor,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n let expectedError: ProjectError | undefined = undefined;\n\n // Handle constructor, function, or instance\n if (typeof expected === \"function\") {\n if (isErrorConstructor(expected)) {\n // It's a constructor\n expectedError = new expected();\n } else {\n // It's a regular function\n expectedError = expected();\n }\n } else if (expected) {\n // It's an instance\n expectedError = expected;\n }\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n // If no error is thrown, fail the test\n return {\n pass: false,\n message: () =>\n \"Expected function to throw a JaypieError, but it did not throw.\",\n };\n } catch (error) {\n if (isJaypieError(error)) {\n // Cast to the specific type with _type property\n const jaypieError = error as JaypieErrorWithType;\n\n // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n const expectedJaypieError = expectedError as JaypieErrorWithType;\n // If the error does not match, fail the test\n if (jaypieError._type !== expectedJaypieError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedJaypieError._type}\", but it threw \"${jaypieError._type}\"`,\n };\n }\n }\n return {\n pass: true,\n message: () =>\n `Expected function not to throw a JaypieError, but it threw ${error}`,\n };\n }\n\n return {\n pass: false,\n message: () =>\n `Expected function to throw a JaypieError, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Convenience Methods\n//\n\nconst toThrowBadGatewayError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadGatewayError);\nconst toThrowBadRequestError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadRequestError);\nconst toThrowConfigurationError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ConfigurationError);\nconst toThrowForbiddenError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ForbiddenError);\nconst toThrowGatewayTimeoutError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, GatewayTimeoutError);\nconst toThrowInternalError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, InternalError);\nconst toThrowNotFoundError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, NotFoundError);\nconst toThrowUnauthorizedError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnauthorizedError);\nconst toThrowUnavailableError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnavailableError);\n\n//\n//\n// Export\n//\n\nexport default toThrowJaypieError;\n\nexport {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n};\n","import * as jestExtendedMatchers from \"jest-extended\";\nimport { matchers as jestJsonSchemaMatchers } from \"jest-json-schema\";\nimport toBeCalledAboveTrace from \"./matchers/toBeCalledAboveTrace.matcher.js\";\nimport toBeCalledWithInitialParams from \"./matchers/toBeCalledWithInitialParams.matcher.js\";\nimport toBeClass from \"./matchers/toBeClass.matcher.js\";\nimport toBeJaypieError from \"./matchers/toBeJaypieError.matcher.js\";\nimport { toBeMockFunction } from \"./matchers/toBeMockFunction.matcher.js\";\nimport {\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n} from \"./matchers/toMatch.matcher.js\";\nimport toThrowError from \"./matchers/toThrowError.matcher.js\";\nimport toThrowJaypieError, {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n} from \"./matchers/toThrowJaypieError.matcher.js\";\n\n// Combine all matchers\nconst matchers = {\n // Custom Jaypie matchers\n toBeCalledAboveTrace,\n toBeCalledWithInitialParams,\n toBeClass,\n toBeJaypieError,\n toBeMockFunction,\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchSchema: jestJsonSchemaMatchers.toMatchSchema,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowJaypieError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n\n // Include all jest-extended matchers\n ...jestExtendedMatchers,\n};\n\nexport default matchers;\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","interface SQSEvent {\n Records: Array<{\n body: string;\n messageId?: string | number;\n [key: string]: unknown;\n }>;\n}\n\n/**\n * Creates a mock SQS event with the given records\n * @param records - Array of records or individual records to include in the event\n * @returns SQS event object with Records array\n */\nconst sqsTestRecords = (...records: Array<unknown>): SQSEvent => {\n // If first argument is an array, use that as records\n const recordsArray = Array.isArray(records[0]) ? records[0] : records;\n\n // Map records to SQS record format\n const formattedRecords = recordsArray.map((record) => {\n if (typeof record === \"object\" && record !== null) {\n return {\n ...record,\n body:\n typeof (record as { body?: unknown }).body === \"string\"\n ? (record as { body: string }).body\n : JSON.stringify((record as { body?: unknown }).body ?? record),\n };\n }\n return {\n body: String(record),\n };\n });\n\n return {\n Records: formattedRecords,\n };\n};\n\nexport default sqsTestRecords;\n"],"names":["isEqual","jsonSchemaMatchers","toBeCalledAboveTrace","jestJsonSchemaMatchers"],"mappings":";;;;;;AAAO,MAAM,GAAG,GAAG;AACjB,IAAA,KAAK,EAAE;AACL,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACb,KAAA;;AAGI,MAAM,iBAAiB,GAAG,sBAAsB;AAChD,MAAM,cAAc,GAAG,6BAA6B;AACpD,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,wBAAwB,GAAG,sBAAsB;AACvD,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,eAAe,GAC1B,2EAA2E;;ACpBtE,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE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,MAAM,cAAc,GAAG,CAAC,GAAG,OAAuB,KAAc;;IAE9D,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO;;IAGrE,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAI;QACnD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;YACjD,OAAO;AACL,gBAAA,GAAG,MAAM;AACT,gBAAA,IAAI,EACF,OAAQ,MAA6B,CAAC,IAAI,KAAK;sBAC1C,MAA2B,CAAC;sBAC7B,IAAI,CAAC,SAAS,CAAE,MAA6B,CAAC,IAAI,IAAI,MAAM,CAAC;aACpE;QACH;QACA,OAAO;AACL,YAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;SACrB;AACH,IAAA,CAAC,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,gBAAgB;KAC1B;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/constants.ts","../src/jsonApiSchema.module.ts","../src/matchers/toBeCalledAboveTrace.matcher.ts","../src/matchers/toBeCalledWithInitialParams.matcher.ts","../src/matchers/toBeClass.matcher.ts","../src/matchers/toBeJaypieError.matcher.ts","../src/matchers/toBeMockFunction.matcher.ts","../src/matchers/toMatch.matcher.ts","../src/matchers/toThrowError.matcher.ts","../src/matchers/toThrowJaypieError.matcher.ts","../src/matchers.module.ts","../src/mockLog.module.ts","../src/sqsTestRecords.function.ts"],"sourcesContent":["export const LOG = {\n LEVEL: {\n ALL: \"all\",\n DEBUG: \"debug\",\n ERROR: \"error\",\n FATAL: \"fatal\",\n INFO: \"info\",\n SILENT: \"silent\",\n TRACE: \"trace\",\n WARN: \"warn\",\n },\n} as const;\n\nexport const RE_BASE64_PATTERN = /^[a-zA-Z0-9\\\\+\\\\/]+$/;\nexport const RE_JWT_PATTERN = /^([^.]+)\\.([^.]+)\\.([^.]+)$/;\nexport const RE_MONGO_ID_PATTERN = /^[a-f0-9]{24}$/i;\nexport const RE_SIGNED_COOKIE_PATTERN = /^s:([^.]+)\\.([^.]+)$/;\nexport const RE_UUID_4_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_5_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?5[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\nexport const RE_UUID_PATTERN =\n /^[a-f0-9]{8}-?[a-f0-9]{4}-?[a-f0-9]{4}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}$/i;\n","import { JsonApiData, JsonApiError } from \"./types/jaypie-testkit\";\n\nexport const jsonApiErrorSchema = {\n type: \"object\",\n properties: {\n errors: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n status: { type: \"number\" },\n title: { type: \"string\" },\n detail: { type: \"string\" },\n },\n required: [\"status\", \"title\"],\n },\n minItems: 1,\n },\n },\n required: [\"errors\"],\n} as const;\n\nexport const jsonApiSchema = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n type: { type: \"string\" },\n attributes: { type: \"object\" },\n links: { type: \"object\" },\n meta: { type: \"object\" },\n relationships: { type: \"object\" },\n },\n required: [\"id\", \"type\"],\n },\n meta: { type: \"object\" },\n },\n required: [\"data\"],\n} as const;\n\n// Type guards\nexport const isJsonApiError = (obj: unknown): obj is JsonApiError => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"errors\" in obj && Array.isArray((obj as JsonApiError).errors);\n};\n\nexport const isJsonApiData = (obj: unknown): obj is JsonApiData => {\n if (!obj || typeof obj !== \"object\") return false;\n return \"data\" in obj && typeof (obj as JsonApiData).data === \"object\";\n};\n","import { LogMock, MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst calledAboveTrace = (log: LogMock): MatcherResult => {\n try {\n if (\n log.debug.mock.calls.length > 0 ||\n log.info.mock.calls.length > 0 ||\n log.warn.mock.calls.length > 0 ||\n log.error.mock.calls.length > 0 ||\n log.fatal.mock.calls.length > 0\n ) {\n return {\n message: () => `expected log not to have been called above trace`,\n pass: true,\n };\n }\n } catch (error) {\n throw Error(`[calledAboveTrace] log is not a mock object`);\n }\n\n return {\n message: () => `expected log not to have been called above trace`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default calledAboveTrace;\n","import { isDeepStrictEqual as isEqual } from \"node:util\";\nimport { Mock } from \"vitest\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeCalledWithInitialParams = (\n received: Mock,\n ...passed: unknown[]\n): MatcherResult => {\n let pass: boolean | undefined;\n\n if (!received || typeof received !== \"function\" || !received.mock) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected a mock function`,\n pass: false,\n };\n }\n\n received.mock.calls.forEach((call: unknown[]) => {\n if (call.length >= passed.length) {\n let matching = true;\n for (let i = 0; i < passed.length && matching; i += 1) {\n if (!isEqual(passed[i], call[i])) matching = false;\n }\n pass = pass || matching;\n }\n });\n\n if (pass === undefined) pass = false;\n\n if (pass) {\n return {\n message: () =>\n `Expectation \\`toBeCalledWithInitialParams\\` expected call beginning with [${passed},...]`,\n pass: true,\n };\n } else {\n return {\n message: () =>\n `Expectation \\`not.toBeCalledWithInitialParams\\` did not expect call beginning with [${passed},...]`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeCalledWithInitialParams;\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\nconst toBeClass = (received: unknown): MatcherResult => {\n let pass = false;\n if (typeof received === \"function\") {\n try {\n new (received as any)();\n pass = true;\n } catch (error) {\n pass = false;\n }\n }\n if (pass) {\n return {\n message: () => `expected ${received} not to be a class`,\n pass: true,\n };\n }\n return {\n message: () => `expected ${received} to be a class`,\n pass: false,\n };\n};\n\n//\n//\n// Export\n//\n\nexport default toBeClass;\n","import { matchers as jsonSchemaMatchers } from \"jest-json-schema\";\nimport { jsonApiErrorSchema } from \"../jsonApiSchema.module\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper Functions\n//\n\nfunction isErrorObjectJaypieError(error: Error): MatcherResult {\n if (\"isProjectError\" in error) {\n return {\n message: () => `expected \"${error}\" not to be a Jaypie error`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${error}\" to be a Jaypie error`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nconst toBeJaypieError = (received: unknown): MatcherResult => {\n // See if it is an instance of error:\n if (received instanceof Error) {\n return isErrorObjectJaypieError(received);\n }\n\n const result = jsonSchemaMatchers.toMatchSchema(received, jsonApiErrorSchema);\n if (result.pass) {\n return {\n message: () => `expected ${received} not to be a Jaypie error`,\n pass: true,\n };\n } else {\n return {\n message: () => `expected ${received} to be a Jaypie error`,\n pass: false,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toBeJaypieError;\n","import { vi } from \"vitest\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\nexport function toBeMockFunction(received: unknown): MatcherResult {\n const pass = typeof received === \"function\" && vi.isMockFunction(received);\n\n return {\n message: () =>\n `expected ${received} ${\n pass ? \"not \" : \"\"\n }to be a mock function`,\n pass,\n };\n}\n","import {\n RE_BASE64_PATTERN,\n RE_JWT_PATTERN,\n RE_MONGO_ID_PATTERN,\n RE_SIGNED_COOKIE_PATTERN,\n RE_UUID_4_PATTERN,\n RE_UUID_5_PATTERN,\n RE_UUID_PATTERN,\n} from \"../constants.js\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Helper\n//\n\ninterface ForSubjectToMatchPatternOptions {\n patternName?: string;\n}\n\nfunction forSubjectToMatchPattern(\n subject: string,\n pattern: RegExp,\n { patternName = \"pattern\" }: ForSubjectToMatchPatternOptions = {},\n): MatcherResult {\n if (pattern.test(subject)) {\n return {\n message: () => `expected \"${subject}\" not to match ${patternName}`,\n pass: true,\n };\n }\n return {\n message: () => `expected \"${subject}\" to match ${patternName}`,\n pass: false,\n };\n}\n\n//\n//\n// Main\n//\n\nexport const toMatchBase64 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_BASE64_PATTERN, {\n patternName: \"Base64\",\n });\n\nexport const toMatchJwt = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_JWT_PATTERN, {\n patternName: \"JWT\",\n });\n\nexport const toMatchMongoId = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_MONGO_ID_PATTERN, {\n patternName: \"MongoDbId\",\n });\n\nexport const toMatchSignedCookie = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_SIGNED_COOKIE_PATTERN, {\n patternName: \"Signed-Cookie\",\n });\n\nexport const toMatchUuid4 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_4_PATTERN, {\n patternName: \"UUIDv4\",\n });\n\nexport const toMatchUuid5 = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_5_PATTERN, {\n patternName: \"UUIDv5\",\n });\n\n/**\n * Determines if subject matches a UUID pattern.\n * Does _NOT_ check if the UUID is valid.\n */\nexport const toMatchUuid = (subject: string): MatcherResult =>\n forSubjectToMatchPattern(subject, RE_UUID_PATTERN, {\n patternName: \"UUID\",\n });\n","import { MatcherResult } from \"../types/jaypie-testkit\";\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\n\nconst toThrowError = async (\n received: ReceivedFunction,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n return {\n pass: false,\n message: () =>\n \"Expected function to throw an error, but it did not throw.\",\n };\n } catch (error) {\n return {\n pass: true,\n message: () =>\n `Expected function not to throw an error, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Export\n//\n\nexport default toThrowError;\n","import {\n BadGatewayError,\n BadRequestError,\n ConfigurationError,\n ForbiddenError,\n GatewayTimeoutError,\n InternalError,\n isJaypieError,\n NotFoundError,\n ProjectError,\n UnauthorizedError,\n UnavailableError,\n} from \"@jaypie/core\";\nimport { MatcherResult } from \"../types/jaypie-testkit\";\n\n// Define a more specific type for ProjectError with _type field\ntype JaypieErrorWithType = ProjectError & { _type: string };\n\n//\n//\n// Main\n//\n\ntype ReceivedFunction = () => unknown | Promise<unknown>;\ntype ErrorConstructor = new () => ProjectError;\n\nfunction isErrorConstructor(value: unknown): value is ErrorConstructor {\n return typeof value === \"function\" && \"prototype\" in value;\n}\n\nconst toThrowJaypieError = async (\n received: ReceivedFunction,\n expected?: ProjectError | (() => ProjectError) | ErrorConstructor,\n): Promise<MatcherResult> => {\n const isAsync =\n received.constructor.name === \"AsyncFunction\" ||\n received.constructor.name === \"Promise\";\n\n let expectedError: ProjectError | undefined = undefined;\n\n // Handle constructor, function, or instance\n if (typeof expected === \"function\") {\n if (isErrorConstructor(expected)) {\n // It's a constructor\n expectedError = new expected();\n } else {\n // It's a regular function\n expectedError = expected();\n }\n } else if (expected) {\n // It's an instance\n expectedError = expected;\n }\n\n try {\n const result = received();\n\n if (isAsync) {\n await result;\n }\n\n // If no error is thrown, fail the test\n return {\n pass: false,\n message: () =>\n \"Expected function to throw a JaypieError, but it did not throw.\",\n };\n } catch (error) {\n if (isJaypieError(error)) {\n // Cast to the specific type with _type property\n const jaypieError = error as JaypieErrorWithType;\n\n // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n const expectedJaypieError = expectedError as JaypieErrorWithType;\n // If the error does not match, fail the test\n if (jaypieError._type !== expectedJaypieError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedJaypieError._type}\", but it threw \"${jaypieError._type}\"`,\n };\n }\n }\n return {\n pass: true,\n message: () =>\n `Expected function not to throw a JaypieError, but it threw ${error}`,\n };\n }\n\n return {\n pass: false,\n message: () =>\n `Expected function to throw a JaypieError, but it threw ${error}`,\n };\n }\n};\n\n//\n//\n// Convenience Methods\n//\n\nconst toThrowBadGatewayError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadGatewayError);\nconst toThrowBadRequestError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, BadRequestError);\nconst toThrowConfigurationError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ConfigurationError);\nconst toThrowForbiddenError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, ForbiddenError);\nconst toThrowGatewayTimeoutError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, GatewayTimeoutError);\nconst toThrowInternalError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, InternalError);\nconst toThrowNotFoundError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, NotFoundError);\nconst toThrowUnauthorizedError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnauthorizedError);\nconst toThrowUnavailableError = (received: ReceivedFunction) =>\n toThrowJaypieError(received, UnavailableError);\n\n//\n//\n// Export\n//\n\nexport default toThrowJaypieError;\n\nexport {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n};\n","import * as jestExtendedMatchers from \"jest-extended\";\nimport { matchers as jestJsonSchemaMatchers } from \"jest-json-schema\";\nimport toBeCalledAboveTrace from \"./matchers/toBeCalledAboveTrace.matcher.js\";\nimport toBeCalledWithInitialParams from \"./matchers/toBeCalledWithInitialParams.matcher.js\";\nimport toBeClass from \"./matchers/toBeClass.matcher.js\";\nimport toBeJaypieError from \"./matchers/toBeJaypieError.matcher.js\";\nimport { toBeMockFunction } from \"./matchers/toBeMockFunction.matcher.js\";\nimport {\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n} from \"./matchers/toMatch.matcher.js\";\nimport toThrowError from \"./matchers/toThrowError.matcher.js\";\nimport toThrowJaypieError, {\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n} from \"./matchers/toThrowJaypieError.matcher.js\";\n\n// Combine all matchers\nconst matchers = {\n // Custom Jaypie matchers\n toBeCalledAboveTrace,\n toBeCalledWithInitialParams,\n toBeClass,\n toBeJaypieError,\n toBeMockFunction,\n toMatchBase64,\n toMatchJwt,\n toMatchMongoId,\n toMatchSignedCookie,\n toMatchSchema: jestJsonSchemaMatchers.toMatchSchema,\n toMatchUuid,\n toMatchUuid4,\n toMatchUuid5,\n toThrowBadGatewayError,\n toThrowBadRequestError,\n toThrowConfigurationError,\n toThrowError,\n toThrowForbiddenError,\n toThrowGatewayTimeoutError,\n toThrowInternalError,\n toThrowJaypieError,\n toThrowNotFoundError,\n toThrowUnauthorizedError,\n toThrowUnavailableError,\n\n // Include all jest-extended matchers\n ...jestExtendedMatchers,\n};\n\nexport default matchers;\n","import { log } from \"@jaypie/core\";\nimport { vi } from \"vitest\";\nimport { LogMock } from \"./types/jaypie-testkit\";\n\nexport function mockLogFactory(): LogMock {\n // Create skeleton of mock objects\n const mock = {\n debug: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n info: vi.fn(),\n init: vi.fn(),\n lib: vi.fn(),\n tag: vi.fn(),\n trace: vi.fn(),\n untag: vi.fn(),\n var: vi.fn(),\n warn: vi.fn(),\n with: vi.fn(),\n } as LogMock;\n\n // Fill out nested mocks\n mock.debug.var = mock.var;\n mock.error.var = mock.var;\n mock.fatal.var = mock.var;\n mock.info.var = mock.var;\n mock.trace.var = mock.var;\n mock.warn.var = mock.var;\n\n // Have modules return correct objects\n mock.init.mockReturnValue(null);\n mock.lib.mockReturnValue(mock);\n mock.with.mockReturnValue(mock);\n\n // Pin mocks to the module\n mock.mock = {\n debug: mock.debug,\n error: mock.error,\n fatal: mock.fatal,\n info: mock.info,\n init: mock.init,\n lib: mock.lib,\n tag: mock.tag,\n trace: mock.trace,\n untag: mock.untag,\n var: mock.var,\n warn: mock.warn,\n with: mock.with,\n };\n\n return mock;\n}\n\nconst LOG_METHOD_NAMES = [\n \"debug\",\n \"error\",\n \"fatal\",\n \"info\",\n \"init\",\n \"lib\",\n \"tag\",\n \"trace\",\n \"untag\",\n \"var\",\n \"warn\",\n \"with\",\n] as const;\n\n// Use Record type for more flexible access pattern\nconst originalLogMethods = new WeakMap<typeof log, Record<string, unknown>>();\n\nexport function spyLog(logInstance: typeof log): void {\n if (!originalLogMethods.has(logInstance)) {\n const mockLog = mockLogFactory();\n const originalMethods: Record<string, unknown> = {};\n\n // Save only methods that actually exist on the log instance\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in logInstance) {\n originalMethods[method] =\n logInstance[method as keyof typeof logInstance];\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] = mockLog[method];\n }\n });\n\n originalLogMethods.set(logInstance, originalMethods);\n }\n}\n\nexport function restoreLog(logInstance: typeof log): void {\n const originalMethods = originalLogMethods.get(logInstance);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (method in originalMethods && method in logInstance) {\n // Use type assertion after checking existence\n (logInstance as Record<string, unknown>)[method] =\n originalMethods[method];\n }\n });\n originalLogMethods.delete(logInstance);\n }\n}\n","interface SQSEvent {\n Records: Array<{\n body: string;\n messageId?: string | number;\n [key: string]: unknown;\n }>;\n}\n\n/**\n * Creates a mock SQS event with the given records\n * @param records - Array of records or individual records to include in the event\n * @returns SQS event object with Records array\n */\nconst sqsTestRecords = (...records: Array<unknown>): SQSEvent => {\n // If first argument is an array, use that as records\n const recordsArray = Array.isArray(records[0]) ? records[0] : records;\n\n // Map records to SQS record format\n const formattedRecords = recordsArray.map((record) => {\n if (typeof record === \"object\" && record !== null) {\n return {\n ...record,\n body:\n typeof (record as { body?: unknown }).body === \"string\"\n ? (record as { body: string }).body\n : JSON.stringify((record as { body?: unknown }).body ?? record),\n };\n }\n return {\n body: String(record),\n };\n });\n\n return {\n Records: formattedRecords,\n };\n};\n\nexport default sqsTestRecords;\n"],"names":["isEqual","jsonSchemaMatchers","toBeCalledAboveTrace","jestJsonSchemaMatchers"],"mappings":";;;;;;AAAO,MAAM,GAAG,GAAG;AACjB,IAAA,KAAK,EAAE;AACL,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,IAAI,EAAE,MAAM;AACb,KAAA;;AAGI,MAAM,iBAAiB,GAAG,sBAAsB;AAChD,MAAM,cAAc,GAAG,6BAA6B;AACpD,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,wBAAwB,GAAG,sBAAsB;AACvD,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,iBAAiB,GAC5B,4EAA4E;AACvE,MAAM,eAAe,GAC1B,2EAA2E;;ACpBtE,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,UAAU,EAAE;AACV,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACV,oBAAA,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC1B,oBAAA,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,E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AO;AACL,gBAAA,GAAG,MAAM;AACT,gBAAA,IAAI,EACF,OAAQ,MAA6B,CAAC,IAAI,KAAK;sBAC1C,MAA2B,CAAC;sBAC7B,IAAI,CAAC,SAAS,CAAE,MAA6B,CAAC,IAAI,IAAI,MAAM,CAAC;aACpE;QACH;QACA,OAAO;AACL,YAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;SACrB;AACH,IAAA,CAAC,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,gBAAgB;KAC1B;AACH;;;;"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare
|
|
3
|
-
interface Assertion<T = any> {
|
|
4
|
-
toBeMockFunction(): T;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export declare function toBeMockFunction(this: Assertion, received: unknown): {
|
|
8
|
-
message: () => string;
|
|
9
|
-
pass: boolean;
|
|
10
|
-
};
|
|
1
|
+
import { MatcherResult } from "../types/jaypie-testkit";
|
|
2
|
+
export declare function toBeMockFunction(received: unknown): MatcherResult;
|
package/dist/mock/aws.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
export declare const getMessages: (...args:
|
|
2
|
-
export declare const getSecret: (...args:
|
|
3
|
-
export declare const sendMessage: (...args:
|
|
4
|
-
MessageId: string;
|
|
5
|
-
}>;
|
|
1
|
+
export declare const getMessages: import("vitest").Mock<(...args: any[]) => any>;
|
|
2
|
+
export declare const getSecret: import("vitest").Mock<(...args: any[]) => any>;
|
|
3
|
+
export declare const sendMessage: import("vitest").Mock<(...args: any[]) => any>;
|
|
6
4
|
export declare const getEnvSecret: ((key: string) => Promise<string>) & {
|
|
7
5
|
mock: any;
|
|
8
6
|
};
|
|
9
|
-
export declare const getSingletonMessage: (...args:
|
|
7
|
+
export declare const getSingletonMessage: import("vitest").Mock<(...args: any[]) => any>;
|
|
10
8
|
export declare const getTextractJob: ((jobId: string) => Promise<any>) & {
|
|
11
9
|
mock: any;
|
|
12
10
|
};
|
|
13
|
-
export declare const sendBatchMessages: (...args:
|
|
11
|
+
export declare const sendBatchMessages: import("vitest").Mock<(...args: any[]) => any>;
|
|
14
12
|
export declare const sendTextractJob: (({ bucket, key, featureTypes, }: {
|
|
15
13
|
bucket: string;
|
|
16
14
|
key: string;
|
package/dist/mock/core.d.ts
CHANGED
|
@@ -45,17 +45,17 @@ export declare const validate: {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
export { log };
|
|
48
|
-
export declare const cloneDeep: (...args:
|
|
49
|
-
export declare const envBoolean: (...args:
|
|
50
|
-
export declare const envsKey: (...args:
|
|
48
|
+
export declare const cloneDeep: import("vitest").Mock<(...args: any[]) => any>;
|
|
49
|
+
export declare const envBoolean: import("vitest").Mock<(...args: any[]) => any>;
|
|
50
|
+
export declare const envsKey: import("vitest").Mock<(...args: any[]) => any>;
|
|
51
51
|
export declare const errorFromStatusCode: ((statusCode: number, message?: string) => Error) & {
|
|
52
52
|
mock: any;
|
|
53
53
|
};
|
|
54
|
-
export declare const formatError: (...args:
|
|
55
|
-
export declare const getHeaderFrom: (...args:
|
|
56
|
-
export declare const getObjectKeyCaseInsensitive: (...args:
|
|
57
|
-
export declare const isClass: (...args:
|
|
58
|
-
export declare const isJaypieError: (...args:
|
|
54
|
+
export declare const formatError: import("vitest").Mock<(...args: any[]) => any>;
|
|
55
|
+
export declare const getHeaderFrom: import("vitest").Mock<(...args: any[]) => any>;
|
|
56
|
+
export declare const getObjectKeyCaseInsensitive: import("vitest").Mock<(...args: any[]) => any>;
|
|
57
|
+
export declare const isClass: import("vitest").Mock<(...args: any[]) => any>;
|
|
58
|
+
export declare const isJaypieError: import("vitest").Mock<(...args: any[]) => any>;
|
|
59
59
|
export declare const optional: {
|
|
60
60
|
(value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
|
|
61
61
|
array<T = unknown>(value: unknown): value is T[] | undefined;
|
|
@@ -74,9 +74,9 @@ export declare const required: {
|
|
|
74
74
|
positive(value: unknown): value is number;
|
|
75
75
|
string(value: unknown, defaultValue?: string): value is string;
|
|
76
76
|
};
|
|
77
|
-
export declare const resolveValue: (...args:
|
|
78
|
-
export declare const safeParseFloat: (...args:
|
|
79
|
-
export declare const placeholders: (...args:
|
|
77
|
+
export declare const resolveValue: import("vitest").Mock<(...args: any[]) => any>;
|
|
78
|
+
export declare const safeParseFloat: import("vitest").Mock<(...args: any[]) => any>;
|
|
79
|
+
export declare const placeholders: import("vitest").Mock<(...args: any[]) => any>;
|
|
80
80
|
export declare const force: {
|
|
81
81
|
(value: unknown, type: unknown, options?: string | {
|
|
82
82
|
key?: string;
|
|
@@ -99,8 +99,8 @@ export declare const jaypieHandler: ((handler: Function, options?: {
|
|
|
99
99
|
}) => Function) & {
|
|
100
100
|
mock: any;
|
|
101
101
|
};
|
|
102
|
-
export declare const sleep: (...args:
|
|
103
|
-
export declare const uuid: (...args:
|
|
102
|
+
export declare const sleep: import("vitest").Mock<(...args: any[]) => any>;
|
|
103
|
+
export declare const uuid: import("vitest").Mock<(...args: any[]) => any>;
|
|
104
104
|
export declare const ERROR: {
|
|
105
105
|
MESSAGE: {
|
|
106
106
|
BAD_GATEWAY: "An unexpected error occurred on an upstream resource";
|
package/dist/mock/datadog.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as original from "@jaypie/datadog";
|
|
2
2
|
export declare const DATADOG: original.DatadogConstants;
|
|
3
|
-
export declare const hasDatadogEnv: (...args:
|
|
4
|
-
export declare const submitDistribution: (...args:
|
|
5
|
-
export declare const submitMetric: (...args:
|
|
6
|
-
export declare const submitMetricSet: (...args:
|
|
3
|
+
export declare const hasDatadogEnv: import("vitest").Mock<(...args: any[]) => any>;
|
|
4
|
+
export declare const submitDistribution: import("vitest").Mock<(...args: any[]) => any>;
|
|
5
|
+
export declare const submitMetric: import("vitest").Mock<(...args: any[]) => any>;
|
|
6
|
+
export declare const submitMetricSet: import("vitest").Mock<(...args: any[]) => any>;
|
package/dist/mock/express.d.ts
CHANGED
|
@@ -5,16 +5,16 @@ export declare const EXPRESS: {
|
|
|
5
5
|
ROOT: RegExp;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
export declare const badRequestRoute: (...args:
|
|
9
|
-
export declare const echoRoute: (...args:
|
|
10
|
-
export declare const forbiddenRoute: (...args:
|
|
11
|
-
export declare const goneRoute: (...args:
|
|
12
|
-
export declare const methodNotAllowedRoute: (...args:
|
|
13
|
-
export declare const noContentRoute: (...args:
|
|
14
|
-
export declare const notFoundRoute: (...args:
|
|
15
|
-
export declare const notImplementedRoute: (...args:
|
|
16
|
-
export declare const expressHttpCodeHandler: (...args:
|
|
17
|
-
export declare const cors: (...args:
|
|
8
|
+
export declare const badRequestRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
9
|
+
export declare const echoRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
10
|
+
export declare const forbiddenRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
11
|
+
export declare const goneRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
12
|
+
export declare const methodNotAllowedRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
13
|
+
export declare const noContentRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
14
|
+
export declare const notFoundRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
15
|
+
export declare const notImplementedRoute: import("vitest").Mock<(...args: any[]) => any>;
|
|
16
|
+
export declare const expressHttpCodeHandler: import("vitest").Mock<(...args: any[]) => any>;
|
|
17
|
+
export declare const cors: import("vitest").Mock<(...args: any[]) => any>;
|
|
18
18
|
export interface ExpressHandlerFunction {
|
|
19
19
|
(req: any, res: any, ...extra: any[]): Promise<any> | any;
|
|
20
20
|
}
|
package/dist/mock/index.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
/// <reference types="jest-extended" />
|
|
3
|
+
import * as vitest from 'vitest';
|
|
1
4
|
import * as original from '@jaypie/core';
|
|
2
5
|
export { log } from '@jaypie/core';
|
|
3
6
|
import * as original$1 from '@jaypie/datadog';
|
|
4
|
-
import * as vitest from 'vitest';
|
|
5
7
|
import * as original$2 from '@jaypie/llm';
|
|
6
8
|
import * as original$3 from '@jaypie/textract';
|
|
9
|
+
export { FORMAT, LEVEL, Logger } from '@jaypie/logger';
|
|
7
10
|
export { mongoose } from '@jaypie/mongoose';
|
|
8
11
|
|
|
9
|
-
declare const getMessages: (...args:
|
|
10
|
-
declare const getSecret: (...args:
|
|
11
|
-
declare const sendMessage: (...args:
|
|
12
|
-
MessageId: string;
|
|
13
|
-
}>;
|
|
12
|
+
declare const getMessages: vitest.Mock<(...args: any[]) => any>;
|
|
13
|
+
declare const getSecret: vitest.Mock<(...args: any[]) => any>;
|
|
14
|
+
declare const sendMessage: vitest.Mock<(...args: any[]) => any>;
|
|
14
15
|
declare const getEnvSecret: ((key: string) => Promise<string>) & {
|
|
15
16
|
mock: any;
|
|
16
17
|
};
|
|
17
|
-
declare const getSingletonMessage: (...args:
|
|
18
|
+
declare const getSingletonMessage: vitest.Mock<(...args: any[]) => any>;
|
|
18
19
|
declare const getTextractJob: ((jobId: string) => Promise<any>) & {
|
|
19
20
|
mock: any;
|
|
20
21
|
};
|
|
21
|
-
declare const sendBatchMessages: (...args:
|
|
22
|
+
declare const sendBatchMessages: vitest.Mock<(...args: any[]) => any>;
|
|
22
23
|
declare const sendTextractJob: (({ bucket, key, featureTypes, }: {
|
|
23
24
|
bucket: string;
|
|
24
25
|
key: string;
|
|
@@ -74,17 +75,17 @@ declare const validate: {
|
|
|
74
75
|
};
|
|
75
76
|
};
|
|
76
77
|
|
|
77
|
-
declare const cloneDeep: (...args:
|
|
78
|
-
declare const envBoolean: (...args:
|
|
79
|
-
declare const envsKey: (...args:
|
|
78
|
+
declare const cloneDeep: vitest.Mock<(...args: any[]) => any>;
|
|
79
|
+
declare const envBoolean: vitest.Mock<(...args: any[]) => any>;
|
|
80
|
+
declare const envsKey: vitest.Mock<(...args: any[]) => any>;
|
|
80
81
|
declare const errorFromStatusCode: ((statusCode: number, message?: string) => Error) & {
|
|
81
82
|
mock: any;
|
|
82
83
|
};
|
|
83
|
-
declare const formatError: (...args:
|
|
84
|
-
declare const getHeaderFrom: (...args:
|
|
85
|
-
declare const getObjectKeyCaseInsensitive: (...args:
|
|
86
|
-
declare const isClass: (...args:
|
|
87
|
-
declare const isJaypieError: (...args:
|
|
84
|
+
declare const formatError: vitest.Mock<(...args: any[]) => any>;
|
|
85
|
+
declare const getHeaderFrom: vitest.Mock<(...args: any[]) => any>;
|
|
86
|
+
declare const getObjectKeyCaseInsensitive: vitest.Mock<(...args: any[]) => any>;
|
|
87
|
+
declare const isClass: vitest.Mock<(...args: any[]) => any>;
|
|
88
|
+
declare const isJaypieError: vitest.Mock<(...args: any[]) => any>;
|
|
88
89
|
declare const optional: {
|
|
89
90
|
(value: unknown, type: unknown, options?: Record<string, unknown>): boolean;
|
|
90
91
|
array<T = unknown>(value: unknown): value is T[] | undefined;
|
|
@@ -103,9 +104,9 @@ declare const required: {
|
|
|
103
104
|
positive(value: unknown): value is number;
|
|
104
105
|
string(value: unknown, defaultValue?: string): value is string;
|
|
105
106
|
};
|
|
106
|
-
declare const resolveValue: (...args:
|
|
107
|
-
declare const safeParseFloat: (...args:
|
|
108
|
-
declare const placeholders: (...args:
|
|
107
|
+
declare const resolveValue: vitest.Mock<(...args: any[]) => any>;
|
|
108
|
+
declare const safeParseFloat: vitest.Mock<(...args: any[]) => any>;
|
|
109
|
+
declare const placeholders: vitest.Mock<(...args: any[]) => any>;
|
|
109
110
|
declare const force: {
|
|
110
111
|
(value: unknown, type: unknown, options?: string | {
|
|
111
112
|
key?: string;
|
|
@@ -128,8 +129,8 @@ declare const jaypieHandler: ((handler: Function, options?: {
|
|
|
128
129
|
}) => Function) & {
|
|
129
130
|
mock: any;
|
|
130
131
|
};
|
|
131
|
-
declare const sleep: (...args:
|
|
132
|
-
declare const uuid: (...args:
|
|
132
|
+
declare const sleep: vitest.Mock<(...args: any[]) => any>;
|
|
133
|
+
declare const uuid: vitest.Mock<(...args: any[]) => any>;
|
|
133
134
|
declare const ERROR: {
|
|
134
135
|
MESSAGE: {
|
|
135
136
|
BAD_GATEWAY: "An unexpected error occurred on an upstream resource";
|
|
@@ -336,10 +337,10 @@ declare const VALIDATE: {
|
|
|
336
337
|
};
|
|
337
338
|
|
|
338
339
|
declare const DATADOG: original$1.DatadogConstants;
|
|
339
|
-
declare const hasDatadogEnv: (...args:
|
|
340
|
-
declare const submitDistribution: (...args:
|
|
341
|
-
declare const submitMetric: (...args:
|
|
342
|
-
declare const submitMetricSet: (...args:
|
|
340
|
+
declare const hasDatadogEnv: vitest.Mock<(...args: any[]) => any>;
|
|
341
|
+
declare const submitDistribution: vitest.Mock<(...args: any[]) => any>;
|
|
342
|
+
declare const submitMetric: vitest.Mock<(...args: any[]) => any>;
|
|
343
|
+
declare const submitMetricSet: vitest.Mock<(...args: any[]) => any>;
|
|
343
344
|
|
|
344
345
|
declare const EXPRESS: {
|
|
345
346
|
PATH: {
|
|
@@ -348,16 +349,16 @@ declare const EXPRESS: {
|
|
|
348
349
|
ROOT: RegExp;
|
|
349
350
|
};
|
|
350
351
|
};
|
|
351
|
-
declare const badRequestRoute: (...args:
|
|
352
|
-
declare const echoRoute: (...args:
|
|
353
|
-
declare const forbiddenRoute: (...args:
|
|
354
|
-
declare const goneRoute: (...args:
|
|
355
|
-
declare const methodNotAllowedRoute: (...args:
|
|
356
|
-
declare const noContentRoute: (...args:
|
|
357
|
-
declare const notFoundRoute: (...args:
|
|
358
|
-
declare const notImplementedRoute: (...args:
|
|
359
|
-
declare const expressHttpCodeHandler: (...args:
|
|
360
|
-
declare const cors: (...args:
|
|
352
|
+
declare const badRequestRoute: vitest.Mock<(...args: any[]) => any>;
|
|
353
|
+
declare const echoRoute: vitest.Mock<(...args: any[]) => any>;
|
|
354
|
+
declare const forbiddenRoute: vitest.Mock<(...args: any[]) => any>;
|
|
355
|
+
declare const goneRoute: vitest.Mock<(...args: any[]) => any>;
|
|
356
|
+
declare const methodNotAllowedRoute: vitest.Mock<(...args: any[]) => any>;
|
|
357
|
+
declare const noContentRoute: vitest.Mock<(...args: any[]) => any>;
|
|
358
|
+
declare const notFoundRoute: vitest.Mock<(...args: any[]) => any>;
|
|
359
|
+
declare const notImplementedRoute: vitest.Mock<(...args: any[]) => any>;
|
|
360
|
+
declare const expressHttpCodeHandler: vitest.Mock<(...args: any[]) => any>;
|
|
361
|
+
declare const cors: vitest.Mock<(...args: any[]) => any>;
|
|
361
362
|
interface ExpressHandlerFunction {
|
|
362
363
|
(req: any, res: any, ...extra: any[]): Promise<any> | any;
|
|
363
364
|
}
|
|
@@ -373,6 +374,9 @@ declare const expressHandler: ((handlerOrProps: ExpressHandlerParameter, propsOr
|
|
|
373
374
|
mock: any;
|
|
374
375
|
};
|
|
375
376
|
|
|
377
|
+
declare const isProductionEnv: vitest.Mock<(...args: any[]) => any>;
|
|
378
|
+
declare const isNodeTestEnv: vitest.Mock<(...args: any[]) => any>;
|
|
379
|
+
|
|
376
380
|
type HandlerFunction = (...args: unknown[]) => unknown;
|
|
377
381
|
type LifecycleFunction = (...args: unknown[]) => unknown | Promise<unknown>;
|
|
378
382
|
interface LambdaOptions {
|
|
@@ -390,58 +394,87 @@ declare const lambdaHandler: ((handler: HandlerFunction, props?: LambdaOptions)
|
|
|
390
394
|
|
|
391
395
|
declare const LLM: typeof original$2.LLM;
|
|
392
396
|
declare const Llm: vitest.Mock<(...args: any[]) => any> & {
|
|
393
|
-
operate: (...args:
|
|
394
|
-
|
|
395
|
-
content: string;
|
|
396
|
-
role: string;
|
|
397
|
-
type: string;
|
|
398
|
-
id?: undefined;
|
|
399
|
-
status?: undefined;
|
|
400
|
-
} | {
|
|
401
|
-
id: string;
|
|
402
|
-
type: string;
|
|
403
|
-
status: string;
|
|
404
|
-
content: string;
|
|
405
|
-
role: string;
|
|
406
|
-
})[];
|
|
407
|
-
model: string;
|
|
408
|
-
output: {
|
|
409
|
-
id: string;
|
|
410
|
-
type: string;
|
|
411
|
-
status: string;
|
|
412
|
-
content: string;
|
|
413
|
-
role: string;
|
|
414
|
-
}[];
|
|
415
|
-
provider: string;
|
|
416
|
-
responses: {
|
|
417
|
-
id: string;
|
|
418
|
-
object: string;
|
|
419
|
-
created_at: number;
|
|
420
|
-
status: string;
|
|
421
|
-
error: null;
|
|
422
|
-
output_text: string;
|
|
423
|
-
}[];
|
|
424
|
-
status: string;
|
|
425
|
-
usage: {
|
|
426
|
-
input: number;
|
|
427
|
-
output: number;
|
|
428
|
-
reasoning: number;
|
|
429
|
-
total: number;
|
|
430
|
-
provider: string;
|
|
431
|
-
model: string;
|
|
432
|
-
}[];
|
|
433
|
-
content: string;
|
|
434
|
-
}>;
|
|
435
|
-
send: (...args: unknown[]) => Promise<string>;
|
|
397
|
+
operate: vitest.Mock<(...args: any[]) => any>;
|
|
398
|
+
send: vitest.Mock<(...args: any[]) => any>;
|
|
436
399
|
};
|
|
437
400
|
declare const Toolkit: typeof original$2.Toolkit;
|
|
438
401
|
declare const JaypieToolkit: typeof original$2.JaypieToolkit;
|
|
402
|
+
declare const LlmMessageRole: typeof original$2.LlmMessageRole;
|
|
403
|
+
declare const LlmMessageType: typeof original$2.LlmMessageType;
|
|
439
404
|
declare const toolkit: original$2.JaypieToolkit;
|
|
440
405
|
declare const tools: Omit<original$2.LlmTool, "call">[];
|
|
441
406
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
407
|
+
interface JsonApiError {
|
|
408
|
+
errors: Array<{
|
|
409
|
+
status: number;
|
|
410
|
+
title: string;
|
|
411
|
+
detail?: string;
|
|
412
|
+
}>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Import and re-export all matcher types
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
// Make sure this is exported so it can be used by consumers
|
|
419
|
+
interface CustomMatchers<R = unknown> {
|
|
420
|
+
// Custom Jaypie matchers
|
|
421
|
+
toBeCalledAboveTrace(): R;
|
|
422
|
+
toBeCalledWithInitialParams(...params: unknown[]): R;
|
|
423
|
+
toBeClass(): R;
|
|
424
|
+
toBeJaypieError(): R;
|
|
425
|
+
toBeMockFunction(): R;
|
|
426
|
+
toMatchBase64(): R;
|
|
427
|
+
toMatchJwt(): R;
|
|
428
|
+
toMatchMongoId(): R;
|
|
429
|
+
toMatchSignedCookie(): R;
|
|
430
|
+
toMatchUuid(): R;
|
|
431
|
+
toMatchUuid4(): R;
|
|
432
|
+
toMatchUuid5(): R;
|
|
433
|
+
toThrowBadGatewayError(): R;
|
|
434
|
+
toThrowBadRequestError(): R;
|
|
435
|
+
toThrowConfigurationError(): R;
|
|
436
|
+
toThrowForbiddenError(): R;
|
|
437
|
+
toThrowGatewayTimeoutError(): R;
|
|
438
|
+
toThrowInternalError(): R;
|
|
439
|
+
toThrowJaypieError(expected?: JsonApiError): R;
|
|
440
|
+
toThrowNotFoundError(): R;
|
|
441
|
+
toThrowUnauthorizedError(): R;
|
|
442
|
+
toThrowUnavailableError(): R;
|
|
443
|
+
|
|
444
|
+
// Include jest-extended matchers
|
|
445
|
+
// These are already included via jest-extended reference
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Export combined interface that includes both custom matchers and jest-extended matchers
|
|
449
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
450
|
+
interface JaypieMatchers<R = unknown> extends CustomMatchers<R> {}
|
|
451
|
+
|
|
452
|
+
declare global {
|
|
453
|
+
namespace Vi {
|
|
454
|
+
interface Assertion<T = unknown> extends JaypieMatchers<T> {
|
|
455
|
+
not: Assertion<T>;
|
|
456
|
+
}
|
|
457
|
+
interface AsymmetricMatchersContaining extends JaypieMatchers {
|
|
458
|
+
not: AsymmetricMatchersContaining;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// This is needed for module augmentation to work properly
|
|
464
|
+
declare module "vitest" {
|
|
465
|
+
interface Assertion<T = unknown> extends JaypieMatchers<T> {
|
|
466
|
+
not: Assertion<T>;
|
|
467
|
+
}
|
|
468
|
+
interface AsymmetricMatchersContaining extends JaypieMatchers {
|
|
469
|
+
not: AsymmetricMatchersContaining;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
declare const createLogger: vitest.Mock<(...args: any[]) => any>;
|
|
474
|
+
|
|
475
|
+
declare const connect: vitest.Mock<(...args: any[]) => any>;
|
|
476
|
+
declare const connectFromSecretEnv: vitest.Mock<(...args: any[]) => any>;
|
|
477
|
+
declare const disconnect: vitest.Mock<(...args: any[]) => any>;
|
|
445
478
|
|
|
446
479
|
/**
|
|
447
480
|
* Mock for MarkdownPage class from @jaypie/textract
|
|
@@ -450,9 +483,9 @@ declare const MarkdownPage: typeof original$3.MarkdownPage;
|
|
|
450
483
|
/**
|
|
451
484
|
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
452
485
|
*/
|
|
453
|
-
declare const textractJsonToMarkdown: (...args:
|
|
486
|
+
declare const textractJsonToMarkdown: vitest.Mock<(...args: any[]) => any>;
|
|
454
487
|
|
|
455
|
-
declare const
|
|
488
|
+
declare const mock: Record<string, any>;
|
|
456
489
|
|
|
457
|
-
export { BadGatewayError, BadRequestError, ConfigurationError, DATADOG, ERROR, EXPRESS, ForbiddenError, GatewayTimeoutError, GoneError, HTTP, IllogicalError, InternalError, JAYPIE, JaypieToolkit, LLM, Llm, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, PROJECT, ProjectError, ProjectMultiError, RejectedError, TeapotError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, VALIDATE, badRequestRoute, cloneDeep, connect, connectFromSecretEnv, cors,
|
|
490
|
+
export { BadGatewayError, BadRequestError, ConfigurationError, DATADOG, ERROR, EXPRESS, ForbiddenError, GatewayTimeoutError, GoneError, HTTP, IllogicalError, InternalError, JAYPIE, JaypieToolkit, LLM, Llm, LlmMessageRole, LlmMessageType, MarkdownPage, MethodNotAllowedError, MultiError, NotFoundError, NotImplementedError, PROJECT, ProjectError, ProjectMultiError, RejectedError, TeapotError, Toolkit, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError, VALIDATE, badRequestRoute, cloneDeep, connect, connectFromSecretEnv, cors, createLogger, mock as default, disconnect, echoRoute, envBoolean, envsKey, errorFromStatusCode, expressHandler, expressHttpCodeHandler, forbiddenRoute, force, formatError, getEnvSecret, getHeaderFrom, getMessages, getObjectKeyCaseInsensitive, getSecret, getSingletonMessage, getTextractJob, goneRoute, hasDatadogEnv, isClass, isJaypieError, isNodeTestEnv, isProductionEnv, jaypieHandler, lambdaHandler, methodNotAllowedRoute, noContentRoute, notFoundRoute, notImplementedRoute, optional, placeholders, required, resolveValue, safeParseFloat, sendBatchMessages, sendMessage, sendTextractJob, sleep, submitDistribution, submitMetric, submitMetricSet, textractJsonToMarkdown, toolkit, tools, uuid, validate };
|
|
458
491
|
export type { ExpressHandlerFunction, ExpressHandlerOptions, LambdaOptions };
|