Skip to content

Commit

Permalink
test: migrate old-snyk-format to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Avishag Israeli committed Aug 23, 2021
1 parent dd46c19 commit babe22a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
18 changes: 18 additions & 0 deletions test/jest/unit/old-snyk-format.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as policy from 'snyk-policy';
import { loadJson } from '../../utils';
import * as path from 'path';

it('test sensibly bails if gets an old .snyk format', async () => {
const vulns2 = loadJson(
path.resolve(__dirname, '../../fixtures/test-jsbin-vulns-updated.json'),
);
try {
const config = await policy.load(
path.resolve(__dirname, '../../fixtures/old-snyk-config'),
);
const res = await config.filter(vulns2);
fail('was expecting an error, got ' + JSON.stringify(res));
} catch (e) {
expect(e.code).toEqual('OLD_DOTFILE_FORMAT');
}
});
16 changes: 0 additions & 16 deletions test/old-snyk-format.test.ts

This file was deleted.

0 comments on commit babe22a

Please sign in to comment.