diff options
author | Gar <gar+gh@danger.computer> | 2021-05-28 19:23:49 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-06-01 01:21:04 +0300 |
commit | 598a17a2671c9e3bc204dddd6488169c9a72c6a1 (patch) | |
tree | 8784ad00c789fb0d8741b9e8317c8a0ee4b5fbcc /tap-snapshots | |
parent | c4fc03e9eb3a6386e8feacb67c19f0a1578dfe38 (diff) |
fix(libnpmexec): don't detach output from npm
The npm output function refers to this.log. libnpmexec has that passed
in, which decoupled the function from the npm object. This fixes it,
and sets the tests up in a way where if the output function ever becomes
detached from this.npm in the same way, tests will fail.
PR-URL: https://github.com/npm/cli/pull/3329
Credit: @wraithgar
Close: #3329
Reviewed-by: @ruyadorno
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test/lib/init.js.test.cjs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tap-snapshots/test/lib/init.js.test.cjs b/tap-snapshots/test/lib/init.js.test.cjs index 043d8b641..95abbe6c1 100644 --- a/tap-snapshots/test/lib/init.js.test.cjs +++ b/tap-snapshots/test/lib/init.js.test.cjs @@ -6,13 +6,28 @@ */ 'use strict' exports[`test/lib/init.js TAP workspaces no args > should print helper info 1`] = ` - +Array [ + Array [ + String( + This utility will walk you through creating a package.json file. + It only covers the most common items, and tries to guess sensible defaults. + + See \`npm help init\` for definitive documentation on these fields + and exactly what they do. + + Use \`npm install <pkg>\` afterwards to install a package and + save it as a dependency in the package.json file. + + Press ^C at any time to quit. + ), + ], +] ` exports[`test/lib/init.js TAP workspaces no args, existing folder > should print helper info 1`] = ` - +Array [] ` exports[`test/lib/init.js TAP workspaces with arg but missing workspace folder > should print helper info 1`] = ` - +Array [] ` |