Skip to content

Commit 3db69af

Browse files
committed
wip(vitest-migration): shared tests passing
1 parent 8867bb2 commit 3db69af

File tree

3 files changed

+58
-52
lines changed

3 files changed

+58
-52
lines changed

packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1
22

3-
exports[`compiler: codeframe line in middle 1`] = `
4-
"2 | <template key="one"></template>
3+
exports[`compiler: codeframe > line in middle 1`] = `
4+
"2 | <template key=\\"one\\"></template>
55
3 | <ul>
6-
4 | <li v-for="foobar">hi</li>
6+
4 | <li v-for=\\"foobar\\">hi</li>
77
| ^^^^^^^^^^^^^^
88
5 | </ul>
9-
6 | <template key="two"></template>"
9+
6 | <template key=\\"two\\"></template>"
1010
`;
1111
12-
exports[`compiler: codeframe line near bottom 1`] = `
13-
"4 | <li v-for="foobar">hi</li>
12+
exports[`compiler: codeframe > line near bottom 1`] = `
13+
"4 | <li v-for=\\"foobar\\">hi</li>
1414
5 | </ul>
15-
6 | <template key="two"></template>
15+
6 | <template key=\\"two\\"></template>
1616
| ^^^^^^^^^
1717
7 | </div>"
1818
`;
1919
20-
exports[`compiler: codeframe line near top 1`] = `
20+
exports[`compiler: codeframe > line near top 1`] = `
2121
"1 | <div>
22-
2 | <template key="one"></template>
22+
2 | <template key=\\"one\\"></template>
2323
| ^^^^^^^^^
2424
3 | <ul>
25-
4 | <li v-for="foobar">hi</li>"
25+
4 | <li v-for=\\"foobar\\">hi</li>"
2626
`;
2727
28-
exports[`compiler: codeframe multi-line highlights 1`] = `
29-
"1 | <div attr="some
28+
exports[`compiler: codeframe > multi-line highlights 1`] = `
29+
"1 | <div attr=\\"some
3030
| ^^^^^^^^^^
3131
2 | multiline
3232
| ^^^^^^^^^^^
3333
3 | attr
3434
| ^^^^
35-
4 | ">
35+
4 | \\">
3636
| ^"
3737
`;
3838
39-
exports[`compiler: codeframe newline sequences - unix 1`] = `
40-
"8 | <input name="email" type="text"/>
39+
exports[`compiler: codeframe > newline sequences - unix 1`] = `
40+
"8 | <input name=\\"email\\" type=\\"text\\"/>
4141
9 | </div>
42-
10 | <div id="hook">
42+
10 | <div id=\\"hook\\">
4343
| ^^^^^^^^^^^^^^^
44-
11 | <label for="password">Password</label>
44+
11 | <label for=\\"password\\">Password</label>
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46-
12 | <input name="password" type="password"/>
46+
12 | <input name=\\"password\\" type=\\"password\\"/>
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848
13 | </div>
4949
| ^^^^^^^^^^^^"
5050
`;
5151
52-
exports[`compiler: codeframe newline sequences - windows 1`] = `
53-
"8 | <input name="email" type="text"/>
52+
exports[`compiler: codeframe > newline sequences - windows 1`] = `
53+
"8 | <input name=\\"email\\" type=\\"text\\"/>
5454
9 | </div>
55-
10 | <div id="hook">
55+
10 | <div id=\\"hook\\">
5656
| ^^^^^^^^^^^^^^^
57-
11 | <label for="password">Password</label>
57+
11 | <label for=\\"password\\">Password</label>
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59-
12 | <input name="password" type="password"/>
59+
12 | <input name=\\"password\\" type=\\"password\\"/>
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6161
13 | </div>
6262
| ^^^^^^^^^^^^"

packages/shared/__tests__/looseEqual.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @vitest-environment jsdom
3+
*/
14
import { looseEqual } from '../src'
25

36
describe('utils/looseEqual', () => {

packages/shared/__tests__/toDisplayString.spec.ts

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @vitest-environment jsdom
3+
*/
14
import { computed, ref } from '@vue/reactivity'
25
import { toDisplayString } from '../src'
36

@@ -86,10 +89,10 @@ describe('toDisplayString', () => {
8689

8790
test('native objects', () => {
8891
const div = document.createElement('div')
89-
expect(toDisplayString(div)).toBe('[object HTMLDivElement]')
92+
expect(toDisplayString(div)).toMatch('[object HTMLDivElement]')
9093
expect(toDisplayString({ div })).toMatchInlineSnapshot(`
9194
"{
92-
"div": "[object HTMLDivElement]"
95+
\\"div\\": \\"[object HTMLDivElement]\\"
9396
}"
9497
`)
9598
})
@@ -103,28 +106,28 @@ describe('toDisplayString', () => {
103106

104107
expect(toDisplayString(m)).toMatchInlineSnapshot(`
105108
"{
106-
"Map(2)": {
107-
"1 =>": "foo",
108-
"[object Object] =>": {
109-
"foo": "bar",
110-
"qux": 2
109+
\\"Map(2)\\": {
110+
\\"1 =>\\": \\"foo\\",
111+
\\"[object Object] =>\\": {
112+
\\"foo\\": \\"bar\\",
113+
\\"qux\\": 2
111114
}
112115
}
113116
}"
114117
`)
115118
expect(toDisplayString(s)).toMatchInlineSnapshot(`
116119
"{
117-
"Set(3)": [
120+
\\"Set(3)\\": [
118121
1,
119122
{
120-
"foo": "bar"
123+
\\"foo\\": \\"bar\\"
121124
},
122125
{
123-
"Map(2)": {
124-
"1 =>": "foo",
125-
"[object Object] =>": {
126-
"foo": "bar",
127-
"qux": 2
126+
\\"Map(2)\\": {
127+
\\"1 =>\\": \\"foo\\",
128+
\\"[object Object] =>\\": {
129+
\\"foo\\": \\"bar\\",
130+
\\"qux\\": 2
128131
}
129132
}
130133
}
@@ -139,27 +142,27 @@ describe('toDisplayString', () => {
139142
})
140143
).toMatchInlineSnapshot(`
141144
"{
142-
"m": {
143-
"Map(2)": {
144-
"1 =>": "foo",
145-
"[object Object] =>": {
146-
"foo": "bar",
147-
"qux": 2
145+
\\"m\\": {
146+
\\"Map(2)\\": {
147+
\\"1 =>\\": \\"foo\\",
148+
\\"[object Object] =>\\": {
149+
\\"foo\\": \\"bar\\",
150+
\\"qux\\": 2
148151
}
149152
}
150153
},
151-
"s": {
152-
"Set(3)": [
154+
\\"s\\": {
155+
\\"Set(3)\\": [
153156
1,
154157
{
155-
"foo": "bar"
158+
\\"foo\\": \\"bar\\"
156159
},
157160
{
158-
"Map(2)": {
159-
"1 =>": "foo",
160-
"[object Object] =>": {
161-
"foo": "bar",
162-
"qux": 2
161+
\\"Map(2)\\": {
162+
\\"1 =>\\": \\"foo\\",
163+
\\"[object Object] =>\\": {
164+
\\"foo\\": \\"bar\\",
165+
\\"qux\\": 2
163166
}
164167
}
165168
}

0 commit comments

Comments
 (0)