mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-14 23:17:25 +00:00
Actually update tests
This commit is contained in:
parent
227f879cd0
commit
21a1e2948d
2 changed files with 9 additions and 4 deletions
|
|
@ -1,8 +1,11 @@
|
||||||
import buildExec from './buildExec';
|
import buildExec from './buildExec';
|
||||||
|
const github = require('@actions/github');
|
||||||
|
const context = github.context;
|
||||||
|
|
||||||
test('no arguments', () => {
|
test('no arguments', () => {
|
||||||
const {execArgs, filepath, failCi} = buildExec();
|
const {execArgs, filepath, failCi} = buildExec();
|
||||||
expect(execArgs.slice(0, -2)).toEqual([
|
|
||||||
|
args = [
|
||||||
'codecov.sh',
|
'codecov.sh',
|
||||||
'-n',
|
'-n',
|
||||||
'',
|
'',
|
||||||
|
|
@ -10,7 +13,11 @@ test('no arguments', () => {
|
||||||
'',
|
'',
|
||||||
'-Q',
|
'-Q',
|
||||||
'github-action',
|
'github-action',
|
||||||
]);
|
];
|
||||||
|
if (context.eventName == 'pull_request') {
|
||||||
|
args.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
}
|
||||||
|
expect(execArgs).toEqual(args);
|
||||||
expect(filepath).toEqual('codecov.sh');
|
expect(filepath).toEqual('codecov.sh');
|
||||||
expect(failCi).toBeFalsy();
|
expect(failCi).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,6 @@ const buildExec = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(context);
|
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
options.env.CODECOV_TOKEN = token;
|
options.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue