Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: user journey tests for Go based snyk code test #5172

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion cliv2/go.mod
Expand Up @@ -202,4 +202,5 @@ require (
// version 2491eb6c1c75 contains a valid license
replace github.com/mattn/go-localereader v0.0.1 => github.com/mattn/go-localereader v0.0.2-0.20220822084749-2491eb6c1c75

//replace github.com/snyk/go-application-framework => ../../go-application-framework
replace github.com/snyk/code-client-go => ../../code-client-go
replace github.com/snyk/go-application-framework => ../../go-application-framework
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -165,6 +165,7 @@
"jsonparse": "^1.3.1",
"lodash": "^4.17.20",
"mock-fs": "^4.13.0",
"nock": "^14.0.0-beta.6",
"node-loader": "^2.0.0",
"npm-run-all": "^4.1.5",
"patch-package": "^6.5.0",
Expand Down
9 changes: 9 additions & 0 deletions test/acceptance/fake-server.ts
Expand Up @@ -155,6 +155,7 @@ export const fakeServer = (basePath: string, snykToken: string): FakeServer => {
app.use(express.json({ type: 'application/vnd.api+json', strict: false }));
app.use((req, res, next) => {
requests.push(req);
console.log(req.method, req.url, req.body);
next();
});

Expand Down Expand Up @@ -224,6 +225,14 @@ export const fakeServer = (basePath: string, snykToken: string): FakeServer => {
}
});

// Supporting new code test
app.get('/deeproxy/filters', (req, res) => {
return res.send({
configFiles: ["test"],
extensions: ["test"],
});
});

app.post(basePath + '/vuln/:registry', (req, res, next) => {
const vulnerabilities = [];
if (req.query.org && req.query.org === 'missing-org') {
Expand Down