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')
10
10
const log = require ( '../utils/log-shim.js' )
11
11
const updateWorkspaces = require ( '../workspaces/update-workspaces.js' )
12
12
13
+ const posixPath = p => p . split ( '\\' ) . join ( '/' )
14
+
13
15
const BaseCommand = require ( '../base-command.js' )
14
16
15
17
class Init extends BaseCommand {
@@ -203,7 +205,7 @@ class Init extends BaseCommand {
203
205
pkgJson . update ( {
204
206
workspaces : [
205
207
...( pkgJson . content . workspaces || [ ] ) ,
206
- relative ( this . npm . localPrefix , workspacePath ) ,
208
+ posixPath ( relative ( this . npm . localPrefix , workspacePath ) ) ,
207
209
] ,
208
210
} )
209
211
Original file line number Diff line number Diff line change 5
5
* Make sure to inspect the output below. Do not ignore changes!
6
6
*/
7
7
'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.
11
11
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.
15
17
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.
18
19
`
19
20
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}
29
24
`
30
25
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` ] = `
32
27
{
33
28
"name": "top-level",
34
29
"lockfileVersion": 3,
@@ -53,7 +48,3 @@ exports[`test/lib/commands/init.js TAP workspaces post workspace-init reify > sh
53
48
}
54
49
55
50
`
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