Skip to content

Commit fd6363f

Browse files
committed
Prefer to not escape characters
1 parent 5da6626 commit fd6363f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('javascript-stringify', function () {
3838
describe('objects', function () {
3939
it(
4040
'should stringify as object shorthand',
41-
test({ key: 'value', '-': 10 }, '{key:\'value\',\'-\':10}')
41+
test({ key: 'value', '-': 10 }, "{key:'value','-':10}")
4242
);
4343
});
4444

@@ -58,7 +58,7 @@ describe('javascript-stringify', function () {
5858
});
5959

6060
describe('String', function () {
61-
it('should stringify', test(new String('abc'), 'new String(\'abc\')'));
61+
it('should stringify', test(new String('abc'), "new String('abc')"));
6262
});
6363

6464
describe('Boolean', function () {
@@ -78,7 +78,7 @@ describe('javascript-stringify', function () {
7878
var obj = { key: 'value' };
7979
obj.obj = obj;
8080

81-
expect(stringify(obj)).to.equal('{key:\'value\'}');
81+
expect(stringify(obj)).to.equal("{key:'value'}");
8282
});
8383
});
8484

@@ -139,7 +139,7 @@ describe('javascript-stringify', function () {
139139
}
140140
}, null, -1);
141141

142-
expect(string).to.equal('{test:[1,2,3],nested:{key:\'value\'}}');
142+
expect(string).to.equal("{test:[1,2,3],nested:{key:'value'}}");
143143
});
144144
});
145145

@@ -149,13 +149,13 @@ describe('javascript-stringify', function () {
149149
test: 'value'
150150
}, function (value, indent, stringify) {
151151
if (typeof value === 'string') {
152-
return '\'hello\'';
152+
return '"hello"';
153153
}
154154

155155
return stringify(value);
156156
});
157157

158-
expect(string).to.equal('{test:\'hello\'}');
158+
expect(string).to.equal('{test:"hello"}');
159159
});
160160

161161
it('change primitive to object', function () {
@@ -169,7 +169,7 @@ describe('javascript-stringify', function () {
169169
return stringify(value);
170170
});
171171

172-
expect(string).to.equal('{test:{obj:\'value\'}}');
172+
expect(string).to.equal("{test:{obj:'value'}}");
173173
});
174174

175175
it('change object to primitive', function () {

0 commit comments

Comments
 (0)