Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / @protobufjs / inquire / tests / index.js
diff --git a/legacy-libs/@protobufjs/inquire/tests/index.js b/legacy-libs/@protobufjs/inquire/tests/index.js
new file mode 100644 (file)
index 0000000..7d6496f
--- /dev/null
@@ -0,0 +1,20 @@
+var tape = require("tape");\r
+\r
+var inquire = require("..");\r
+\r
+tape.test("inquire", function(test) {\r
+\r
+    test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\"");\r
+\r
+    test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\"");\r
+\r
+    test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object");\r
+\r
+    test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array");\r
+\r
+    test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object");\r
+\r
+    test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array");\r
+\r
+    test.end();\r
+});\r