Skip to content

Commit 288aabf

Browse files
committed
Add test for escaped strings
1 parent 85f3eb1 commit 288aabf

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/routes/+page.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ const fixture = [
6262
undefined: undefined,
6363
empty_string: '',
6464
empty_obj: {},
65-
empty_arr: []
65+
empty_arr: [],
66+
escaped: `"`
6667
}
6768
]
6869
const fixture2 = 'test invalid object'

tests/test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ test('default depth=1', async ({ page }) => {
2121
test('special types', async ({ page }) => {
2222
await page.goto('/')
2323
const list = await page.locator('#special_types li ._jsonVal').allTextContents()
24-
const asserts = ['"Test special types"', 'f () {...}', 'Symbol(bar)', 'null', 'undefined', '""']
24+
const asserts = [
25+
'"Test special types"',
26+
'f () {...}',
27+
'Symbol(bar)',
28+
'null',
29+
'undefined',
30+
'""',
31+
'"\\""'
32+
]
2533
for (let a = 0; a < list.length; a++) {
2634
expect(list[a]).toStrictEqual(asserts[a])
2735
}

0 commit comments

Comments
 (0)