]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / test-run-ls.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js
new file mode 100644 (file)
index 0000000..252c6e8
--- /dev/null
@@ -0,0 +1,33 @@
+var common = require("../common-tap.js")
+var test = require("tap").test
+var path = require("path")
+var cwd = path.resolve(__dirname, "..", "..")
+var testscript = require("../../package.json").scripts.test
+var tsregexp = testscript.replace(/([\[\.\*\]])/g, "\\$1")
+
+test("default", function (t) {
+  common.npm(["run"], { cwd: cwd }, function (er, code, so) {
+    if (er) throw er
+    t.notOk(code)
+    t.similar(so, new RegExp("\\n  test\\n    " + tsregexp + "\\n"))
+    t.end()
+  })
+})
+
+test("parseable", function (t) {
+  common.npm(["run", "-p"], { cwd: cwd }, function (er, code, so) {
+    if (er) throw er
+    t.notOk(code)
+    t.similar(so, new RegExp("\\ntest:" + tsregexp + "\\n"))
+    t.end()
+  })
+})
+
+test("parseable", function (t) {
+  common.npm(["run", "--json"], { cwd: cwd }, function (er, code, so) {
+    if (er) throw er
+    t.notOk(code)
+    t.equal(JSON.parse(so).test, testscript)
+    t.end()
+  })
+})