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']);
});
});