]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/pretty-json/node_modules/jsonminify/test/test-minify.json.js
be56ea3a5fd1f29901db543f0885dd1dcde56759
1 var fs
= require('fs');
3 var should
= require('should');
5 require('../minify.json.js');
7 describe('JSON.minify', function() {
8 it('define', function() {
9 JSON
.minify
.should
.be
.ok
;
11 it('in-memory string', function() {
12 var json
= '{"key":"value"}';
13 var res
= JSON
.minify(json
);
14 JSON
.parse(res
).key
.should
.equal('value');
16 it('comment.json', function() {
17 var json
= fs
.readFileSync(__dirname
+ '/comment.json', 'utf8');
18 var res
= JSON
.parse(JSON
.minify(json
));
19 res
.foo
.should
.equal('bar');
21 it('comment.json', function() {
22 var json
= fs
.readFileSync(__dirname
+ '/plain.json', 'utf8');
23 var res
= JSON
.parse(JSON
.minify(json
));
24 res
.foo
.should
.equal('bar');