From 7daf4e01253258fa3525b6a0f3ace9f2b4224619 Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Tue, 2 Dec 2014 15:39:08 -0500 Subject: [PATCH] test(toJson): add extra test cases for new `pretty` behaviour --- test/AngularSpec.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 4349fb2a..97436ea6 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1189,11 +1189,17 @@ describe('angular', function() { }); - it('should format objects pretty', function() { + iit('should format objects pretty', function() { expect(toJson({a: 1, b: 2}, true)). - toBeOneOf('{\n "a": 1,\n "b": 2\n}', '{\n "a":1,\n "b":2\n}'); + toBe('{\n "a": 1,\n "b": 2\n}'); expect(toJson({a: {b: 2}}, true)). - toBeOneOf('{\n "a": {\n "b": 2\n }\n}', '{\n "a":{\n "b":2\n }\n}'); + toBe('{\n "a": {\n "b": 2\n }\n}'); + expect(toJson({a: 1, b: 2}, false)). + toBe('{"a":1,"b":2}'); + expect(toJson({a: 1, b: 2}, 0)). + toBe('{"a":1,"b":2}'); + expect(toJson({a: 1, b: 2}, 1)). + toBe('{\n "a": 1,\n "b": 2\n}'); });