Skip to content

Commit

Permalink
chore: refactor test tests into ecosystems
Browse files Browse the repository at this point in the history
  • Loading branch information
orsagie committed Nov 27, 2019
1 parent 96d62d5 commit eabfe17
Show file tree
Hide file tree
Showing 16 changed files with 4,121 additions and 3,061 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"find-circular": "npm run build && madge --circular ./dist",
"format": "prettier --write '{src,test,scripts}/**/*.{js,ts}'",
"prepare": "npm run build",
"test:acceptance": "tap test/acceptance/cli-test.nuget.test.ts -Rspec --timeout=300 --node-arg=-r --node-arg=ts-node/register",
"tap": "tap test/*.test.* test/acceptance/*.test.* test/system/*.test.* -Rspec --timeout=300 --node-arg=-r --node-arg=ts-node/register",
"test": "npm run test-common && npm run tap",
"test-common": "npm run check-tests && npm run build && npm run lint && node --require ts-node/register src/cli test --org=snyk",
Expand Down
8 changes: 2 additions & 6 deletions src/lib/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ export async function monitor(
const policy = await snyk.policy.load(policyLocations, { loose: true });

const target = await getTarget(pkg, meta);
const targetFileRelativePath = targetFile
? path.join(path.resolve(root), targetFile)
: '';
const targetFileRelativePath = path.join(path.resolve(root), targetFile || '');

if (target && target.branch) {
analytics.add('targetBranch', target.branch);
Expand Down Expand Up @@ -294,9 +292,7 @@ export async function monitorGraph(
const policy = await snyk.policy.load(policyLocations, { loose: true });

const target = await getTarget(pkg, meta);
const targetFileRelativePath = targetFile
? path.join(path.resolve(root), targetFile)
: '';
const targetFileRelativePath = path.join(path.resolve(root), targetFile || '');

if (target && target.branch) {
analytics.add('targetBranch', target.branch);
Expand Down
8 changes: 8 additions & 0 deletions test/acceptance/cli-help.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as tap from 'tap';
import * as cli from '../../src/cli/commands';

const { test } = tap;

test("snyk help doesn't crash", async (t) => {
t.match(await cli.help(), /Usage/);
});
File renamed without changes.
Loading

0 comments on commit eabfe17

Please sign in to comment.