@jaypie/testkit 1.1.33 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -10
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/matchers/toBeMockFunction.matcher.d.ts +2 -10
- package/dist/mock/aws.d.ts +5 -7
- package/dist/mock/core.d.ts +13 -13
- package/dist/mock/datadog.d.ts +4 -4
- package/dist/mock/express.d.ts +10 -10
- package/dist/mock/index.d.ts +117 -84
- package/dist/mock/index.js +644 -9
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/kit.d.ts +2 -0
- package/dist/mock/llm.d.ts +4 -43
- package/dist/mock/logger.d.ts +5 -0
- package/dist/mock/matchers/toBeMockFunction.matcher.d.ts +2 -10
- package/dist/mock/mock/aws.d.ts +5 -7
- package/dist/mock/mock/core.d.ts +13 -13
- package/dist/mock/mock/datadog.d.ts +4 -4
- package/dist/mock/mock/express.d.ts +10 -10
- package/dist/mock/mock/index.d.ts +4 -2
- package/dist/mock/mock/kit.d.ts +2 -0
- package/dist/mock/mock/llm.d.ts +4 -43
- package/dist/mock/mock/logger.d.ts +5 -0
- package/dist/mock/mock/mongoose.d.ts +3 -3
- package/dist/mock/mock/original.d.ts +4 -0
- package/dist/mock/mock/textract.d.ts +2 -2
- package/dist/mock/mock/utils.d.ts +6 -5
- package/dist/mock/mongoose.d.ts +3 -3
- package/dist/mock/original.d.ts +4 -0
- package/dist/mock/textract.d.ts +2 -2
- package/dist/mock/utils.d.ts +6 -5
- package/package.json +5 -3
package/dist/mock/mock/llm.d.ts
CHANGED
|
@@ -1,51 +1,12 @@
|
|
|
1
1
|
import * as original from "@jaypie/llm";
|
|
2
2
|
export declare const LLM: typeof original.LLM;
|
|
3
3
|
export declare const Llm: import("vitest").Mock<(...args: any[]) => any> & {
|
|
4
|
-
operate: (...args:
|
|
5
|
-
|
|
6
|
-
content: string;
|
|
7
|
-
role: string;
|
|
8
|
-
type: string;
|
|
9
|
-
id?: undefined;
|
|
10
|
-
status?: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
id: string;
|
|
13
|
-
type: string;
|
|
14
|
-
status: string;
|
|
15
|
-
content: string;
|
|
16
|
-
role: string;
|
|
17
|
-
})[];
|
|
18
|
-
model: string;
|
|
19
|
-
output: {
|
|
20
|
-
id: string;
|
|
21
|
-
type: string;
|
|
22
|
-
status: string;
|
|
23
|
-
content: string;
|
|
24
|
-
role: string;
|
|
25
|
-
}[];
|
|
26
|
-
provider: string;
|
|
27
|
-
responses: {
|
|
28
|
-
id: string;
|
|
29
|
-
object: string;
|
|
30
|
-
created_at: number;
|
|
31
|
-
status: string;
|
|
32
|
-
error: null;
|
|
33
|
-
output_text: string;
|
|
34
|
-
}[];
|
|
35
|
-
status: string;
|
|
36
|
-
usage: {
|
|
37
|
-
input: number;
|
|
38
|
-
output: number;
|
|
39
|
-
reasoning: number;
|
|
40
|
-
total: number;
|
|
41
|
-
provider: string;
|
|
42
|
-
model: string;
|
|
43
|
-
}[];
|
|
44
|
-
content: string;
|
|
45
|
-
}>;
|
|
46
|
-
send: (...args: unknown[]) => Promise<string>;
|
|
4
|
+
operate: import("vitest").Mock<(...args: any[]) => any>;
|
|
5
|
+
send: import("vitest").Mock<(...args: any[]) => any>;
|
|
47
6
|
};
|
|
48
7
|
export declare const Toolkit: typeof original.Toolkit;
|
|
49
8
|
export declare const JaypieToolkit: typeof original.JaypieToolkit;
|
|
9
|
+
export declare const LlmMessageRole: typeof original.LlmMessageRole;
|
|
10
|
+
export declare const LlmMessageType: typeof original.LlmMessageType;
|
|
50
11
|
export declare const toolkit: original.JaypieToolkit;
|
|
51
12
|
export declare const tools: Omit<original.LlmTool, "call">[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const connect: (...args:
|
|
2
|
-
export declare const connectFromSecretEnv: (...args:
|
|
3
|
-
export declare const disconnect: (...args:
|
|
1
|
+
export declare const connect: import("vitest").Mock<(...args: any[]) => any>;
|
|
2
|
+
export declare const connectFromSecretEnv: import("vitest").Mock<(...args: any[]) => any>;
|
|
3
|
+
export declare const disconnect: import("vitest").Mock<(...args: any[]) => any>;
|
|
4
4
|
export { mongoose } from "@jaypie/mongoose";
|
|
@@ -2,8 +2,10 @@ import * as aws from "@jaypie/aws";
|
|
|
2
2
|
import * as core from "@jaypie/core";
|
|
3
3
|
import * as datadog from "@jaypie/datadog";
|
|
4
4
|
import * as express from "@jaypie/express";
|
|
5
|
+
import * as kit from "@jaypie/kit";
|
|
5
6
|
import * as lambda from "@jaypie/lambda";
|
|
6
7
|
import * as llm from "@jaypie/llm";
|
|
8
|
+
import * as logger from "@jaypie/logger";
|
|
7
9
|
import * as mongoose from "@jaypie/mongoose";
|
|
8
10
|
import * as textract from "@jaypie/textract";
|
|
9
11
|
export declare const original: {
|
|
@@ -11,8 +13,10 @@ export declare const original: {
|
|
|
11
13
|
core: typeof core;
|
|
12
14
|
datadog: typeof datadog;
|
|
13
15
|
express: typeof express;
|
|
16
|
+
kit: typeof kit;
|
|
14
17
|
lambda: typeof lambda;
|
|
15
18
|
llm: typeof llm;
|
|
19
|
+
logger: typeof logger;
|
|
16
20
|
mongoose: typeof mongoose;
|
|
17
21
|
textract: typeof textract;
|
|
18
22
|
};
|
|
@@ -6,9 +6,9 @@ export declare const MarkdownPage: typeof original.MarkdownPage;
|
|
|
6
6
|
/**
|
|
7
7
|
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
8
8
|
*/
|
|
9
|
-
export declare const textractJsonToMarkdown: (...args:
|
|
9
|
+
export declare const textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
|
|
10
10
|
declare const _default: {
|
|
11
11
|
MarkdownPage: typeof original.MarkdownPage;
|
|
12
|
-
textractJsonToMarkdown: (...args:
|
|
12
|
+
textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
1
2
|
import { LlmTool } from "@jaypie/llm";
|
|
2
3
|
/**
|
|
3
4
|
* Creates function mocks with proper typing
|
|
@@ -10,21 +11,21 @@ declare function createMockFunction<T extends (...args: any[]) => any>(implement
|
|
|
10
11
|
* Creates a mock function that resolves to a value when awaited
|
|
11
12
|
* Internal utility to create async mock functions
|
|
12
13
|
*/
|
|
13
|
-
declare function createMockResolvedFunction<T>(value: T):
|
|
14
|
+
declare function createMockResolvedFunction<T>(value: T): ReturnType<typeof vi.fn>;
|
|
14
15
|
/**
|
|
15
16
|
* Creates a mock function that returns a value
|
|
16
17
|
* Internal utility to create mock functions that return a value
|
|
17
18
|
*/
|
|
18
|
-
declare function createMockReturnedFunction<T>(value: T):
|
|
19
|
+
declare function createMockReturnedFunction<T>(value: T): ReturnType<typeof vi.fn>;
|
|
19
20
|
/**
|
|
20
21
|
* Creates a mock function that wraps another function
|
|
21
22
|
* Internal utility to create mock functions that wrap another function
|
|
22
23
|
*/
|
|
23
|
-
declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
|
|
24
|
+
declare function createMockWrappedFunction<T = any>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
|
|
24
25
|
fallback?: any;
|
|
25
26
|
throws?: boolean;
|
|
26
27
|
class?: boolean;
|
|
27
|
-
}):
|
|
28
|
+
}): ReturnType<typeof vi.fn>;
|
|
28
29
|
declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
|
|
29
30
|
fallback?: any;
|
|
30
31
|
throws?: boolean;
|
|
@@ -46,5 +47,5 @@ declare class MockNotFoundError extends Error {
|
|
|
46
47
|
* @param callOrOptions - Call function or options object (when first param is string)
|
|
47
48
|
* @returns Mock LlmTool object
|
|
48
49
|
*/
|
|
49
|
-
declare function createMockTool(nameOrCallOrOptions
|
|
50
|
+
declare function createMockTool(nameOrCallOrOptions?: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
|
|
50
51
|
export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
|
package/dist/mock/mongoose.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const connect: (...args:
|
|
2
|
-
export declare const connectFromSecretEnv: (...args:
|
|
3
|
-
export declare const disconnect: (...args:
|
|
1
|
+
export declare const connect: import("vitest").Mock<(...args: any[]) => any>;
|
|
2
|
+
export declare const connectFromSecretEnv: import("vitest").Mock<(...args: any[]) => any>;
|
|
3
|
+
export declare const disconnect: import("vitest").Mock<(...args: any[]) => any>;
|
|
4
4
|
export { mongoose } from "@jaypie/mongoose";
|
package/dist/mock/original.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import * as aws from "@jaypie/aws";
|
|
|
2
2
|
import * as core from "@jaypie/core";
|
|
3
3
|
import * as datadog from "@jaypie/datadog";
|
|
4
4
|
import * as express from "@jaypie/express";
|
|
5
|
+
import * as kit from "@jaypie/kit";
|
|
5
6
|
import * as lambda from "@jaypie/lambda";
|
|
6
7
|
import * as llm from "@jaypie/llm";
|
|
8
|
+
import * as logger from "@jaypie/logger";
|
|
7
9
|
import * as mongoose from "@jaypie/mongoose";
|
|
8
10
|
import * as textract from "@jaypie/textract";
|
|
9
11
|
export declare const original: {
|
|
@@ -11,8 +13,10 @@ export declare const original: {
|
|
|
11
13
|
core: typeof core;
|
|
12
14
|
datadog: typeof datadog;
|
|
13
15
|
express: typeof express;
|
|
16
|
+
kit: typeof kit;
|
|
14
17
|
lambda: typeof lambda;
|
|
15
18
|
llm: typeof llm;
|
|
19
|
+
logger: typeof logger;
|
|
16
20
|
mongoose: typeof mongoose;
|
|
17
21
|
textract: typeof textract;
|
|
18
22
|
};
|
package/dist/mock/textract.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export declare const MarkdownPage: typeof original.MarkdownPage;
|
|
|
6
6
|
/**
|
|
7
7
|
* Mock for textractJsonToMarkdown function from @jaypie/textract
|
|
8
8
|
*/
|
|
9
|
-
export declare const textractJsonToMarkdown: (...args:
|
|
9
|
+
export declare const textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
|
|
10
10
|
declare const _default: {
|
|
11
11
|
MarkdownPage: typeof original.MarkdownPage;
|
|
12
|
-
textractJsonToMarkdown: (...args:
|
|
12
|
+
textractJsonToMarkdown: import("vitest").Mock<(...args: any[]) => any>;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
package/dist/mock/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
1
2
|
import { LlmTool } from "@jaypie/llm";
|
|
2
3
|
/**
|
|
3
4
|
* Creates function mocks with proper typing
|
|
@@ -10,21 +11,21 @@ declare function createMockFunction<T extends (...args: any[]) => any>(implement
|
|
|
10
11
|
* Creates a mock function that resolves to a value when awaited
|
|
11
12
|
* Internal utility to create async mock functions
|
|
12
13
|
*/
|
|
13
|
-
declare function createMockResolvedFunction<T>(value: T):
|
|
14
|
+
declare function createMockResolvedFunction<T>(value: T): ReturnType<typeof vi.fn>;
|
|
14
15
|
/**
|
|
15
16
|
* Creates a mock function that returns a value
|
|
16
17
|
* Internal utility to create mock functions that return a value
|
|
17
18
|
*/
|
|
18
|
-
declare function createMockReturnedFunction<T>(value: T):
|
|
19
|
+
declare function createMockReturnedFunction<T>(value: T): ReturnType<typeof vi.fn>;
|
|
19
20
|
/**
|
|
20
21
|
* Creates a mock function that wraps another function
|
|
21
22
|
* Internal utility to create mock functions that wrap another function
|
|
22
23
|
*/
|
|
23
|
-
declare function createMockWrappedFunction<T>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
|
|
24
|
+
declare function createMockWrappedFunction<T = any>(fn: (...args: unknown[]) => unknown, fallbackOrOptions?: any | {
|
|
24
25
|
fallback?: any;
|
|
25
26
|
throws?: boolean;
|
|
26
27
|
class?: boolean;
|
|
27
|
-
}):
|
|
28
|
+
}): ReturnType<typeof vi.fn>;
|
|
28
29
|
declare function createMockWrappedObject<T extends Record<string, any>>(object: T, fallbackOrOptions?: any | {
|
|
29
30
|
fallback?: any;
|
|
30
31
|
throws?: boolean;
|
|
@@ -46,5 +47,5 @@ declare class MockNotFoundError extends Error {
|
|
|
46
47
|
* @param callOrOptions - Call function or options object (when first param is string)
|
|
47
48
|
* @returns Mock LlmTool object
|
|
48
49
|
*/
|
|
49
|
-
declare function createMockTool(nameOrCallOrOptions
|
|
50
|
+
declare function createMockTool(nameOrCallOrOptions?: string | ((...args: any[]) => any) | Partial<LlmTool>, callOrOptions?: ((...args: any[]) => any) | Partial<LlmTool>): LlmTool;
|
|
50
51
|
export { createMockFunction, createMockResolvedFunction, createMockReturnedFunction, createMockWrappedFunction, createMockWrappedObject, MockValidationError, MockNotFoundError, createMockError, createMockTool, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/testkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.35",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Finlayson Studio",
|
|
6
6
|
"type": "module",
|
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
"@jaypie/core": "^1.1.11",
|
|
34
34
|
"@jaypie/datadog": "^1.1.2",
|
|
35
35
|
"@jaypie/express": "^1.1.11",
|
|
36
|
+
"@jaypie/kit": "^1.1.0",
|
|
36
37
|
"@jaypie/lambda": "^1.1.4",
|
|
37
38
|
"@jaypie/llm": "^1.1.21",
|
|
39
|
+
"@jaypie/logger": "^1.1.0",
|
|
38
40
|
"@jaypie/mongoose": "^1.1.1",
|
|
39
41
|
"@jaypie/textract": "^0.2.4",
|
|
40
|
-
"jaypie": "^1.1.
|
|
42
|
+
"jaypie": "^1.1.71",
|
|
41
43
|
"jest-extended": "^4.0.2",
|
|
42
44
|
"jest-json-schema": "^6.1.0",
|
|
43
45
|
"uuid": "^11.0.5"
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
"publishConfig": {
|
|
62
64
|
"access": "public"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b5c6bfda6c1fd0a9e8c0e2c648f1240390c2321d"
|
|
65
67
|
}
|