Skip to content

Commit 3aed7d1

Browse files
committed
Fix tests on win32 systems
1 parent f447356 commit 3aed7d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/services/checkpoints/__tests__/CheckpointService.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe("CheckpointService", () => {
1414
let git: SimpleGit
1515
let testFile: string
1616
let service: CheckpointService
17+
let originalPlatform: string
1718

1819
const initRepo = async ({
1920
baseDir,
@@ -48,6 +49,19 @@ describe("CheckpointService", () => {
4849
return { git, testFile }
4950
}
5051

52+
beforeAll(() => {
53+
originalPlatform = process.platform
54+
Object.defineProperty(process, "platform", {
55+
value: "darwin",
56+
})
57+
})
58+
59+
afterAll(() => {
60+
Object.defineProperty(process, "platform", {
61+
value: originalPlatform,
62+
})
63+
})
64+
5165
beforeEach(async () => {
5266
const baseDir = path.join(os.tmpdir(), `checkpoint-service-test-${Date.now()}`)
5367
const repo = await initRepo({ baseDir })

0 commit comments

Comments
 (0)