]> gerrit.simantics Code Review - simantics/district.git/blob - 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
1 var common = require("../common-tap.js")
2 var test = require("tap").test
3 var path = require("path")
4 var cwd = path.resolve(__dirname, "..", "..")
5 var testscript = require("../../package.json").scripts.test
6 var tsregexp = testscript.replace(/([\[\.\*\]])/g, "\\$1")
7
8 test("default", function (t) {
9   common.npm(["run"], { cwd: cwd }, function (er, code, so) {
10     if (er) throw er
11     t.notOk(code)
12     t.similar(so, new RegExp("\\n  test\\n    " + tsregexp + "\\n"))
13     t.end()
14   })
15 })
16
17 test("parseable", function (t) {
18   common.npm(["run", "-p"], { cwd: cwd }, function (er, code, so) {
19     if (er) throw er
20     t.notOk(code)
21     t.similar(so, new RegExp("\\ntest:" + tsregexp + "\\n"))
22     t.end()
23   })
24 })
25
26 test("parseable", function (t) {
27   common.npm(["run", "--json"], { cwd: cwd }, function (er, code, so) {
28     if (er) throw er
29     t.notOk(code)
30     t.equal(JSON.parse(so).test, testscript)
31     t.end()
32   })
33 })