@aigne/test-utils 0.5.1 → 0.5.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.3](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.2...test-utils-v0.5.3) (2025-07-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **model:** ensure last message is not system role for gemini ([#231](https://github.com/AIGNE-io/aigne-framework/issues/231)) ([1b72e1e](https://github.com/AIGNE-io/aigne-framework/commit/1b72e1e6be98060aa32e68585142b2eea401d109))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.32.1
16
+
17
+ ## [0.5.2](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.1...test-utils-v0.5.2) (2025-07-08)
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * dependencies
24
+ * @aigne/core bumped to 1.32.0
25
+
3
26
  ## [0.5.1](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.0...test-utils-v0.5.1) (2025-07-04)
4
27
 
5
28
 
@@ -3,7 +3,5 @@ export interface TestConfig {
3
3
  scriptPath?: string;
4
4
  }
5
5
  export declare function runExampleTest(config?: TestConfig): Promise<{
6
- stdout: string;
7
- stderr: string;
8
- code: number | null;
6
+ status: number | null;
9
7
  }>;
@@ -1,30 +1,12 @@
1
- import { spawn } from "node:child_process";
1
+ import { spawnSync } from "node:child_process";
2
2
  import { join } from "node:path";
3
- export function runExampleTest(config) {
3
+ export async function runExampleTest(config) {
4
4
  const scriptPath = config?.scriptPath ?? join(process.cwd(), "index.ts");
5
- return new Promise((resolve, reject) => {
6
- const child = spawn("bun", [scriptPath], {
7
- stdio: ["inherit", "pipe", "pipe"],
8
- env: {
9
- ...process.env,
10
- INITIAL_CALL: config?.initialCall ?? process.env.INITIAL_CALL,
11
- },
12
- });
13
- let stdout = "";
14
- let stderr = "";
15
- child.stdout.on("data", (data) => {
16
- // GitHub Action runner is not a TTY, avoid writing to stdout to prevent long ANSI output. https://github.com/actions/runner/issues/241
17
- stdout += data;
18
- });
19
- child.stderr.on("data", (data) => {
20
- process.stderr.write(data);
21
- stderr += data;
22
- });
23
- child.on("close", (code) => {
24
- resolve({ stdout, stderr, code });
25
- });
26
- child.on("error", (err) => {
27
- reject(err);
28
- });
5
+ return spawnSync("bun", [scriptPath], {
6
+ stdio: ["inherit", "inherit", "inherit"],
7
+ env: {
8
+ ...process.env,
9
+ INITIAL_CALL: config?.initialCall ?? process.env.INITIAL_CALL,
10
+ },
29
11
  });
30
12
  }
@@ -1,7 +1,7 @@
1
1
  import { type ChatModelInputResponseFormat, type ChatModelInputTool, type ChatModelOutputToolCall, type Message } from "@aigne/core";
2
2
  export declare const COMMON_TOOLS: ChatModelInputTool[];
3
3
  export declare const COMMON_RESPONSE_FORMAT: ChatModelInputResponseFormat;
4
- export declare const createWeatherToolMessages: () => import("@aigne/core").ChatModelInputMessage[];
4
+ export declare const createWeatherToolMessages: () => Promise<import("@aigne/core").ChatModelInputMessage[]>;
5
5
  export declare const createWeatherToolExpected: () => any;
6
- export declare const createWeatherToolCallMessages: () => import("@aigne/core").ChatModelInputMessage[];
6
+ export declare const createWeatherToolCallMessages: () => Promise<import("@aigne/core").ChatModelInputMessage[]>;
7
7
  export declare function createToolCallResponse(functionName: string, args: Message): ChatModelOutputToolCall;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/test-utils",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Test utils for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@aigne/core": "^1.31.0"
27
+ "@aigne/core": "^1.32.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/bun": "^1.2.17",
@@ -1,4 +1,4 @@
1
- import { spawn } from "node:child_process";
1
+ import { spawnSync } from "node:child_process";
2
2
  import { join } from "node:path";
3
3
 
4
4
  export interface TestConfig {
@@ -6,38 +6,14 @@ export interface TestConfig {
6
6
  scriptPath?: string;
7
7
  }
8
8
 
9
- export function runExampleTest(
10
- config?: TestConfig,
11
- ): Promise<{ stdout: string; stderr: string; code: number | null }> {
9
+ export async function runExampleTest(config?: TestConfig): Promise<{ status: number | null }> {
12
10
  const scriptPath = config?.scriptPath ?? join(process.cwd(), "index.ts");
13
- return new Promise((resolve, reject) => {
14
- const child = spawn("bun", [scriptPath], {
15
- stdio: ["inherit", "pipe", "pipe"],
16
- env: {
17
- ...process.env,
18
- INITIAL_CALL: config?.initialCall ?? process.env.INITIAL_CALL,
19
- },
20
- });
21
11
 
22
- let stdout = "";
23
- let stderr = "";
24
-
25
- child.stdout.on("data", (data) => {
26
- // GitHub Action runner is not a TTY, avoid writing to stdout to prevent long ANSI output. https://github.com/actions/runner/issues/241
27
- stdout += data;
28
- });
29
-
30
- child.stderr.on("data", (data) => {
31
- process.stderr.write(data);
32
- stderr += data;
33
- });
34
-
35
- child.on("close", (code) => {
36
- resolve({ stdout, stderr, code });
37
- });
38
-
39
- child.on("error", (err) => {
40
- reject(err);
41
- });
12
+ return spawnSync("bun", [scriptPath], {
13
+ stdio: ["inherit", "inherit", "inherit"],
14
+ env: {
15
+ ...process.env,
16
+ INITIAL_CALL: config?.initialCall ?? process.env.INITIAL_CALL,
17
+ },
42
18
  });
43
19
  }