mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08:00
Actually update tests
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user