Actually update tests

This commit is contained in:
Tom Hu
2021-03-08 19:25:23 -05:00
parent 227f879cd0
commit 21a1e2948d
2 changed files with 9 additions and 4 deletions

View File

@@ -1,8 +1,11 @@
import buildExec from './buildExec';
const github = require('@actions/github');
const context = github.context;
test('no arguments', () => {
const {execArgs, filepath, failCi} = buildExec();
expect(execArgs.slice(0, -2)).toEqual([
args = [
'codecov.sh',
'-n',
'',
@@ -10,7 +13,11 @@ test('no arguments', () => {
'',
'-Q',
'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(failCi).toBeFalsy();
});

View File

@@ -71,8 +71,6 @@ const buildExec = () => {
}
}
console.log(context);
if (token) {
options.env.CODECOV_TOKEN = token;
}