Skip to content

Commit 3ba8ef7

Browse files
committed
fix chunk test for windows
1 parent 69f13e6 commit 3ba8ef7

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed
+23-23
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import { shouldChunk } from "../../../indexing/chunk/chunk";
21
import path from "path";
2+
import { shouldChunk } from "../../../indexing/chunk/chunk";
33

44
describe("shouldChunk", () => {
5-
test("should chunk a typescript file", () => {
6-
const filePath = "directory/file.ts";
7-
const fileContent = generateString(10000);
8-
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(true);
9-
});
5+
test("should chunk a typescript file", () => {
6+
const filePath = path.join("directory", "file.ts");
7+
const fileContent = generateString(10000);
8+
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(true);
9+
});
1010

11-
test("should not chunk a large typescript file", () => {
12-
const filePath = "directory/file.ts";
13-
const fileContent = generateString(1500000);
14-
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
15-
});
11+
test("should not chunk a large typescript file", () => {
12+
const filePath = path.join("directory", "file.ts");
13+
const fileContent = generateString(1500000);
14+
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
15+
});
1616

17-
test("should not chunk an empty file", () => {
18-
const filePath = "directory/file.ts";
19-
const fileContent = generateString(0);
20-
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
21-
});
17+
test("should not chunk an empty file", () => {
18+
const filePath = path.join("directory", "file.ts");
19+
const fileContent = generateString(0);
20+
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
21+
});
2222

23-
test("should not chunk a file without extension", () => {
24-
const filePath = "directory/with.dot/filename";
25-
const fileContent = generateString(10000);
26-
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
27-
});
23+
test("should not chunk a file without extension", () => {
24+
const filePath = path.join("directory", "with.dot", "filename");
25+
const fileContent = generateString(10000);
26+
expect(shouldChunk(path.sep, filePath, fileContent)).toBe(false);
27+
});
2828
});
2929

3030
function generateString(length: number) {
31-
return "a".repeat(length);
32-
}
31+
return "a".repeat(length);
32+
}

0 commit comments

Comments
 (0)