mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2025-12-09 14:30:42 -07:00
update dev dependencies and workflow (#168)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -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']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user