From 6c76518ad13d00f07d607ec826a0ce4c980839ea Mon Sep 17 00:00:00 2001 From: tommy-mitchell Date: Tue, 18 Apr 2023 18:54:47 -0500 Subject: [PATCH] tests(`cli`): try to fix failure on CI --- test/_helpers/verify-cli.js | 2 +- test/cli.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/_helpers/verify-cli.js b/test/_helpers/verify-cli.js index 64e1e2b9..9d3985a8 100644 --- a/test/_helpers/verify-cli.js +++ b/test/_helpers/verify-cli.js @@ -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}); diff --git a/test/cli.js b/test/cli.js index a0e567d5..a37bc1eb 100644 --- a/test/cli.js +++ b/test/cli.js @@ -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', @@ -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]);