[bug#74900,v2,4/6] build-system/node: Use test-target argument.

Message ID 20250217234823.10533-5-ngraves@ngraves.fr
State New
Headers
Series build-system/node: Replace (guix build json) by (json). |

Commit Message

Nicolas Graves Feb. 17, 2025, 11:43 p.m. UTC
  * guix/build/node-build-system.scm (check): Use test-target argument.
---
 guix/build/node-build-system.scm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
  

Patch

diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index ea23d92a05..9967069458 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -319,13 +319,12 @@  (define* (build #:key inputs #:allow-other-keys)
         (format #t "there is no build script to run~%"))
     #t))
 
-(define* (check #:key tests? inputs #:allow-other-keys)
-  "Run 'npm test' if TESTS?"
+(define* (check #:key tests? inputs test-target #:allow-other-keys)
+  "Run 'npm run TEST-TARGET' if TESTS?"
   (if tests?
       (let ((npm (string-append (assoc-ref inputs "node") "/bin/npm")))
-        (invoke npm "test"))
-      (format #t "test suite not run~%"))
-  #t)
+        (invoke npm "run" test-target))
+      (format #t "test suite not run~%")))
 
 (define* (repack #:key inputs #:allow-other-keys)
   (invoke "tar"