Skip to content

Commit

Permalink
Modernize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed May 23, 2023
1 parent 8dc2532 commit 0ada37e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ beforeAll(async () => {
{cwd: tmpdir}
)
fs.chmodSync(`${tmpdir}/proxyboi-linux-amd64`, '755')
process.env['INPUT_FILE'] = `${tmpdir}/proxyboi-linux-amd64`
process.env['INPUT_FILES'] = `${tmpdir}/proxyboi-linux-amd64`
} else if (os.type() == 'Darwin') {
await exec.exec(
'curl',
Expand All @@ -28,7 +28,7 @@ beforeAll(async () => {
{cwd: tmpdir}
)
fs.chmodSync(`${tmpdir}/proxyboi-macos-amd64`, '755')
process.env['INPUT_FILE'] = `${tmpdir}/proxyboi-macos-amd64`
process.env['INPUT_FILES'] = `${tmpdir}/proxyboi-macos-amd64`
} else if (os.type() == 'Windows_NT') {
await exec.exec(
'curl',
Expand All @@ -38,13 +38,13 @@ beforeAll(async () => {
],
{cwd: tmpdir}
)
process.env['INPUT_FILE'] = `${tmpdir}/proxyboi-windows-amd64.exe`
process.env['INPUT_FILES'] = `${tmpdir}/proxyboi-windows-amd64.exe`
}
})

describe('UPX Action', () => {
it('can compress stuff', async () => {
const file_path = process.env['INPUT_FILE'] as string
const file_path = process.env['INPUT_FILES'] as string
const old_size = fs.statSync(file_path).size
await run()
const new_size = fs.statSync(file_path).size
Expand Down

0 comments on commit 0ada37e

Please sign in to comment.