@jaypie/testkit 1.1.22 → 1.1.23
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/README.md +28 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/matchers.module.d.ts +69 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,9 +10,35 @@ Test utilities built for Jaypie
|
|
|
10
10
|
npm install --save-dev @jaypie/testkit
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
### Matchers
|
|
14
|
+
|
|
15
|
+
This package includes custom Jaypie matchers and all matchers from [jest-extended](https://github.com/jest-community/jest-extended).
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// In your test setup file
|
|
19
|
+
import { expect } from 'vitest'; // or Jest
|
|
20
|
+
import { matchers } from '@jaypie/testkit';
|
|
21
|
+
|
|
22
|
+
// Extend with all matchers (includes jest-extended)
|
|
23
|
+
expect.extend(matchers);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### TypeScript Support
|
|
27
|
+
|
|
28
|
+
The package includes types for all matchers. You don't need to install `@types/jest-extended` separately.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// In your test file
|
|
32
|
+
import '@jaypie/testkit'; // Imports types automatically
|
|
33
|
+
|
|
34
|
+
// Now you can use both Jaypie matchers and jest-extended matchers
|
|
35
|
+
expect(myObject).toBeObject(); // jest-extended matcher
|
|
36
|
+
expect(myClass).toBeClass(); // Jaypie matcher
|
|
37
|
+
```
|
|
38
|
+
|
|
13
39
|
### Example
|
|
14
40
|
|
|
15
|
-
See [Jaypie](https://github.com/finlaysonstudio/jaypie) for usage.
|
|
41
|
+
See [Jaypie](https://github.com/finlaysonstudio/jaypie) for more usage examples.
|
|
16
42
|
|
|
17
43
|
## 🌠 Wishlist
|
|
18
44
|
|
|
@@ -27,6 +53,7 @@ See [Jaypie](https://github.com/finlaysonstudio/jaypie) for usage.
|
|
|
27
53
|
|
|
28
54
|
| Date | Version | Summary |
|
|
29
55
|
| ---------- | ------- | -------------- |
|
|
56
|
+
| 4/28/2025 | (next) | Include jest-extended matchers and types |
|
|
30
57
|
| 9/15/2024 | 1.0.29 | All errors exported as mocks |
|
|
31
58
|
| 9/14/2024 | 1.0.28 | Matchers `toThrowBadGatewayError`, `toThrowGatewayTimeoutError`, `toThrowUnavailableError` |
|
|
32
59
|
| 9/13/2024 | 1.0.27 | Matcher `toBeCalledAboveTrace` |
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as jestExtendedMatchers from 'jest-extended';
|
|
1
2
|
import { matchers as matchers$1 } from 'jest-json-schema';
|
|
2
3
|
import isEqual from 'lodash.isequal';
|
|
3
4
|
import { isJaypieError, UnauthorizedError, NotFoundError, InternalError, GatewayTimeoutError, ForbiddenError, ConfigurationError, BadRequestError, BadGatewayError, UnavailableError } from '@jaypie/core';
|
|
@@ -329,7 +330,9 @@ const toThrowNotFoundError = (received) => toThrowJaypieError(received, NotFound
|
|
|
329
330
|
const toThrowUnauthorizedError = (received) => toThrowJaypieError(received, UnauthorizedError);
|
|
330
331
|
const toThrowUnavailableError = (received) => toThrowJaypieError(received, UnavailableError);
|
|
331
332
|
|
|
333
|
+
// Combine all matchers
|
|
332
334
|
const matchers = {
|
|
335
|
+
// Custom Jaypie matchers
|
|
333
336
|
toBeCalledAboveTrace: calledAboveTrace,
|
|
334
337
|
toBeCalledWithInitialParams,
|
|
335
338
|
toBeClass,
|
|
@@ -353,6 +356,8 @@ const matchers = {
|
|
|
353
356
|
toThrowNotFoundError,
|
|
354
357
|
toThrowUnauthorizedError,
|
|
355
358
|
toThrowUnavailableError,
|
|
359
|
+
// Include all jest-extended matchers
|
|
360
|
+
...jestExtendedMatchers,
|
|
356
361
|
};
|
|
357
362
|
|
|
358
363
|
function mockLogFactory() {
|
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/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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\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 isEqual from \"lodash.isequal\";\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (received as any)();\n pass = true;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\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 {\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//\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 // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n // If the error does not match, fail the test\n if (error._type !== expectedError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedError._type}\", but it threw \"${error._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 { 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 {\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\nconst matchers = {\n toBeCalledAboveTrace,\n toBeCalledWithInitialParams,\n toBeClass,\n toBeJaypieError,\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\nexport default matchers;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { 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\nconst originalLogMethods = new WeakMap<Log, Partial<Log>>();\n\nexport function spyLog(log: Log): void {\n if (!originalLogMethods.has(log)) {\n const mockLog = mockLogFactory();\n const originalMethods: Partial<Log> = {};\n\n LOG_METHOD_NAMES.forEach((method) => {\n originalMethods[method] = log[method] as any;\n log[method] = mockLog[method] as any;\n });\n\n originalLogMethods.set(log, originalMethods);\n }\n}\n\nexport function restoreLog(log: Log): void {\n const originalMethods = originalLogMethods.get(log);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (originalMethods[method]) {\n log[method] = originalMethods[method] as any;\n }\n });\n originalLogMethods.delete(log);\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":["jsonSchemaMatchers","toBeCalledAboveTrace","jestJsonSchemaMatchers"],"mappings":";;;;;AAAa,MAAA,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;;ACpBhE,MAAA,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,EAAE;AACzB,oBAAA,MAAM,EAAE,EAAE,IAAI,E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,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;AAClC,YAAA,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE;gBAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAQ;;AAEhD,SAAC,CAAC;AACF,QAAA,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC;;AAElC;;ACvFA;;;;AAIG;AACH,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;;QAEH,OAAO;AACL,YAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;SACrB;AACH,KAAC,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/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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\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 isEqual from \"lodash.isequal\";\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (received as any)();\n pass = true;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\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 {\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//\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 // If expected is also a JaypieError, check if the error matches\n if (expectedError && isJaypieError(expectedError)) {\n // If the error does not match, fail the test\n if (error._type !== expectedError._type) {\n return {\n pass: false,\n message: () =>\n `Expected function to throw \"${expectedError._type}\", but it threw \"${error._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 {\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 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","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { 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\nconst originalLogMethods = new WeakMap<Log, Partial<Log>>();\n\nexport function spyLog(log: Log): void {\n if (!originalLogMethods.has(log)) {\n const mockLog = mockLogFactory();\n const originalMethods: Partial<Log> = {};\n\n LOG_METHOD_NAMES.forEach((method) => {\n originalMethods[method] = log[method] as any;\n log[method] = mockLog[method] as any;\n });\n\n originalLogMethods.set(log, originalMethods);\n }\n}\n\nexport function restoreLog(log: Log): void {\n const originalMethods = originalLogMethods.get(log);\n if (originalMethods) {\n LOG_METHOD_NAMES.forEach((method) => {\n if (originalMethods[method]) {\n log[method] = originalMethods[method] as any;\n }\n });\n originalLogMethods.delete(log);\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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AAkB,CAAC,MAAM,CAAC,GAAG,CAAC;;AAElC;;ACvFA;;;;AAIG;AACH,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;;QAEH,OAAO;AACL,YAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;SACrB;AACH,KAAC,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,gBAAgB;KAC1B;AACH;;;;"}
|
|
@@ -1,4 +1,73 @@
|
|
|
1
1
|
declare const matchers: {
|
|
2
|
+
pass(message: string): any;
|
|
3
|
+
fail(message: string): any;
|
|
4
|
+
toBeEmpty(): any;
|
|
5
|
+
toBeOneOf<E = unknown>(members: readonly E[]): any;
|
|
6
|
+
toBeNil(): any;
|
|
7
|
+
toSatisfy<E = any>(predicate: (x: E) => boolean): any;
|
|
8
|
+
toBeArray(): any;
|
|
9
|
+
toBeArrayOfSize(x: number): any;
|
|
10
|
+
toBeAfter(date: Date): any;
|
|
11
|
+
toBeBefore(date: Date): any;
|
|
12
|
+
toIncludeAllMembers<E = unknown>(members: readonly E[]): any;
|
|
13
|
+
toIncludeAnyMembers<E = unknown>(members: readonly E[]): any;
|
|
14
|
+
toIncludeSameMembers<E = unknown>(members: readonly E[]): any;
|
|
15
|
+
toPartiallyContain<E = unknown>(member: E): any;
|
|
16
|
+
toSatisfyAll<E = any>(predicate: (x: E) => boolean): any;
|
|
17
|
+
toSatisfyAny(predicate: (x: any) => boolean): any;
|
|
18
|
+
toBeBoolean(): any;
|
|
19
|
+
toBeTrue(): any;
|
|
20
|
+
toBeFalse(): any;
|
|
21
|
+
toBeDate(): any;
|
|
22
|
+
toBeValidDate(): any;
|
|
23
|
+
toBeFunction(): any;
|
|
24
|
+
toBeDateString(): any;
|
|
25
|
+
toBeHexadecimal(): any;
|
|
26
|
+
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation?: boolean): any;
|
|
27
|
+
toHaveBeenCalledAfter(mock: jest.MockInstance<any, any[]>, failIfNoFirstInvocation?: boolean): any;
|
|
28
|
+
toHaveBeenCalledOnce(): any;
|
|
29
|
+
toHaveBeenCalledExactlyOnceWith(...args: unknown[]): any;
|
|
30
|
+
toBeNumber(): any;
|
|
31
|
+
toBeNaN(): any;
|
|
32
|
+
toBeFinite(): any;
|
|
33
|
+
toBePositive(): any;
|
|
34
|
+
toBeNegative(): any;
|
|
35
|
+
toBeEven(): any;
|
|
36
|
+
toBeOdd(): any;
|
|
37
|
+
toBeWithin(start: number, end: number): any;
|
|
38
|
+
toBeInRange(min: number, max: number): any;
|
|
39
|
+
toBeObject(): any;
|
|
40
|
+
toContainKey(key: string): any;
|
|
41
|
+
toContainKeys<E = unknown>(keys: readonly (string | keyof E)[]): any;
|
|
42
|
+
toContainAllKeys<E = unknown>(keys: readonly (string | keyof E)[]): any;
|
|
43
|
+
toContainAnyKeys<E = unknown>(keys: readonly (string | keyof E)[]): any;
|
|
44
|
+
toContainValue<E = unknown>(value: E): any;
|
|
45
|
+
toContainValues<E = unknown>(values: readonly E[]): any;
|
|
46
|
+
toContainAllValues<E = unknown>(values: readonly E[]): any;
|
|
47
|
+
toContainAnyValues<E = unknown>(values: readonly E[]): any;
|
|
48
|
+
toContainEntry<E = unknown>(entry: readonly [keyof E, E[keyof E]]): any;
|
|
49
|
+
toContainEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;
|
|
50
|
+
toContainAllEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;
|
|
51
|
+
toContainAnyEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;
|
|
52
|
+
toBeExtensible(): any;
|
|
53
|
+
toBeFrozen(): any;
|
|
54
|
+
toBeSealed(): any;
|
|
55
|
+
toResolve(): any;
|
|
56
|
+
toReject(): any;
|
|
57
|
+
toBeString(): any;
|
|
58
|
+
toEqualCaseInsensitive(string: string): any;
|
|
59
|
+
toStartWith(prefix: string): any;
|
|
60
|
+
toEndWith(suffix: string): any;
|
|
61
|
+
toInclude(substring: string): any;
|
|
62
|
+
toIncludeRepeated(substring: string, times: number): any;
|
|
63
|
+
toIncludeMultiple(substring: readonly string[]): any;
|
|
64
|
+
toThrowWithMessage(type: (...args: any[]) => any, message: string | RegExp): any;
|
|
65
|
+
toBeEmptyObject(): any;
|
|
66
|
+
toBeSymbol(): any;
|
|
67
|
+
toBeBetween(startDate: Date, endDate: Date): any;
|
|
68
|
+
toBeBeforeOrEqualTo(date: Date): any;
|
|
69
|
+
toBeAfterOrEqualTo(date: Date): any;
|
|
70
|
+
toEqualIgnoringWhitespace(string: string): any;
|
|
2
71
|
toBeCalledAboveTrace: (log: import("./types/jaypie-testkit.js").LogMock) => import("./types/jaypie-testkit.js").MatcherResult;
|
|
3
72
|
toBeCalledWithInitialParams: (received: import("vitest").Mock, ...passed: unknown[]) => import("./types/jaypie-testkit.js").MatcherResult;
|
|
4
73
|
toBeClass: (received: unknown) => import("./types/jaypie-testkit.js").MatcherResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/testkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Finlayson Studio",
|
|
6
6
|
"type": "module",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@jaypie/textract": "^0.2.3",
|
|
33
33
|
"@jaypie/types": "^0.1.3",
|
|
34
34
|
"jaypie": "^1.0.44",
|
|
35
|
+
"jest-extended": "^4.0.2",
|
|
35
36
|
"jest-json-schema": "^6.1.0",
|
|
36
37
|
"lodash.isequal": "^4.5.0",
|
|
37
38
|
"uuid": "^11.0.5"
|
|
@@ -43,7 +44,6 @@
|
|
|
43
44
|
"@types/node": "^22.13.1",
|
|
44
45
|
"@types/supertest": "^6.0.2",
|
|
45
46
|
"express": "^4.21.1",
|
|
46
|
-
"jest-extended": "^4.0.2",
|
|
47
47
|
"rollup": "^4.29.1",
|
|
48
48
|
"rollup-plugin-copy": "^3.5.0",
|
|
49
49
|
"rollup-plugin-dts": "^6.1.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "311a22d56a1807a4ecc9196b22dd4dda08fa04f7"
|
|
57
57
|
}
|