From ee05c88cc4daad27570ae4f982c3b8fb40b11d57 Mon Sep 17 00:00:00 2001 From: Takeshi Date: Thu, 15 Feb 2024 20:06:48 -0700 Subject: [PATCH] Handle windows paths --- src/utils/__test__/archive.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/__test__/archive.spec.ts b/src/utils/__test__/archive.spec.ts index ab527a0..6e40627 100644 --- a/src/utils/__test__/archive.spec.ts +++ b/src/utils/__test__/archive.spec.ts @@ -1,6 +1,7 @@ import parse from '../parse' import { getUrl } from '../archive' import { getArchivePath } from '../archive' +const isWin32 = process.platform === 'win32' describe('utils/archive', () => { describe('getUrl()', () => { @@ -40,7 +41,8 @@ describe('utils/archive', () => { describe('getArchivePath()', () => { it('should return a path to the zipped file', () => { expect(getArchivePath(parse('iwatakeshi/test'))).toEqual( - expect.stringMatching(/\.gitly\/github\/iwatakeshi\/test\/master\.tar\.gz/) + isWin32 ? expect.stringMatching(/\.gitly\\github\\iwatakeshi\\test\\master\.tar\.gz/) : + expect.stringMatching(/\.gitly\/github\/iwatakeshi\/test\/master\.tar\.gz/) ) }) })