Skip to content

Commit

Permalink
Merge pull request #2181 from snyk/test/migrate-old-snyk-format
Browse files Browse the repository at this point in the history
test: migrate old-snyk-format to jest
  • Loading branch information
Avishagp committed Aug 23, 2021
2 parents 418e6ad + babe22a commit 7737f75
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
@@ -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 7737f75

Please sign in to comment.