Skip to content

Commit

Permalink
Skip some incompatible tests in Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Sep 26, 2024
1 parent 21d0ea1 commit 81bf08e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions test/browser/finders/chrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ afterEach(() => {
jest.restoreAllMocks()
})

const itExceptWin = process.platform === 'win32' ? it.skip : it

const executableMock = (name: string) =>
path.join(__dirname, `../../utils/_executable_mocks`, name)

Expand Down Expand Up @@ -52,11 +54,14 @@ describe('Chrome finder', () => {
})
})

it('processes regular resolution if CHROME_PATH is not executable', async () => {
process.env.CHROME_PATH = executableMock('non-executable')
itExceptWin(
'processes regular resolution if CHROME_PATH is not executable',
async () => {
process.env.CHROME_PATH = executableMock('non-executable')

await expect(chromeFinder({})).rejects.toThrow(regularResolution)
})
await expect(chromeFinder({})).rejects.toThrow(regularResolution)
}
)

it('processes regular resolution if CHROME_PATH is not found', async () => {
process.env.CHROME_PATH = executableMock('not-found')
Expand Down
13 changes: 9 additions & 4 deletions test/browser/finders/firefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const winFxNightlyAlt = ['Firefox Nightly', 'firefox.exe']
const winFxDev = ['Firefox Developer Edition', 'firefox.exe']
const winFx = ['Mozilla Firefox', 'firefox.exe']

const itExceptWin = process.platform === 'win32' ? it.skip : it

const executableMock = (name: string) =>
path.join(__dirname, `../../utils/_executable_mocks`, name)

Expand Down Expand Up @@ -60,11 +62,14 @@ describe('Firefox finder', () => {
})
})

it('processes regular resolution if FIREFOX_PATH is not executable', async () => {
process.env.FIREFOX_PATH = executableMock('non-executable')
itExceptWin(
'processes regular resolution if FIREFOX_PATH is not executable',
async () => {
process.env.FIREFOX_PATH = executableMock('non-executable')

await expect(firefoxFinder({})).rejects.toThrow(regularResolution)
})
await expect(firefoxFinder({})).rejects.toThrow(regularResolution)
}
)

it('processes regular resolution if FIREFOX_PATH is not found', async () => {
process.env.FIREFOX_PATH = executableMock('not-found')
Expand Down

0 comments on commit 81bf08e

Please sign in to comment.