Skip to content

Commit 7737f75

Browse files
authored
Merge pull request #2181 from snyk/test/migrate-old-snyk-format
test: migrate old-snyk-format to jest
2 parents 418e6ad + babe22a commit 7737f75

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as policy from 'snyk-policy';
2+
import { loadJson } from '../../utils';
3+
import * as path from 'path';
4+
5+
it('test sensibly bails if gets an old .snyk format', async () => {
6+
const vulns2 = loadJson(
7+
path.resolve(__dirname, '../../fixtures/test-jsbin-vulns-updated.json'),
8+
);
9+
try {
10+
const config = await policy.load(
11+
path.resolve(__dirname, '../../fixtures/old-snyk-config'),
12+
);
13+
const res = await config.filter(vulns2);
14+
fail('was expecting an error, got ' + JSON.stringify(res));
15+
} catch (e) {
16+
expect(e.code).toEqual('OLD_DOTFILE_FORMAT');
17+
}
18+
});

test/old-snyk-format.test.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)