From 3ba8ef7fcb178599db18d5c3af17c4671d169eb8 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 9 Aug 2024 23:08:01 -0400 Subject: [PATCH] fix chunk test for windows --- core/test/indexing/chunk/chunk.test.ts | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/core/test/indexing/chunk/chunk.test.ts b/core/test/indexing/chunk/chunk.test.ts index 3f5130f71..e45c11c79 100644 --- a/core/test/indexing/chunk/chunk.test.ts +++ b/core/test/indexing/chunk/chunk.test.ts @@ -1,32 +1,32 @@ -import { shouldChunk } from "../../../indexing/chunk/chunk"; import path from "path"; +import { shouldChunk } from "../../../indexing/chunk/chunk"; describe("shouldChunk", () => { - test("should chunk a typescript file", () => { - const filePath = "directory/file.ts"; - const fileContent = generateString(10000); - expect(shouldChunk(path.sep, filePath, fileContent)).toBe(true); - }); + test("should chunk a typescript file", () => { + const filePath = path.join("directory", "file.ts"); + const fileContent = generateString(10000); + expect(shouldChunk(path.sep, filePath, fileContent)).toBe(true); + }); - test("should not chunk a large typescript file", () => { - const filePath = "directory/file.ts"; - const fileContent = generateString(1500000); - expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); - }); + test("should not chunk a large typescript file", () => { + const filePath = path.join("directory", "file.ts"); + const fileContent = generateString(1500000); + expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); + }); - test("should not chunk an empty file", () => { - const filePath = "directory/file.ts"; - const fileContent = generateString(0); - expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); - }); + test("should not chunk an empty file", () => { + const filePath = path.join("directory", "file.ts"); + const fileContent = generateString(0); + expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); + }); - test("should not chunk a file without extension", () => { - const filePath = "directory/with.dot/filename"; - const fileContent = generateString(10000); - expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); - }); + test("should not chunk a file without extension", () => { + const filePath = path.join("directory", "with.dot", "filename"); + const fileContent = generateString(10000); + expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false); + }); }); function generateString(length: number) { - return "a".repeat(length); -} \ No newline at end of file + return "a".repeat(length); +}