Skip to content

Commit 8fe7e4a

Browse files
awildbrysencwong-scw
authored andcommitted
Add full scenario test + dependency version bumps
- Added a test that runs the whole process and checks for expected output - Versionbumped the dependencies that dependabot made PRs for
1 parent ba5d772 commit 8fe7e4a

File tree

5 files changed

+885
-68
lines changed

5 files changed

+885
-68
lines changed

clilauncher.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const fs = require('fs');
2+
3+
const runner = require('./runner');
4+
5+
const testInput = "test-resources/testInput.sarif"
6+
const testOutput = "test-resources/output.sarif";
7+
const expectedOutput = "test-resources/expected.sarif"
8+
9+
afterAll(async () => {
10+
fs.unlink(testOutput, () => {});
11+
});
12+
13+
test('changed sarif includes Secure Code Warrior info', async () => {
14+
await runner.run(testInput, testOutput, null, () => {});
15+
16+
expect(fs.readFileSync(testOutput)).toEqual(fs.readFileSync(expectedOutput));
17+
});
18+

package-lock.json

Lines changed: 99 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
},
3030
"homepage": "https://github.com/SecureCodeWarrior/github-action-add-sarif-contextual-training#readme",
3131
"dependencies": {
32-
"@actions/core": "^1.2.6",
32+
"@actions/core": "^1.2.7",
3333
"@actions/github": "^4.0.0",
3434
"glob": "^7.1.6",
3535
"node-fetch": "^2.6.1"
3636
},
3737
"devDependencies": {
38-
"@vercel/ncc": "^0.27.0",
39-
"eslint": "^7.19.0",
38+
"@vercel/ncc": "^0.28.5",
39+
"eslint": "^7.25.0",
4040
"jest": "^26.6.3"
4141
}
4242
}

test-resources/expected.sarif

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)