Skip to content

Commit f8b2776

Browse files
Copilothuangyiirene
andcommitted
Fix CI build: Add missing test dependencies and fix test isolation
- Added @types/jest, jest, ts-jest, typescript to devDependencies - Fixed disconnect test to use separate driver instance to avoid breaking subsequent tests - Ensures proper test isolation and cleanup Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent 70adce2 commit f8b2776

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

packages/drivers/sql/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"knex": "^3.1.0"
2828
},
2929
"devDependencies": {
30+
"@types/jest": "^29.0.0",
31+
"jest": "^29.0.0",
32+
"ts-jest": "^29.4.6",
33+
"typescript": "^5.0.0",
3034
"sqlite3": "^5.1.7"
3135
}
3236
}

packages/drivers/sql/test/queryast.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,18 @@ describe('SqlDriver (QueryAST Format)', () => {
7474
});
7575

7676
it('should support disconnect method', async () => {
77-
await expect(driver.disconnect()).resolves.toBeUndefined();
77+
// Create a separate driver instance for this test
78+
const testDriver = new SqlDriver({
79+
client: 'sqlite3',
80+
connection: {
81+
filename: ':memory:'
82+
},
83+
useNullAsDefault: true
84+
});
85+
86+
await expect(testDriver.disconnect()).resolves.toBeUndefined();
7887
// After disconnect, health check should fail
79-
const healthy = await driver.checkHealth();
88+
const healthy = await testDriver.checkHealth();
8089
expect(healthy).toBe(false);
8190
});
8291
});

0 commit comments

Comments
 (0)