it('should test formatting json array of objects', function() { var json = '[{"hello":"world"},{"foo":500.0}]'; var result = jsfmt.formatJSON(json, {}); result.should.eql('[{\n "hello": "world"\n }, {\n "foo": 500.0\n}]'); });
it('should test formatting json object', function() { var json = '{"hello":"world"}'; var result = jsfmt.formatJSON(json, {}); result.should.eql('{\n "hello": "world"\n}'); });
it('should test formatting json array', function() { var json = '["hello","world"]'; var result = jsfmt.formatJSON(json, {}); result.should.eql('["hello", "world"]'); });
it('should correctly format with trailing new line', function() { var json = '{"a":1,"b":"c"}\n'; var result = jsfmt.formatJSON(json, {}); result.should.eql('{\n "a": 1,\n "b": "c"\n}\n'); });