From abd603fa9ea0a1c3b41aff9d1e1d13d00bf14a74 Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 4 Sep 2020 14:47:53 +0200 Subject: [PATCH 1/2] Fix asinit keeping npm default test --- bin/asinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/asinit b/bin/asinit index 727534ba8e..d2460b0af0 100755 --- a/bin/asinit +++ b/bin/asinit @@ -344,7 +344,7 @@ function ensurePackageJson() { pkg["scripts"] = scripts; updated = true; } - if (!scripts["test"]) { + if (!scripts["test"] || scripts["test"] == "echo \"Error: no test specified\" && exit 1") { scripts["test"] = "node tests"; pkg["scripts"] = scripts; updated = true; From 92f6022852f11bed9611a0521ad22768862c798c Mon Sep 17 00:00:00 2001 From: dcode Date: Fri, 4 Sep 2020 15:05:50 +0200 Subject: [PATCH 2/2] add npmDefaultTest constant --- bin/asinit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/asinit b/bin/asinit index d2460b0af0..8081bd1082 100755 --- a/bin/asinit +++ b/bin/asinit @@ -8,6 +8,8 @@ const colors = require("../cli/util/colors"); const version = require("../package.json").version; const options = require("../cli/util/options"); +const npmDefaultTest = "echo \"Error: no test specified\" && exit 1"; + const commands = { "npm": { install: "npm install", @@ -344,7 +346,7 @@ function ensurePackageJson() { pkg["scripts"] = scripts; updated = true; } - if (!scripts["test"] || scripts["test"] == "echo \"Error: no test specified\" && exit 1") { + if (!scripts["test"] || scripts["test"] == npmDefaultTest) { scripts["test"] = "node tests"; pkg["scripts"] = scripts; updated = true;