@aigne/test-utils 0.5.2 → 0.5.4

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.4](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.3...test-utils-v0.5.4) (2025-07-09)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * The following workspace dependencies were updated
9
+ * dependencies
10
+ * @aigne/core bumped to 1.32.2
11
+
12
+ ## [0.5.3](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.2...test-utils-v0.5.3) (2025-07-09)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **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))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * dependencies
24
+ * @aigne/core bumped to 1.32.1
25
+
3
26
  ## [0.5.2](https://github.com/AIGNE-io/aigne-framework/compare/test-utils-v0.5.1...test-utils-v0.5.2) (2025-07-08)
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/test-utils",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
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.32.0"
27
+ "@aigne/core": "^1.32.2"
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
  }