Add espaceJSON to String.sol (#5508)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>
This commit is contained in:
@ -339,4 +339,11 @@ describe('Strings', function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Escape JSON string', function () {
|
||||
for (const input of ['', 'a', '{"a":"b/c"}', 'a\tb\nc\\d"e\rf/g\fh\bi'])
|
||||
it(`escape ${JSON.stringify(input)}`, async function () {
|
||||
await expect(this.mock.$escapeJSON(input)).to.eventually.equal(JSON.stringify(input).slice(1, -1));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user