diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-03-02 23:10:51 -0600 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-03-02 23:10:51 -0600 |
| commit | 35ab4aab6926fb6cd2b44eda8bc14c72a8759b75 (patch) | |
| tree | 0c08edd4f9b6a0bc9bb2780b8a496ed8c69e20a4 /atom/packages/pretty-json/node_modules/jsonminify/test | |
| parent | 0b4318740e55d6977d98872eff6bebfe948bf46f (diff) | |
| parent | 28cc50d9af1fd1314afde30169dc22bba5934380 (diff) | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'atom/packages/pretty-json/node_modules/jsonminify/test')
4 files changed, 50 insertions, 0 deletions
diff --git a/atom/packages/pretty-json/node_modules/jsonminify/test/comment.json b/atom/packages/pretty-json/node_modules/jsonminify/test/comment.json new file mode 100644 index 0000000..0cddc5f --- /dev/null +++ b/atom/packages/pretty-json/node_modules/jsonminify/test/comment.json @@ -0,0 +1,12 @@ +{ // hoge + "foo": "bar",// this is cool + "bar": [ + "baz", "bum", /** aaaa **/"zam" // this is cool + ], + /* the rest of this document is just fluff + in case you are interested. */ + "something": 10, + /** the rest of this document is just fluff + *in case you are interested. */ + "else": 20 +} // hoge diff --git a/atom/packages/pretty-json/node_modules/jsonminify/test/mocha.opts b/atom/packages/pretty-json/node_modules/jsonminify/test/mocha.opts new file mode 100644 index 0000000..98c1dcd --- /dev/null +++ b/atom/packages/pretty-json/node_modules/jsonminify/test/mocha.opts @@ -0,0 +1,4 @@ +--ui bdd +--reporter spec +--timeout 5000 +--require should diff --git a/atom/packages/pretty-json/node_modules/jsonminify/test/plain.json b/atom/packages/pretty-json/node_modules/jsonminify/test/plain.json new file mode 100644 index 0000000..e60f726 --- /dev/null +++ b/atom/packages/pretty-json/node_modules/jsonminify/test/plain.json @@ -0,0 +1,8 @@ +{ + "foo": "bar", + "bar": [ + "baz", "bum", "zam" + ], + "something": 10, + "else": 20 +} diff --git a/atom/packages/pretty-json/node_modules/jsonminify/test/test-minify.json.js b/atom/packages/pretty-json/node_modules/jsonminify/test/test-minify.json.js new file mode 100644 index 0000000..be56ea3 --- /dev/null +++ b/atom/packages/pretty-json/node_modules/jsonminify/test/test-minify.json.js @@ -0,0 +1,26 @@ +var fs = require('fs'); + +var should = require('should'); + +require('../minify.json.js'); + +describe('JSON.minify', function() { + it('define', function() { + JSON.minify.should.be.ok; + }); + it('in-memory string', function() { + var json = '{"key":"value"}'; + var res = JSON.minify(json); + JSON.parse(res).key.should.equal('value'); + }); + it('comment.json', function() { + var json = fs.readFileSync(__dirname + '/comment.json', 'utf8'); + var res = JSON.parse(JSON.minify(json)); + res.foo.should.equal('bar'); + }); + it('comment.json', function() { + var json = fs.readFileSync(__dirname + '/plain.json', 'utf8'); + var res = JSON.parse(JSON.minify(json)); + res.foo.should.equal('bar'); + }); +}); |