Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / json-bigint / test / string-option-test.js
diff --git a/legacy-libs/json-bigint/test/string-option-test.js b/legacy-libs/json-bigint/test/string-option-test.js
new file mode 100644 (file)
index 0000000..c729f34
--- /dev/null
@@ -0,0 +1,21 @@
+var mocha  = require('mocha')
+  , assert = require('chai').assert
+  , expect = require('chai').expect
+  ;
+
+describe("Testing 'storeAsString' option", function(){
+    var key = '{ "key": 12345678901234567 }';
+    it("Should show that the key is of type object", function(done){
+        var JSONbig = require('../index');
+        var result = JSONbig.parse(key);
+        expect(typeof result.key).to.equal("object");
+        done();
+    });
+
+    it("Should show that key is of type string, when storeAsString option is true", function(done){
+        var JSONstring = require('../index')({"storeAsString": true});
+        var result = JSONstring.parse(key);
+        expect(typeof result.key).to.equal("string");
+        done();
+    });
+});