wip(vitest-migration): shared tests passing

This commit is contained in:
Evan You 2023-01-26 15:31:52 +08:00
parent 8867bb259a
commit 3db69af53d
3 changed files with 58 additions and 52 deletions

View File

@ -1,62 +1,62 @@
// 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>
| ^^^^^^^^^^^^"

View File

@ -1,3 +1,6 @@
/**
* @vitest-environment jsdom
*/
import { looseEqual } from '../src'
describe('utils/looseEqual', () => {

View File

@ -1,3 +1,6 @@
/**
* @vitest-environment jsdom
*/
import { computed, ref } from '@vue/reactivity'
import { toDisplayString } from '../src'
@ -86,10 +89,10 @@ describe('toDisplayString', () => {
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]\\"
}"
`)
})
@ -103,28 +106,28 @@ describe('toDisplayString', () => {
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
}
}
}
@ -139,27 +142,27 @@ describe('toDisplayString', () => {
})
).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
}
}
}