Skip to content

Commit

Permalink
tests(cli): try to fix failure on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell committed Apr 18, 2023
1 parent ef1d2e9 commit 6c76518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/_helpers/verify-cli.js
Expand Up @@ -2,7 +2,7 @@
import test from 'ava';
import {execa} from 'execa';

const trim = stdout => stdout.trim().split('\n').map(line => line.trim());
const trim = stdout => stdout.split('\n').map(line => line.trim());

const _verifyCli = shouldPass => test.macro(async (t, binPath, args, expectedLines) => {
const {exitCode, stdout} = await execa(binPath, [args].flat(), {reject: false});
Expand Down
4 changes: 3 additions & 1 deletion test/cli.js
Expand Up @@ -3,10 +3,11 @@ import test from 'ava';
import {npPkg, npRootDir as rootDir} from '../source/util.js';
import {cliPasses} from './_helpers/verify-cli.js';

const cli = path.resolve(rootDir, 'source/cli-implementation.js');
const cli = path.resolve(rootDir, 'source', 'cli-implementation.js');

// TODO: update help text in readme
test('flags: --help', cliPasses, cli, '--help', [
'',
'A better `npm publish`',
'',
'Usage',
Expand Down Expand Up @@ -38,6 +39,7 @@ test('flags: --help', cliPasses, cli, '--help', [
'$ np 1.0.2',
'$ np 1.0.2-beta.3 --tag=beta',
'$ np 1.0.2-beta.3 --tag=beta --contents=dist',
'',
]);

test('flags: --version', cliPasses, cli, '--version', [npPkg.version]);

0 comments on commit 6c76518

Please sign in to comment.