Skip to content

Commit 6254c67

Browse files
authored
Fix asinit keeping npm default test (#1456)
1 parent b463346 commit 6254c67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/asinit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const colors = require("../cli/util/colors");
88
const version = require("../package.json").version;
99
const options = require("../cli/util/options");
1010

11+
const npmDefaultTest = "echo \"Error: no test specified\" && exit 1";
12+
1113
const commands = {
1214
"npm": {
1315
install: "npm install",
@@ -344,7 +346,7 @@ function ensurePackageJson() {
344346
pkg["scripts"] = scripts;
345347
updated = true;
346348
}
347-
if (!scripts["test"]) {
349+
if (!scripts["test"] || scripts["test"] == npmDefaultTest) {
348350
scripts["test"] = "node tests";
349351
pkg["scripts"] = scripts;
350352
updated = true;

0 commit comments

Comments
 (0)