mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-15 23:41:45 +00:00
Test functionality
This commit is contained in:
parent
eb38f6167e
commit
37c776c131
1 changed files with 75 additions and 0 deletions
|
|
@ -122,3 +122,78 @@ test('all arguments', () => {
|
||||||
delete process.env['INPUT_' + env.toUpperCase()];
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('trim arguments after splitting them', () => {
|
||||||
|
const baseExpectation = [
|
||||||
|
'-n',
|
||||||
|
expect.stringContaining(''),
|
||||||
|
'-Q',
|
||||||
|
expect.stringContaining('github-action'),
|
||||||
|
];
|
||||||
|
|
||||||
|
test('files', () => {
|
||||||
|
const envs = { 'files': './client-coverage.txt, ./lcov.info' };
|
||||||
|
|
||||||
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {execArgs} = buildExec();
|
||||||
|
|
||||||
|
expect(execArgs).toEqual([
|
||||||
|
...baseExpectation,
|
||||||
|
'-f',
|
||||||
|
'./client-coverage.txt',
|
||||||
|
'-f',
|
||||||
|
'./lcov.info',
|
||||||
|
]);
|
||||||
|
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('flags', () => {
|
||||||
|
const envs = { 'flags': 'ios, mobile' };
|
||||||
|
|
||||||
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {execArgs} = buildExec();
|
||||||
|
|
||||||
|
expect(execArgs).toEqual([
|
||||||
|
...baseExpectation,
|
||||||
|
'-F',
|
||||||
|
'ios',
|
||||||
|
'-F',
|
||||||
|
'mobile',
|
||||||
|
]);
|
||||||
|
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('functionalities', () => {
|
||||||
|
const envs = { 'functionalities': 'network, gcov' };
|
||||||
|
|
||||||
|
for (const [name, value] of Object.entries(envs)) {
|
||||||
|
process.env['INPUT_' + name.toUpperCase()] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {execArgs} = buildExec();
|
||||||
|
|
||||||
|
expect(execArgs).toEqual([
|
||||||
|
...baseExpectation,
|
||||||
|
'-X',
|
||||||
|
'network',
|
||||||
|
'-X',
|
||||||
|
'gcov',
|
||||||
|
]);
|
||||||
|
|
||||||
|
for (const env of Object.keys(envs)) {
|
||||||
|
delete process.env['INPUT_' + env.toUpperCase()];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue