@jaypie/testkit 1.1.34 → 1.1.36
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 +21 -13
- package/dist/mock/datadog.d.ts +4 -4
- package/dist/mock/express.d.ts +14 -14
- package/dist/mock/index.d.ts +129 -88
- package/dist/mock/index.js +636 -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 +21 -13
- package/dist/mock/mock/datadog.d.ts +4 -4
- package/dist/mock/mock/express.d.ts +14 -14
- 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 +7 -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";
|
|
@@ -265,12 +265,19 @@ export declare const JAYPIE: {
|
|
|
265
265
|
CORE: "@jaypie/core";
|
|
266
266
|
ESLINT: "@jaypie/eslint";
|
|
267
267
|
EXPRESS: "@jaypie/express";
|
|
268
|
+
FABRICATOR: "@jaypie/fabricator";
|
|
268
269
|
ERRORS: "@jaypie/errors";
|
|
269
270
|
JAYPIE: "jaypie";
|
|
271
|
+
KIT: "@jaypie/kit";
|
|
270
272
|
LAMBDA: "@jaypie/lambda";
|
|
271
273
|
LLM: "@jaypie/llm";
|
|
274
|
+
LOGGER: "@jaypie/logger";
|
|
275
|
+
MCP: "@jaypie/mcp";
|
|
276
|
+
MOCK: "@jaypie/mock";
|
|
272
277
|
MONGOOSE: "@jaypie/mongoose";
|
|
273
278
|
TESTKIT: "@jaypie/testkit";
|
|
279
|
+
TEXTTRACT: "@jaypie/textract";
|
|
280
|
+
TYPES: "@jaypie/types";
|
|
274
281
|
WEBKIT: "@jaypie/webkit";
|
|
275
282
|
};
|
|
276
283
|
LAYER: {
|
|
@@ -279,6 +286,7 @@ export declare const JAYPIE: {
|
|
|
279
286
|
JAYPIE: "jaypie";
|
|
280
287
|
LAMBDA: "lambda";
|
|
281
288
|
MODULE: "module";
|
|
289
|
+
NEXTJS: "nextjs";
|
|
282
290
|
};
|
|
283
291
|
LOGGER: {
|
|
284
292
|
DEFAULT: "default";
|
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
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export declare const EXPRESS: {
|
|
2
|
-
PATH: {
|
|
3
|
-
ANY: "*";
|
|
4
|
-
ID: "/:id";
|
|
5
|
-
ROOT: RegExp;
|
|
2
|
+
readonly PATH: {
|
|
3
|
+
readonly ANY: "*";
|
|
4
|
+
readonly ID: "/:id";
|
|
5
|
+
readonly 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
|
}
|