Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build:clean": "rimraf ./lib",
"build": "npm-run-all build:clean check compile",
"build:watch": "tsup-node --watch",
"test": "node --import tsx --test ./tests/**/*_test.ts ./tests/*_test.ts",
"test": "node --import tsx --test --test-force-exit ./tests/**/*_test.ts ./tests/*_test.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The --test-force-exit flag was introduced in Node.js v22.10.0. Since this repository supports Node.js >=20, running tests on Node.js 20 or older Node.js 22 versions will fail with a bad option: --test-force-exit error. It is highly recommended to resolve the underlying resource leaks (such as unclosed servers, active timers, or open handles) instead of forcing the process to exit, to ensure compatibility across all supported Node.js versions.

"test:watch": "node --watch --import tsx --test ./tests/**/*_test.ts ./tests/*_test.ts",
"test:single": "node --import tsx --test"
},
Expand Down
14 changes: 7 additions & 7 deletions js/plugins/google-cloud/tests/metrics_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('GoogleCloudMetrics', () => {
return explode();
});

assert.rejects(async () => {
await assert.rejects(async () => {
await testFlow();
});

Expand Down Expand Up @@ -242,7 +242,7 @@ describe('GoogleCloudMetrics', () => {
return explode();
});

assert.rejects(async () => {
await assert.rejects(async () => {
return ai.generate({
model: testModel,
prompt: 'test prompt',
Expand Down Expand Up @@ -344,7 +344,7 @@ describe('GoogleCloudMetrics', () => {
return Promise.reject(new Error('failed'));
});

assert.rejects(async () => {
await assert.rejects(async () => {
await flow();
});

Expand Down Expand Up @@ -379,7 +379,7 @@ describe('GoogleCloudMetrics', () => {
return 'done';
});

assert.rejects(async () => {
await assert.rejects(async () => {
await flow();
});

Expand Down Expand Up @@ -424,7 +424,7 @@ describe('GoogleCloudMetrics', () => {
return 'done';
});

assert.rejects(async () => {
await assert.rejects(async () => {
await flow();
});

Expand Down Expand Up @@ -463,7 +463,7 @@ describe('GoogleCloudMetrics', () => {
return 'done';
});

assert.rejects(async () => {
await assert.rejects(async () => {
await flow();
});

Expand Down Expand Up @@ -504,7 +504,7 @@ describe('GoogleCloudMetrics', () => {
return 'not failing';
});

assert.rejects(async () => {
await assert.rejects(async () => {
await flow();
});

Expand Down
2 changes: 1 addition & 1 deletion js/plugins/vercel-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"build:clean": "rimraf ./lib",
"build": "npm-run-all build:clean check compile",
"build:watch": "tsup-node --watch",
"test": "tsx --test ./tests/*_test.ts"
"test": "tsx --test --test-force-exit ./tests/*_test.ts"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The --test-force-exit flag was introduced in Node.js v22.10.0. Since this package specifies "engines": { "node": ">=20" }, running tests on Node.js 20 or older Node.js 22 versions will fail with a bad option: --test-force-exit error. Consider identifying and cleaning up the active handles (such as unclosed servers or active timers) causing the tests to hang, rather than using this flag.

},
"peerDependencies": {
"@ai-sdk/react": "^3.0.0",
Expand Down
Loading