mirror of
https://github.com/github/codeql-action
synced 2026-05-23 20:00:54 +03:00
Improve test coverage
This commit is contained in:
Generated
+26
-3
@@ -315,7 +315,7 @@ on:
|
||||
`));
|
||||
t.deepEqual(errors, []);
|
||||
});
|
||||
ava_1.default("validateWorkflow() should only report the first CheckoutWrongHead", (t) => {
|
||||
ava_1.default("validateWorkflow() should only report the current job's CheckoutWrongHead", (t) => {
|
||||
process.env.GITHUB_JOB = "test";
|
||||
const errors = actionsutil.validateWorkflow(yaml.safeLoad(`
|
||||
name: "CodeQL"
|
||||
@@ -335,9 +335,32 @@ jobs:
|
||||
- run: "git checkout HEAD^2"
|
||||
|
||||
test3:
|
||||
steps:
|
||||
- run: "git checkout HEAD^2"
|
||||
steps: []
|
||||
`));
|
||||
t.deepEqual(errors, [actionsutil.WorkflowErrors.CheckoutWrongHead]);
|
||||
});
|
||||
ava_1.default("validateWorkflow() should not report a different job's CheckoutWrongHead", (t) => {
|
||||
process.env.GITHUB_JOB = "test3";
|
||||
const errors = actionsutil.validateWorkflow(yaml.safeLoad(`
|
||||
name: "CodeQL"
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [master]
|
||||
jobs:
|
||||
test:
|
||||
steps:
|
||||
- run: "git checkout HEAD^2"
|
||||
|
||||
test2:
|
||||
steps:
|
||||
- run: "git checkout HEAD^2"
|
||||
|
||||
test3:
|
||||
steps: []
|
||||
`));
|
||||
t.deepEqual(errors, []);
|
||||
});
|
||||
//# sourceMappingURL=actions-util.test.js.map
|
||||
Reference in New Issue
Block a user