Skip to content

Commit

Permalink
test: disable the snyk --version test on Windows
Browse files Browse the repository at this point in the history
Specific Windows test is needed
  • Loading branch information
lili2311 committed Jan 27, 2020
1 parent 73d070b commit 46ed79f
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions test/acceptance/cli-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { test } from 'tap';
import { exec } from 'child_process';
import { sep } from 'path';
const osName = require('os-name');

const main = './dist/cli/index.js'.replace(/\//g, sep);
const iswindows =
osName()
.toLowerCase()
.indexOf('windows') === 0;

// TODO(kyegupov): make these work in Windows
test('snyk test command should fail when --file is not specified correctly', (t) => {
Expand All @@ -19,19 +24,23 @@ test('snyk test command should fail when --file is not specified correctly', (t)
});
});

test('snyk version command should show cli version or sha', (t) => {
t.plan(1);
exec(`node ${main} --version`, (err, stdout) => {
if (err) {
throw err;
}
t.match(
stdout.trim(),
':', // can't guess branch or sha or dirty files, but we do always add `:`
'version is shown',
);
});
});
test(
'snyk version command should show cli version or sha',
{ skip: iswindows },
(t) => {
t.plan(1);
exec(`node ${main} --version`, (err, stdout) => {
if (err) {
throw err;
}
t.match(
stdout.trim(),
':', // can't guess branch or sha or dirty files, but we do always add `:`
'version is shown',
);
});
},
);

test('snyk test command should fail when --packageManager is not specified correctly', (t) => {
t.plan(1);
Expand Down

0 comments on commit 46ed79f

Please sign in to comment.