Skip to content

Commit 9ce1fa5

Browse files
committed
test: update globalThis type assertions in test files
1 parent 65a55b3 commit 9ce1fa5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tests/documentRoute.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("Document Route", () => {
4646
db.exec(createDocumentsTableSQL("1536"));
4747

4848
// Set the global test database so the db proxy will use it
49-
globalThis.testDb = db;
49+
(globalThis as any).testDb = db;
5050
});
5151

5252
// Insert test data before each test
@@ -73,7 +73,7 @@ describe("Document Route", () => {
7373
// Clean up after all tests
7474
afterAll(() => {
7575
db.close();
76-
delete globalThis.testDb;
76+
delete (globalThis as any).testDb;
7777
});
7878

7979
test("should retrieve document by id", async () => {

tests/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("Index and Search routes", () => {
4848
db.exec(createDocumentChunksTableSQL("1536"));
4949

5050
// Set the global test database so the db proxy will use it
51-
globalThis.testDb = db;
51+
(globalThis as any).testDb = db;
5252
});
5353

5454
beforeEach(async () => {
@@ -59,7 +59,7 @@ describe("Index and Search routes", () => {
5959

6060
afterAll(() => {
6161
db.close();
62-
delete globalThis.testDb;
62+
delete (globalThis as any).testDb;
6363
});
6464

6565
test("should store short text as a single document with one chunk", async () => {

tests/indexRoute.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("Index Route", () => {
4444
db.exec(createDocumentChunksTableSQL("1536"));
4545

4646
// Set the global test database so the db proxy will use it
47-
globalThis.testDb = db;
47+
(globalThis as any).testDb = db;
4848
});
4949

5050
beforeEach(() => {
@@ -58,7 +58,7 @@ describe("Index Route", () => {
5858

5959
afterAll(() => {
6060
db.close();
61-
delete globalThis.testDb;
61+
delete (globalThis as any).testDb;
6262
});
6363

6464
test("should index document and call generateEmbeddings with correct parameters", async () => {

tests/searchRoute.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("Search Route", () => {
4444
db.exec(createDocumentChunksTableSQL("1536"));
4545

4646
// Set the global test database so the db proxy will use it
47-
globalThis.testDb = db;
47+
(globalThis as any).testDb = db;
4848
});
4949

5050
beforeEach(async () => {
@@ -84,7 +84,7 @@ describe("Search Route", () => {
8484

8585
afterAll(() => {
8686
db.close();
87-
delete globalThis.testDb;
87+
delete (globalThis as any).testDb;
8888
});
8989

9090
test("should search for indexed documents", async () => {

0 commit comments

Comments
 (0)