Skip to content

Commit

Permalink
test: show non root scans ignore policy
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Jun 19, 2020
1 parent 5aa1610 commit 7c56e25
Show file tree
Hide file tree
Showing 11 changed files with 953 additions and 754 deletions.
31 changes: 31 additions & 0 deletions test/acceptance/cli-monitor/cli-monitor.all-projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ interface AcceptanceTests {
export const AllProjectsTests: AcceptanceTests = {
language: 'Mixed',
tests: {
'`monitor mono-repo-with-ignores --all-projects` respects .snyk policy': (
params,
utils,
) => async (t) => {
utils.chdirWorkspaces();
await params.cli.monitor('mono-repo-with-ignores ', {
allProjects: true,
detectionDepth: 1,
});

params.server.popRequests(2).forEach((req) => {
t.equal(req.method, 'POST', 'makes POST request');
t.equal(
req.headers['x-snyk-cli-version'],
params.versionNumber,
'sends version number',
);
t.match(req.url, '/api/v1/monitor', 'posts to correct url');
t.ok(req.body.depGraph, 'body contains depGraph');
t.match(
req.body.policy,
'npm:node-uuid:20160328',
'body contains policy',
);
t.match(
req.body.depGraph.pkgManager.name,
/(npm)/,
'depGraph has package manager',
);
});
},
'`monitor mono-repo-project --all-projects --detection-depth=1`': (
params,
utils,
Expand Down

0 comments on commit 7c56e25

Please sign in to comment.