update dev dependencies and workflow (#168)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-04-24 20:30:15 +02:00
committed by GitHub
parent 3ebfd4c3ac
commit b7511689c6
21 changed files with 2219 additions and 11198 deletions

View File

@@ -1,3 +1,4 @@
import {describe, expect, it} from '@jest/globals';
import * as context from '../src/context';
import * as core from '@actions/core';
import * as path from 'path';
@@ -6,63 +7,54 @@ describe('getInputList', () => {
it('handles single line correctly', async () => {
await setInput('foo', 'bar');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar']);
});
it('handles multiple lines correctly', async () => {
setInput('foo', 'bar\nbaz');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz']);
});
it('remove empty lines correctly', async () => {
setInput('foo', 'bar\n\nbaz');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz']);
});
it('handles comma correctly', async () => {
setInput('foo', 'bar,baz');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz']);
});
it('remove empty result correctly', async () => {
setInput('foo', 'bar,baz,');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz']);
});
it('handles different new lines correctly', async () => {
setInput('foo', 'bar\r\nbaz');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz']);
});
it('handles different new lines and comma correctly', async () => {
setInput('foo', 'bar\r\nbaz,bat');
const res = await context.getInputList(core.getInput('foo'));
console.log(res);
expect(res).toEqual(['bar', 'baz', 'bat']);
});
it('handles multiple lines and ignoring comma correctly', async () => {
setInput('files', './bin/binary.exe\n./bin/binary2.exe');
const res = await context.getInputList(core.getInput('files'), true);
console.log(res);
expect(res).toEqual(['./bin/binary.exe', './bin/binary2.exe']);
});
it('handles different new lines and ignoring comma correctly', async () => {
setInput('driver-opts', './bin/binary.exe\r\n./bin/binary2.exe');
const res = await context.getInputList(core.getInput('files'), true);
console.log(res);
expect(res).toEqual(['./bin/binary.exe', './bin/binary2.exe']);
});
});

View File

@@ -1,16 +1,15 @@
import {describe, expect, it} from '@jest/globals';
import * as github from '../src/github';
describe('github', () => {
it('returns latest UPX GitHub release', async () => {
const release = await github.getRelease('latest');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v3.96 GoReleaser GitHub release', async () => {
const release = await github.getRelease('v3.96');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v3.96');
});

View File

@@ -1,16 +1,15 @@
import fs = require('fs');
import {describe, expect, it} from '@jest/globals';
import * as fs from 'fs';
import * as installer from '../src/installer';
describe('installer', () => {
it('acquires v3.95 version of UPX', async () => {
const upx = await installer.getUPX('v3.95');
console.log(upx);
expect(fs.existsSync(upx)).toBe(true);
}, 100000);
it('acquires latest version of UPX', async () => {
const upx = await installer.getUPX('latest');
console.log(upx);
expect(fs.existsSync(upx)).toBe(true);
}, 100000);
});