]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / async-some / test / parameters.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js
new file mode 100644 (file)
index 0000000..0706d1d
--- /dev/null
@@ -0,0 +1,37 @@
+var test = require("tap").test
+
+var some = require("../some.js")
+
+var NOP = function () {}
+
+test("some() called with bogus parameters", function (t) {
+  t.throws(function () {
+    some()
+  }, "throws when called with no parameters")
+
+  t.throws(function () {
+    some(null, NOP, NOP)
+  }, "throws when called with no list")
+
+  t.throws(function () {
+    some([], null, NOP)
+  }, "throws when called with no predicate")
+
+  t.throws(function () {
+    some([], NOP, null)
+  }, "throws when called with no callback")
+
+  t.throws(function () {
+    some({}, NOP, NOP)
+  }, "throws when called with wrong list type")
+
+  t.throws(function () {
+    some([], "ham", NOP)
+  }, "throws when called with wrong test type")
+
+  t.throws(function () {
+    some([], NOP, "ham")
+  }, "throws when called with wrong test type")
+
+  t.end()
+})