string-option-test.js 737 B

123456789101112131415161718192021
  1. var mocha = require('mocha')
  2. , assert = require('chai').assert
  3. , expect = require('chai').expect
  4. ;
  5. describe("Testing 'storeAsString' option", function(){
  6. var key = '{ "key": 12345678901234567 }';
  7. it("Should show that the key is of type object", function(done){
  8. var JSONbig = require('../index');
  9. var result = JSONbig.parse(key);
  10. expect(typeof result.key).to.equal("object");
  11. done();
  12. });
  13. it("Should show that key is of type string, when storeAsString option is true", function(done){
  14. var JSONstring = require('../index')({"storeAsString": true});
  15. var result = JSONstring.parse(key);
  16. expect(typeof result.key).to.equal("string");
  17. done();
  18. });
  19. });