]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-install-checks / test / check-platform.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js
new file mode 100644 (file)
index 0000000..eeeb1bc
--- /dev/null
@@ -0,0 +1,44 @@
+var test = require("tap").test
+var c = require("../index.js").checkPlatform
+
+test("target cpu wrong", function (t) {
+  var target = {}
+  target.cpu = "enten-cpu"
+  target.os = "any"
+  c(target, false, function (err) {
+    t.ok(err, "error present")
+    t.equal(err.code, "EBADPLATFORM")
+    t.end()
+  })
+})
+
+test("os wrong", function (t) {
+  var target = {}
+  target.cpu = "any"
+  target.os = "enten-os"
+  c(target, false, function (err) {
+    t.ok(err, "error present")
+    t.equal(err.code, "EBADPLATFORM")
+    t.end()
+  })
+})
+
+test("nothing wrong", function (t) {
+  var target = {}
+  target.cpu = "any"
+  target.os = "any"
+  c(target, false, function (err) {
+    t.notOk(err, "no error present")
+    t.end()
+  })
+})
+
+test("force", function (t) {
+  var target = {}
+  target.cpu = "enten-cpu"
+  target.os = "any"
+  c(target, true, function (err) {
+    t.notOk(err, "no error present")
+    t.end()
+  })
+})