Skip to content

Commit

Permalink
Merge pull request snyk#1179 from snyk/fix/make_experimental_option_d…
Browse files Browse the repository at this point in the history
…efault_for_container_command

fix: make container commands use always static scan
  • Loading branch information
agranado2k committed Jun 16, 2020
2 parents 71f4578 + 11baf79 commit 3ad3596
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const modes: Record<string, ModeData> = {
allowedCommands: ['test', 'monitor'],
config: (args): [] => {
args['docker'] = true;
args['experimental'] = true;

return args;
},
Expand Down
3 changes: 3 additions & 0 deletions test/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ test('test command line "container test"', (t) => {
];
const result = args(cliArgs);
t.ok(result.options.docker);
t.ok(result.options.experimental);
t.end();
});

Expand All @@ -172,6 +173,7 @@ test('test command line "container monitor"', (t) => {
];
const result = args(cliArgs);
t.ok(result.options.docker);
t.ok(result.options.experimental);
t.end();
});

Expand All @@ -184,6 +186,7 @@ test('test command line "container protect"', (t) => {
];
const result = args(cliArgs);
t.notOk(result.options.docker);
t.notOk(result.options.experimental);
t.end();
});

Expand Down
5 changes: 5 additions & 0 deletions test/modes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ test('when is a valid mode', (c) => {
const expectedArgs = {
_: [],
docker: true,
experimental: true,
'package-manager': 'pip',
};
const cliCommand = 'container';
Expand All @@ -148,6 +149,7 @@ test('when is a valid mode', (c) => {
t.equal(command, expectedCommand);
t.same(cliArgs, expectedArgs);
t.ok(cliArgs['docker']);
t.ok(cliArgs['experimental']);
t.end();
},
);
Expand All @@ -158,6 +160,7 @@ test('when is a valid mode', (c) => {
const expectedArgs = {
_: [],
docker: true,
experimental: true,
'package-manager': 'pip',
};
const cliCommand = 'container';
Expand All @@ -171,6 +174,7 @@ test('when is a valid mode', (c) => {
t.equal(command, expectedCommand);
t.same(cliArgs, expectedArgs);
t.ok(cliArgs['docker']);
t.ok(cliArgs['experimental']);
t.end();
});
t.end();
Expand Down Expand Up @@ -198,6 +202,7 @@ test('when is a valid mode', (c) => {
t.equal(command, expectedCommand);
t.same(cliArgs, expectedArgs);
t.notOk(cliArgs['docker']);
t.notOk(cliArgs['experimental']);
t.end();
},
);
Expand Down

0 comments on commit 3ad3596

Please sign in to comment.