summaryrefslogtreecommitdiff
path: root/tests/node.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-06-11 15:50:48 +0900
committerAndreas Enge <andreas@enge.fr>2026-07-08 18:33:27 +0200
commitef58e493c341ff4f61fb8caf4e14f02fd28c55d3 (patch)
tree54890fea35d0631a96e06dcfa6da1afdf345991c /tests/node.scm
parent230a8b05a844a67f2eeb0f554301d1fe2b52a937 (diff)
build/node: Preserve field order of modified JSON files.
* guix/build/node-build-system.scm (with-atomic-json-file-replacement): Call json->scm with #:ordered #t. * tests/node.scm ("modify-json, ordering"): New test. ("delete-dev-dependencies/except"): Adjust expected output accordingly. Change-Id: I9cf0475a7bac0cad8f5fd3d479c50eb35eac3f32
Diffstat (limited to 'tests/node.scm')
-rw-r--r--tests/node.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/node.scm b/tests/node.scm
index 5159d530a12..7328ac91e8e 100644
--- a/tests/node.scm
+++ b/tests/node.scm
@@ -76,6 +76,15 @@ It also returns the data as an alist directly."
76 76
77(test-begin "node related tests") 77(test-begin "node related tests")
78 78
79(test-equal "modify-json, ordering"
80 '(("mkdirp" . ">=1.0.0")
81 ("react" . "^16.8.0"))
82 (assoc-ref (modify-json* (modify-json-fields
83 '("peerDependencies.react")
84 (lambda (field-path data key)
85 data)))
86 "peerDependencies"))
87
79(test-equal "delete-dependencies" 88(test-equal "delete-dependencies"
80 '(("domelementtype" . "^3.0.0")) 89 '(("domelementtype" . "^3.0.0"))
81 (assoc-ref (modify-json* 90 (assoc-ref (modify-json*
@@ -89,8 +98,8 @@ It also returns the data as an alist directly."
89 "dependencies")) 98 "dependencies"))
90 99
91(test-equal "delete-dev-dependencies/except" 100(test-equal "delete-dev-dependencies/except"
92 '(("@types/node" . "^25.9.2") 101 '(("typescript" . "^5.9.3")
93 ("typescript" . "^5.9.3")) 102 ("@types/node" . "^25.9.2"))
94 (assoc-ref (modify-json* 103 (assoc-ref (modify-json*
95 (delete-dev-dependencies/except 104 (delete-dev-dependencies/except
96 '("typescript" "@types/node"))) 105 '("typescript" "@types/node")))