Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantsure authored Nov 14, 2022
1 parent 5548416 commit 1ddac5e
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions packages/cache/__tests__/tar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ test('zstd extract tar', async () => {
? `${process.env['windir']}\\fakepath\\cache.tar`
: 'cache.tar'
const workspace = process.env['GITHUB_WORKSPACE']
const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath

await tar.extractTar(archivePath, CompressionMethod.Zstd)

Expand Down Expand Up @@ -82,9 +80,7 @@ test('gzip extract tar', async () => {
await tar.extractTar(archivePath, CompressionMethod.Gzip)

expect(mkdirMock).toHaveBeenCalledWith(workspace)
const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath
expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
`"${tarPath}"`,
Expand Down Expand Up @@ -144,9 +140,7 @@ test('zstd create tar', async () => {

await tar.createTar(archiveFolder, sourceDirectories, CompressionMethod.Zstd)

const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath

expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
Expand Down Expand Up @@ -184,9 +178,7 @@ test('gzip create tar', async () => {

await tar.createTar(archiveFolder, sourceDirectories, CompressionMethod.Gzip)

const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath

expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
Expand Down Expand Up @@ -221,9 +213,7 @@ test('zstd list tar', async () => {

await tar.listTar(archivePath, CompressionMethod.Zstd)

const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath
expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
`"${tarPath}"`,
Expand All @@ -249,9 +239,7 @@ test('zstdWithoutLong list tar', async () => {

await tar.listTar(archivePath, CompressionMethod.ZstdWithoutLong)

const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath
expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
`"${tarPath}"`,
Expand All @@ -276,9 +264,7 @@ test('gzip list tar', async () => {

await tar.listTar(archivePath, CompressionMethod.Gzip)

const tarPath = IS_WINDOWS
? windowsGnuTar
: defaultTarPath
const tarPath = IS_WINDOWS ? windowsGnuTar : defaultTarPath
expect(execMock).toHaveBeenCalledTimes(1)
expect(execMock).toHaveBeenCalledWith(
`"${tarPath}"`,
Expand Down

0 comments on commit 1ddac5e

Please sign in to comment.