Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Harband <ljharb@gmail.com>2022-01-18 22:24:53 +0300
committerGitHub <noreply@github.com>2022-01-18 22:24:53 +0300
commit510f0ecbc9970ed8c8993107cc03cf27b7b996dc (patch)
tree9e5f14ce48dd59af996bbf6b395143b012f4dbde /workspaces/arborist/tap-snapshots
parenta92665c92940b93e3e41eb8396257d684ee95c5f (diff)
fix(arborist): ensure indentation is preserved (#4218)
It turns out that `new Arborist().buildIdealTree().meta.toString()` does not take into account the indentation in the package.json (tabs, in my case) the way `npm install --package-lock-only` does. This fixes that. Also included a bonus commit that removes redundant Promise stuff inside an `async function`.
Diffstat (limited to 'workspaces/arborist/tap-snapshots')
-rw-r--r--workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs31
1 files changed, 31 insertions, 0 deletions
diff --git a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs
index ca47bbbe1..d8f4fc4d5 100644
--- a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs
+++ b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs
@@ -97673,6 +97673,37 @@ ArboristNode {
}
`
+exports[`test/arborist/build-ideal-tree.js TAP store files with a custom indenting > must match snapshot 1`] = `
+{
+ "name": "tab-indented-package-json",
+ "version": "1.0.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "tab-indented-package-json",
+ "version": "1.0.0",
+ "dependencies": {
+ "abbrev": "^1.0.0"
+ }
+ },
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
+ }
+ },
+ "dependencies": {
+ "abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
+ }
+ }
+}
+
+`
+
exports[`test/arborist/build-ideal-tree.js TAP tap vs react15 > build ideal tree with tap collision 1`] = `
ArboristNode {
"children": Map {