diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-03-02 13:13:31 -0600 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-03-02 13:13:31 -0600 |
| commit | 06a3d6866e4f545abddd6654e490e50b623330a9 (patch) | |
| tree | e0e6a7d72eeaf647d03a44ed5c12733796fb8b87 /atom/packages/pretty-json/node_modules/jsonminify/test | |
| parent | 49c52987b6c6be6392351b6a7b227efc7341a414 (diff) | |
Update atoms
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'); + }); +}); |