1/* IMPORTANT
2 * This snapshot file is auto-generated, but designed for humans.
3 * It should be checked into source control and tracked carefully.
4 * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
5 * Make sure to inspect the output below.  Do not ignore changes!
6 */
7'use strict'
8exports[`test/lib/commands/publish.js TAP _auth config default registry > new package version 1`] = `
9+ test-package@1.0.0
10`
11
12exports[`test/lib/commands/publish.js TAP bare _auth and registry config > new package version 1`] = `
13+ @npm/test-package@1.0.0
14`
15
16exports[`test/lib/commands/publish.js TAP dry-run > must match snapshot 1`] = `
17Array [
18  Array [
19    "",
20  ],
21  Array [
22    "",
23    "package: test-package@1.0.0",
24  ],
25  Array [
26    "=== Tarball Contents ===",
27  ],
28  Array [
29    "",
30    "87B package.json",
31  ],
32  Array [
33    "=== Tarball Details ===",
34  ],
35  Array [
36    "",
37    String(
38      name:          test-package
39      version:       1.0.0
40      filename:      test-package-1.0.0.tgz
41      package size:  {size}
42      unpacked size: 87 B
43      shasum:        {sha}
44      integrity:     {integrity}
45      total files:   1
46    ),
47  ],
48  Array [
49    "",
50    "",
51  ],
52  Array [
53    "",
54    "Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)",
55  ],
56]
57`
58
59exports[`test/lib/commands/publish.js TAP foreground-scripts can still be set to false > must match snapshot 1`] = `
60Array [
61  Array [
62    "",
63  ],
64  Array [
65    "",
66    "package: test-fg-scripts@0.0.0",
67  ],
68  Array [
69    "=== Tarball Contents ===",
70  ],
71  Array [
72    "",
73    "110B package.json",
74  ],
75  Array [
76    "=== Tarball Details ===",
77  ],
78  Array [
79    "",
80    String(
81      name:          test-fg-scripts
82      version:       0.0.0
83      filename:      test-fg-scripts-0.0.0.tgz
84      package size:  {size}
85      unpacked size: 110 B
86      shasum:        {sha}
87      integrity:     {integrity}
88      total files:   1
89    ),
90  ],
91  Array [
92    "",
93    "",
94  ],
95  Array [
96    "",
97    "Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)",
98  ],
99]
100`
101
102exports[`test/lib/commands/publish.js TAP foreground-scripts defaults to true > must match snapshot 1`] = `
103Array [
104  Array [
105    "",
106  ],
107  Array [
108    "",
109    "package: test-fg-scripts@0.0.0",
110  ],
111  Array [
112    "=== Tarball Contents ===",
113  ],
114  Array [
115    "",
116    "110B package.json",
117  ],
118  Array [
119    "=== Tarball Details ===",
120  ],
121  Array [
122    "",
123    String(
124      name:          test-fg-scripts
125      version:       0.0.0
126      filename:      test-fg-scripts-0.0.0.tgz
127      package size:  {size}
128      unpacked size: 110 B
129      shasum:        {sha}
130      integrity:     {integrity}
131      total files:   1
132    ),
133  ],
134  Array [
135    "",
136    "",
137  ],
138  Array [
139    "",
140    "Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)",
141  ],
142]
143`
144
145exports[`test/lib/commands/publish.js TAP has mTLS auth for scope configured registry > new package version 1`] = `
146+ @npm/test-package@1.0.0
147`
148
149exports[`test/lib/commands/publish.js TAP has token auth for scope configured registry > new package version 1`] = `
150+ @npm/test-package@1.0.0
151`
152
153exports[`test/lib/commands/publish.js TAP ignore-scripts > new package version 1`] = `
154+ test-package@1.0.0
155`
156
157exports[`test/lib/commands/publish.js TAP json > must match snapshot 1`] = `
158Array [
159  Array [
160    "",
161    "Publishing to https://registry.npmjs.org/ with tag latest and default access",
162  ],
163]
164`
165
166exports[`test/lib/commands/publish.js TAP json > new package json 1`] = `
167{
168  "id": "test-package@1.0.0",
169  "name": "test-package",
170  "version": "1.0.0",
171  "size": "{size}",
172  "unpackedSize": 87,
173  "shasum": "{sha}",
174  "integrity": "{integrity}",
175  "filename": "test-package-1.0.0.tgz",
176  "files": [
177    {
178      "path": "package.json",
179      "size": "{size}",
180      "mode": 420
181    }
182  ],
183  "entryCount": 1,
184  "bundled": []
185}
186`
187
188exports[`test/lib/commands/publish.js TAP manifest > manifest 1`] = `
189Object {
190  "_id": "npm@{VERSION}",
191  "author": Object {
192    "name": "GitHub Inc.",
193  },
194  "bin": Object {
195    "npm": "bin/npm-cli.js",
196    "npx": "bin/npx-cli.js",
197  },
198  "bugs": Object {
199    "url": "https://github.com/npm/cli/issues",
200  },
201  "description": "a package manager for JavaScript",
202  "directories": Object {
203    "doc": "./doc",
204    "man": "./man",
205  },
206  "exports": Object {
207    ".": Array [
208      Object {
209        "default": "./index.js",
210      },
211      "./index.js",
212    ],
213    "./package.json": "./package.json",
214  },
215  "files": Array [
216    "bin/",
217    "lib/",
218    "index.js",
219    "docs/content/",
220    "docs/output/",
221    "man/",
222  ],
223  "homepage": "https://docs.npmjs.com/",
224  "keywords": Array [
225    "install",
226    "modules",
227    "package manager",
228    "package.json",
229  ],
230  "license": "Artistic-2.0",
231  "main": "./index.js",
232  "man": Array [
233    "man/man1/npm-access.1",
234    "man/man1/npm-adduser.1",
235    "man/man1/npm-audit.1",
236    "man/man1/npm-bugs.1",
237    "man/man1/npm-cache.1",
238    "man/man1/npm-ci.1",
239    "man/man1/npm-completion.1",
240    "man/man1/npm-config.1",
241    "man/man1/npm-dedupe.1",
242    "man/man1/npm-deprecate.1",
243    "man/man1/npm-diff.1",
244    "man/man1/npm-dist-tag.1",
245    "man/man1/npm-docs.1",
246    "man/man1/npm-doctor.1",
247    "man/man1/npm-edit.1",
248    "man/man1/npm-exec.1",
249    "man/man1/npm-explain.1",
250    "man/man1/npm-explore.1",
251    "man/man1/npm-find-dupes.1",
252    "man/man1/npm-fund.1",
253    "man/man1/npm-help-search.1",
254    "man/man1/npm-help.1",
255    "man/man1/npm-hook.1",
256    "man/man1/npm-init.1",
257    "man/man1/npm-install-ci-test.1",
258    "man/man1/npm-install-test.1",
259    "man/man1/npm-install.1",
260    "man/man1/npm-link.1",
261    "man/man1/npm-login.1",
262    "man/man1/npm-logout.1",
263    "man/man1/npm-ls.1",
264    "man/man1/npm-org.1",
265    "man/man1/npm-outdated.1",
266    "man/man1/npm-owner.1",
267    "man/man1/npm-pack.1",
268    "man/man1/npm-ping.1",
269    "man/man1/npm-pkg.1",
270    "man/man1/npm-prefix.1",
271    "man/man1/npm-profile.1",
272    "man/man1/npm-prune.1",
273    "man/man1/npm-publish.1",
274    "man/man1/npm-query.1",
275    "man/man1/npm-rebuild.1",
276    "man/man1/npm-repo.1",
277    "man/man1/npm-restart.1",
278    "man/man1/npm-root.1",
279    "man/man1/npm-run-script.1",
280    "man/man1/npm-sbom.1",
281    "man/man1/npm-search.1",
282    "man/man1/npm-shrinkwrap.1",
283    "man/man1/npm-star.1",
284    "man/man1/npm-stars.1",
285    "man/man1/npm-start.1",
286    "man/man1/npm-stop.1",
287    "man/man1/npm-team.1",
288    "man/man1/npm-test.1",
289    "man/man1/npm-token.1",
290    "man/man1/npm-uninstall.1",
291    "man/man1/npm-unpublish.1",
292    "man/man1/npm-unstar.1",
293    "man/man1/npm-update.1",
294    "man/man1/npm-version.1",
295    "man/man1/npm-view.1",
296    "man/man1/npm-whoami.1",
297    "man/man1/npm.1",
298    "man/man1/npx.1",
299    "man/man5/folders.5",
300    "man/man5/install.5",
301    "man/man5/npm-global.5",
302    "man/man5/npm-json.5",
303    "man/man5/npm-shrinkwrap-json.5",
304    "man/man5/npmrc.5",
305    "man/man5/package-json.5",
306    "man/man5/package-lock-json.5",
307    "man/man7/config.7",
308    "man/man7/dependency-selectors.7",
309    "man/man7/developers.7",
310    "man/man7/logging.7",
311    "man/man7/orgs.7",
312    "man/man7/package-spec.7",
313    "man/man7/registry.7",
314    "man/man7/removal.7",
315    "man/man7/scope.7",
316    "man/man7/scripts.7",
317    "man/man7/workspaces.7",
318  ],
319  "name": "npm",
320  "readmeFilename": "README.md",
321  "repository": Object {
322    "type": "git",
323    "url": "git+https://github.com/npm/cli.git",
324  },
325  "version": "{VERSION}",
326}
327`
328
329exports[`test/lib/commands/publish.js TAP no auth dry-run > must match snapshot 1`] = `
330+ test-package@1.0.0
331`
332
333exports[`test/lib/commands/publish.js TAP no auth dry-run > warns about auth being needed 1`] = `
334Array [
335  Array [
336    "publish",
337    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
338  ],
339  Array [
340    "publish",
341    String(
342      errors corrected:
343      Removed invalid "scripts"
344    ),
345  ],
346  Array [
347    "",
348    "This command requires you to be logged in to https://registry.npmjs.org/ (dry-run)",
349  ],
350]
351`
352
353exports[`test/lib/commands/publish.js TAP public access > must match snapshot 1`] = `
354Array [
355  Array [
356    "",
357  ],
358  Array [
359    "",
360    "package: @npm/test-package@1.0.0",
361  ],
362  Array [
363    "=== Tarball Contents ===",
364  ],
365  Array [
366    "",
367    "55B package.json",
368  ],
369  Array [
370    "=== Tarball Details ===",
371  ],
372  Array [
373    "",
374    String(
375      name:          @npm/test-package
376      version:       1.0.0
377      filename:      npm-test-package-1.0.0.tgz
378      package size:  {size}
379      unpacked size: 55 B
380      shasum:        {sha}
381      integrity:     {integrity}
382      total files:   1
383    ),
384  ],
385  Array [
386    "",
387    "",
388  ],
389  Array [
390    "",
391    "Publishing to https://registry.npmjs.org/ with tag latest and public access",
392  ],
393]
394`
395
396exports[`test/lib/commands/publish.js TAP public access > new package version 1`] = `
397+ @npm/test-package@1.0.0
398`
399
400exports[`test/lib/commands/publish.js TAP re-loads publishConfig.registry if added during script process > new package version 1`] = `
401+ test-package@1.0.0
402`
403
404exports[`test/lib/commands/publish.js TAP respects publishConfig.registry, runs appropriate scripts > new package version 1`] = `
405
406`
407
408exports[`test/lib/commands/publish.js TAP restricted access > must match snapshot 1`] = `
409Array [
410  Array [
411    "",
412  ],
413  Array [
414    "",
415    "package: @npm/test-package@1.0.0",
416  ],
417  Array [
418    "=== Tarball Contents ===",
419  ],
420  Array [
421    "",
422    "55B package.json",
423  ],
424  Array [
425    "=== Tarball Details ===",
426  ],
427  Array [
428    "",
429    String(
430      name:          @npm/test-package
431      version:       1.0.0
432      filename:      npm-test-package-1.0.0.tgz
433      package size:  {size}
434      unpacked size: 55 B
435      shasum:        {sha}
436      integrity:     {integrity}
437      total files:   1
438    ),
439  ],
440  Array [
441    "",
442    "",
443  ],
444  Array [
445    "",
446    "Publishing to https://registry.npmjs.org/ with tag latest and restricted access",
447  ],
448]
449`
450
451exports[`test/lib/commands/publish.js TAP restricted access > new package version 1`] = `
452+ @npm/test-package@1.0.0
453`
454
455exports[`test/lib/commands/publish.js TAP scoped _auth config scoped registry > new package version 1`] = `
456+ @npm/test-package@1.0.0
457`
458
459exports[`test/lib/commands/publish.js TAP tarball > must match snapshot 1`] = `
460Array [
461  Array [
462    "",
463  ],
464  Array [
465    "",
466    "package: test-tar-package@1.0.0",
467  ],
468  Array [
469    "=== Tarball Contents ===",
470  ],
471  Array [
472    "",
473    String(
474      26B index.js
475      98B package.json
476    ),
477  ],
478  Array [
479    "=== Tarball Details ===",
480  ],
481  Array [
482    "",
483    String(
484      name:          test-tar-package
485      version:       1.0.0
486      filename:      test-tar-package-1.0.0.tgz
487      package size:  {size}
488      unpacked size: 124 B
489      shasum:        {sha}
490      integrity:     {integrity}
491      total files:   2
492    ),
493  ],
494  Array [
495    "",
496    "",
497  ],
498  Array [
499    "",
500    "Publishing to https://registry.npmjs.org/ with tag latest and default access",
501  ],
502]
503`
504
505exports[`test/lib/commands/publish.js TAP tarball > new package json 1`] = `
506+ test-tar-package@1.0.0
507`
508
509exports[`test/lib/commands/publish.js TAP workspaces all workspaces - color > all public workspaces 1`] = `
510+ workspace-a@1.2.3-a
511+ workspace-b@1.2.3-n
512+ workspace-n@1.2.3-n
513`
514
515exports[`test/lib/commands/publish.js TAP workspaces all workspaces - color > warns about skipped private workspace in color 1`] = `
516Array [
517  Array [
518    "publish",
519    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
520  ],
521  Array [
522    "publish",
523    String(
524      errors corrected:
525      Removed invalid "scripts"
526      "repository" was changed from a string to an object
527    ),
528  ],
529  Array [
530    "publish",
531    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
532  ],
533  Array [
534    "publish",
535    String(
536      errors corrected:
537      Removed invalid "scripts"
538      "repository" was changed from a string to an object
539      "repository.url" was normalized to "git+https://github.com/npm/workspace-b.git"
540    ),
541  ],
542  Array [
543    "publish",
544    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
545  ],
546  Array [
547    "publish",
548    String(
549      errors corrected:
550      Removed invalid "scripts"
551    ),
552  ],
553  Array [
554    "publish",
555    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
556  ],
557  Array [
558    "publish",
559    String(
560      errors corrected:
561      Removed invalid "scripts"
562    ),
563  ],
564  Array [
565    "publish",
566    "Skipping workspace \\u001b[32mworkspace-p\\u001b[39m, marked as \\u001b[1mprivate\\u001b[22m",
567  ],
568]
569`
570
571exports[`test/lib/commands/publish.js TAP workspaces all workspaces - no color > all public workspaces 1`] = `
572+ workspace-a@1.2.3-a
573+ workspace-b@1.2.3-n
574+ workspace-n@1.2.3-n
575`
576
577exports[`test/lib/commands/publish.js TAP workspaces all workspaces - no color > warns about skipped private workspace 1`] = `
578Array [
579  Array [
580    "publish",
581    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
582  ],
583  Array [
584    "publish",
585    String(
586      errors corrected:
587      Removed invalid "scripts"
588      "repository" was changed from a string to an object
589    ),
590  ],
591  Array [
592    "publish",
593    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
594  ],
595  Array [
596    "publish",
597    String(
598      errors corrected:
599      Removed invalid "scripts"
600      "repository" was changed from a string to an object
601      "repository.url" was normalized to "git+https://github.com/npm/workspace-b.git"
602    ),
603  ],
604  Array [
605    "publish",
606    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
607  ],
608  Array [
609    "publish",
610    String(
611      errors corrected:
612      Removed invalid "scripts"
613    ),
614  ],
615  Array [
616    "publish",
617    "npm auto-corrected some errors in your package.json when publishing.  Please run \\"npm pkg fix\\" to address these errors.",
618  ],
619  Array [
620    "publish",
621    String(
622      errors corrected:
623      Removed invalid "scripts"
624    ),
625  ],
626  Array [
627    "publish",
628    "Skipping workspace workspace-p, marked as private",
629  ],
630]
631`
632
633exports[`test/lib/commands/publish.js TAP workspaces json > all workspaces in json 1`] = `
634{
635  "workspace-a": {
636    "id": "workspace-a@1.2.3-a",
637    "name": "workspace-a",
638    "version": "1.2.3-a",
639    "size": "{size}",
640    "unpackedSize": 82,
641    "shasum": "{sha}",
642    "integrity": "{integrity}",
643    "filename": "workspace-a-1.2.3-a.tgz",
644    "files": [
645      {
646        "path": "package.json",
647        "size": "{size}",
648        "mode": 420
649      }
650    ],
651    "entryCount": 1,
652    "bundled": []
653  },
654  "workspace-b": {
655    "id": "workspace-b@1.2.3-n",
656    "name": "workspace-b",
657    "version": "1.2.3-n",
658    "size": "{size}",
659    "unpackedSize": 92,
660    "shasum": "{sha}",
661    "integrity": "{integrity}",
662    "filename": "workspace-b-1.2.3-n.tgz",
663    "files": [
664      {
665        "path": "package.json",
666        "size": "{size}",
667        "mode": 420
668      }
669    ],
670    "entryCount": 1,
671    "bundled": []
672  },
673  "workspace-n": {
674    "id": "workspace-n@1.2.3-n",
675    "name": "workspace-n",
676    "version": "1.2.3-n",
677    "size": "{size}",
678    "unpackedSize": 42,
679    "shasum": "{sha}",
680    "integrity": "{integrity}",
681    "filename": "workspace-n-1.2.3-n.tgz",
682    "files": [
683      {
684        "path": "package.json",
685        "size": "{size}",
686        "mode": 420
687      }
688    ],
689    "entryCount": 1,
690    "bundled": []
691  }
692}
693`
694
695exports[`test/lib/commands/publish.js TAP workspaces one workspace - success > single workspace 1`] = `
696+ workspace-a@1.2.3-a
697`
698