-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
-exports[`compiler: codeframe line in middle 1`] = `
-"2 | <template key="one"></template>
+exports[`compiler: codeframe > line in middle 1`] = `
+"2 | <template key=\\"one\\"></template>
3 | <ul>
-4 | <li v-for="foobar">hi</li>
+4 | <li v-for=\\"foobar\\">hi</li>
| ^^^^^^^^^^^^^^
5 | </ul>
-6 | <template key="two"></template>"
+6 | <template key=\\"two\\"></template>"
`;
-exports[`compiler: codeframe line near bottom 1`] = `
-"4 | <li v-for="foobar">hi</li>
+exports[`compiler: codeframe > line near bottom 1`] = `
+"4 | <li v-for=\\"foobar\\">hi</li>
5 | </ul>
-6 | <template key="two"></template>
+6 | <template key=\\"two\\"></template>
| ^^^^^^^^^
7 | </div>"
`;
-exports[`compiler: codeframe line near top 1`] = `
+exports[`compiler: codeframe > line near top 1`] = `
"1 | <div>
-2 | <template key="one"></template>
+2 | <template key=\\"one\\"></template>
| ^^^^^^^^^
3 | <ul>
-4 | <li v-for="foobar">hi</li>"
+4 | <li v-for=\\"foobar\\">hi</li>"
`;
-exports[`compiler: codeframe multi-line highlights 1`] = `
-"1 | <div attr="some
+exports[`compiler: codeframe > multi-line highlights 1`] = `
+"1 | <div attr=\\"some
| ^^^^^^^^^^
2 | multiline
| ^^^^^^^^^^^
3 | attr
| ^^^^
-4 | ">
+4 | \\">
| ^"
`;
-exports[`compiler: codeframe newline sequences - unix 1`] = `
-"8 | <input name="email" type="text"/>
+exports[`compiler: codeframe > newline sequences - unix 1`] = `
+"8 | <input name=\\"email\\" type=\\"text\\"/>
9 | </div>
-10 | <div id="hook">
+10 | <div id=\\"hook\\">
| ^^^^^^^^^^^^^^^
-11 | <label for="password">Password</label>
+11 | <label for=\\"password\\">Password</label>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-12 | <input name="password" type="password"/>
+12 | <input name=\\"password\\" type=\\"password\\"/>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 | </div>
| ^^^^^^^^^^^^"
`;
-exports[`compiler: codeframe newline sequences - windows 1`] = `
-"8 | <input name="email" type="text"/>
+exports[`compiler: codeframe > newline sequences - windows 1`] = `
+"8 | <input name=\\"email\\" type=\\"text\\"/>
9 | </div>
-10 | <div id="hook">
+10 | <div id=\\"hook\\">
| ^^^^^^^^^^^^^^^
-11 | <label for="password">Password</label>
+11 | <label for=\\"password\\">Password</label>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-12 | <input name="password" type="password"/>
+12 | <input name=\\"password\\" type=\\"password\\"/>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 | </div>
| ^^^^^^^^^^^^"
+/**
+ * @vitest-environment jsdom
+ */
import { computed, ref } from '@vue/reactivity'
import { toDisplayString } from '../src'
test('native objects', () => {
const div = document.createElement('div')
- expect(toDisplayString(div)).toBe('[object HTMLDivElement]')
+ expect(toDisplayString(div)).toMatch('[object HTMLDivElement]')
expect(toDisplayString({ div })).toMatchInlineSnapshot(`
"{
- "div": "[object HTMLDivElement]"
+ \\"div\\": \\"[object HTMLDivElement]\\"
}"
`)
})
expect(toDisplayString(m)).toMatchInlineSnapshot(`
"{
- "Map(2)": {
- "1 =>": "foo",
- "[object Object] =>": {
- "foo": "bar",
- "qux": 2
+ \\"Map(2)\\": {
+ \\"1 =>\\": \\"foo\\",
+ \\"[object Object] =>\\": {
+ \\"foo\\": \\"bar\\",
+ \\"qux\\": 2
}
}
}"
`)
expect(toDisplayString(s)).toMatchInlineSnapshot(`
"{
- "Set(3)": [
+ \\"Set(3)\\": [
1,
{
- "foo": "bar"
+ \\"foo\\": \\"bar\\"
},
{
- "Map(2)": {
- "1 =>": "foo",
- "[object Object] =>": {
- "foo": "bar",
- "qux": 2
+ \\"Map(2)\\": {
+ \\"1 =>\\": \\"foo\\",
+ \\"[object Object] =>\\": {
+ \\"foo\\": \\"bar\\",
+ \\"qux\\": 2
}
}
}
})
).toMatchInlineSnapshot(`
"{
- "m": {
- "Map(2)": {
- "1 =>": "foo",
- "[object Object] =>": {
- "foo": "bar",
- "qux": 2
+ \\"m\\": {
+ \\"Map(2)\\": {
+ \\"1 =>\\": \\"foo\\",
+ \\"[object Object] =>\\": {
+ \\"foo\\": \\"bar\\",
+ \\"qux\\": 2
}
}
},
- "s": {
- "Set(3)": [
+ \\"s\\": {
+ \\"Set(3)\\": [
1,
{
- "foo": "bar"
+ \\"foo\\": \\"bar\\"
},
{
- "Map(2)": {
- "1 =>": "foo",
- "[object Object] =>": {
- "foo": "bar",
- "qux": 2
+ \\"Map(2)\\": {
+ \\"1 =>\\": \\"foo\\",
+ \\"[object Object] =>\\": {
+ \\"foo\\": \\"bar\\",
+ \\"qux\\": 2
}
}
}