Skip to content

Commit 7daf4e0

Browse files
committed
test(toJson): add extra test cases for new pretty behaviour
1 parent 1191edb commit 7daf4e0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/AngularSpec.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,17 @@ describe('angular', function() {
11891189
});
11901190

11911191

1192-
it('should format objects pretty', function() {
1192+
iit('should format objects pretty', function() {
11931193
expect(toJson({a: 1, b: 2}, true)).
1194-
toBeOneOf('{\n "a": 1,\n "b": 2\n}', '{\n "a":1,\n "b":2\n}');
1194+
toBe('{\n "a": 1,\n "b": 2\n}');
11951195
expect(toJson({a: {b: 2}}, true)).
1196-
toBeOneOf('{\n "a": {\n "b": 2\n }\n}', '{\n "a":{\n "b":2\n }\n}');
1196+
toBe('{\n "a": {\n "b": 2\n }\n}');
1197+
expect(toJson({a: 1, b: 2}, false)).
1198+
toBe('{"a":1,"b":2}');
1199+
expect(toJson({a: 1, b: 2}, 0)).
1200+
toBe('{"a":1,"b":2}');
1201+
expect(toJson({a: 1, b: 2}, 1)).
1202+
toBe('{\n "a": 1,\n "b": 2\n}');
11971203
});
11981204

11991205

0 commit comments

Comments
 (0)