Skip to content

Commit

Permalink
test: add test case for unsupported error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dkontorovskyy committed Jul 23, 2019
1 parent ed9e7bc commit f2bdbae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/acceptance/cli.acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2205,6 +2205,20 @@ test('monitor for package with no name in lockfile', async (t) => {
t.pass('succeed');
});

test('`monitor npm-package with experimental-dep-graph not enabled`', async (t) => {
chdirWorkspaces();

try {
await cli.monitor('npm-package', { 'experimental-dep-graph': true });
} catch (e) {
t.equal(e.name, 'UnsupportedFeatureFlagError', 'correct error was thrown');
t.equal(e.userMessage,
'Feature flag \'experimental-dep-graph\' is not currently enabled for your org, ' +
'to enable please contact snyk support',
'correct default error message');
}
});

test('`monitor npm-package`', async (t) => {
chdirWorkspaces();
await cli.monitor('npm-package');
Expand Down

0 comments on commit f2bdbae

Please sign in to comment.