File tree Expand file tree Collapse file tree 3 files changed +208
-333
lines changed
tap-snapshots/test/lib/commands Expand file tree Collapse file tree 3 files changed +208
-333
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ const PackageJson = require('@npmcli/package-json')
1010const log = require ( '../utils/log-shim.js' )
1111const updateWorkspaces = require ( '../workspaces/update-workspaces.js' )
1212
13+ const posixPath = p => p . split ( '\\' ) . join ( '/' )
14+
1315const BaseCommand = require ( '../base-command.js' )
1416
1517class Init extends BaseCommand {
@@ -203,7 +205,7 @@ class Init extends BaseCommand {
203205 pkgJson . update ( {
204206 workspaces : [
205207 ...( pkgJson . content . workspaces || [ ] ) ,
206- relative ( this . npm . localPrefix , workspacePath ) ,
208+ posixPath ( relative ( this . npm . localPrefix , workspacePath ) ) ,
207209 ] ,
208210 } )
209211
Original file line number Diff line number Diff line change 55 * Make sure to inspect the output below. Do not ignore changes!
66 */
77'use strict'
8- exports [ `test/lib/commands/init.js TAP npm init workspces with root > does not print helper info 1` ] = `
9- Array []
10- `
8+ exports [ `test/lib/commands/init.js TAP displays output > displays helper info 1` ] = `
9+ This utility will walk you through creating a package.json file.
10+ It only covers the most common items, and tries to guess sensible defaults.
1111
12- exports [ `test/lib/commands/init.js TAP workspaces no args > should print helper info 1` ] = `
13- Array []
14- `
12+ See \`npm help init\` for definitive documentation on these fields
13+ and exactly what they do.
14+
15+ Use \`npm install <pkg>\` afterwards to install a package and
16+ save it as a dependency in the package.json file.
1517
16- exports [ `test/lib/commands/init.js TAP workspaces no args, existing folder > should print helper info 1` ] = `
17- Array []
18+ Press ^C at any time to quit.
1819`
1920
20- exports [ `test/lib/commands/init.js TAP workspaces post workspace-init reify > should print helper info 1` ] = `
21- Array [
22- Array [
23- String(
24-
25- added 1 package in 100ms
26- ),
27- ],
28- ]
21+ exports [ `test/lib/commands/init.js TAP workspaces no args -- yes > should print helper info 1` ] = `
22+
23+ added 1 package in {TIME}
2924`
3025
31- exports [ `test/lib/commands/init.js TAP workspaces post workspace-init reify > should reify tree on init ws complete 1` ] = `
26+ exports [ `test/lib/commands/init.js TAP workspaces no args -- yes > should reify tree on init ws complete 1` ] = `
3227{
3328 "name": "top-level",
3429 "lockfileVersion": 3,
@@ -53,7 +48,3 @@ exports[`test/lib/commands/init.js TAP workspaces post workspace-init reify > sh
5348}
5449
5550`
56-
57- exports [ `test/lib/commands/init.js TAP workspaces with arg but missing workspace folder > should print helper info 1` ] = `
58- Array []
59- `
You can’t perform that action at this time.
0 commit comments