Skip to content

Commit 8599242

Browse files
committed
wip(vitest-migration): compiler-dom tests passing
1 parent 5804406 commit 8599242

File tree

8 files changed

+109
-96
lines changed

8 files changed

+109
-96
lines changed

packages/compiler-dom/__tests__/__snapshots__/index.spec.ts.snap

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

3-
exports[`compile should contain standard transforms 1`] = `
3+
exports[`compile > should contain standard transforms 1`] = `
44
"const _Vue = Vue
55
66
return function render(_ctx, _cache) {
77
with (_ctx) {
88
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, normalizeStyle: _normalizeStyle, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
99
1010
return (_openBlock(), _createElementBlock(_Fragment, null, [
11-
_createElementVNode("div", {
11+
_createElementVNode(\\"div\\", {
1212
textContent: _toDisplayString(text)
13-
}, null, 8 /* PROPS */, ["textContent"]),
14-
_createElementVNode("div", { innerHTML: html }, null, 8 /* PROPS */, ["innerHTML"]),
15-
_createElementVNode("div", null, "test"),
16-
_createElementVNode("div", { style: {"color":"red"} }, "red"),
17-
_createElementVNode("div", {
13+
}, null, 8 /* PROPS */, [\\"textContent\\"]),
14+
_createElementVNode(\\"div\\", { innerHTML: html }, null, 8 /* PROPS */, [\\"innerHTML\\"]),
15+
_createElementVNode(\\"div\\", null, \\"test\\"),
16+
_createElementVNode(\\"div\\", { style: {\\"color\\":\\"red\\"} }, \\"red\\"),
17+
_createElementVNode(\\"div\\", {
1818
style: _normalizeStyle({color: 'green'})
1919
}, null, 4 /* STYLE */)
2020
], 64 /* STABLE_FRAGMENT */))

packages/compiler-dom/__tests__/decoderHtmlBrowser.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 { decodeHtmlBrowser } from '../src/decodeHtmlBrowser'
25

36
describe('decodeHtmlBrowser', () => {

packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap

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

33
exports[`inject persisted when child has v-show 1`] = `
44
"const _Vue = Vue
@@ -7,9 +7,9 @@ return function render(_ctx, _cache) {
77
with (_ctx) {
88
const { vShow: _vShow, createElementVNode: _createElementVNode, withDirectives: _withDirectives, Transition: _Transition, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = _Vue
99
10-
return (_openBlock(), _createBlock(_Transition, { persisted: "" }, {
10+
return (_openBlock(), _createBlock(_Transition, { persisted: \\"\\" }, {
1111
default: _withCtx(() => [
12-
_withDirectives(_createElementVNode("div", null, null, 512 /* NEED_PATCH */), [
12+
_withDirectives(_createElementVNode(\\"div\\", null, null, 512 /* NEED_PATCH */), [
1313
[_vShow, ok]
1414
])
1515
]),
@@ -29,15 +29,15 @@ return function render(_ctx, _cache) {
2929
return (_openBlock(), _createBlock(_Transition, null, {
3030
default: _withCtx(() => [
3131
a
32-
? (_openBlock(), _createElementBlock("div", { key: 0 }, "hey"))
32+
? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"hey\\"))
3333
: b
34-
? (_openBlock(), _createElementBlock("div", { key: 1 }, "hey"))
35-
: (_openBlock(), _createElementBlock("div", { key: 2 }, [
34+
? (_openBlock(), _createElementBlock(\\"div\\", { key: 1 }, \\"hey\\"))
35+
: (_openBlock(), _createElementBlock(\\"div\\", { key: 2 }, [
3636
c
37-
? (_openBlock(), _createElementBlock("p", { key: 0 }))
37+
? (_openBlock(), _createElementBlock(\\"p\\", { key: 0 }))
3838
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
39-
_createCommentVNode(" this should not be ignored "),
40-
_createElementVNode("p")
39+
_createCommentVNode(\\" this should not be ignored \\"),
40+
_createElementVNode(\\"p\\")
4141
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
4242
]))
4343
]),

packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap

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

3-
exports[`stringify static html should bail on bindings that are hoisted but not stringifiable 1`] = `
3+
exports[`stringify static html > should bail on bindings that are hoisted but not stringifiable 1`] = `
44
"const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
55
6-
const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", null, [
7-
/*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
8-
/*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
9-
/*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
10-
/*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
11-
/*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
12-
/*#__PURE__*/_createElementVNode("img", { src: _imports_0_ })
6+
const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, [
7+
/*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
8+
/*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
9+
/*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
10+
/*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
11+
/*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
12+
/*#__PURE__*/_createElementVNode(\\"img\\", { src: _imports_0_ })
1313
], -1 /* HOISTED */)
1414
const _hoisted_2 = [
1515
_hoisted_1
1616
]
1717
1818
return function render(_ctx, _cache) {
19-
return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
19+
return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
2020
}"
2121
`;
2222
23-
exports[`stringify static html should work with bindings that are non-static but stringifiable 1`] = `
23+
exports[`stringify static html > should work with bindings that are non-static but stringifiable 1`] = `
2424
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
2525
26-
const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<div><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><img src=\\"" + _imports_0_ + "\\"></div>", 1)
26+
const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<div><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><img src=\\\\\\"\\" + _imports_0_ + \\"\\\\\\"></div>\\", 1)
2727
const _hoisted_2 = [
2828
_hoisted_1
2929
]
3030
3131
return function render(_ctx, _cache) {
32-
return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
32+
return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
3333
}"
3434
`;
3535
36-
exports[`stringify static html stringify v-html 1`] = `
36+
exports[`stringify static html > stringify v-html 1`] = `
3737
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
3838
39-
const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<pre data-type=\\"js\\"><code><span>show-it </span></code></pre><div class><span class>1</span><span class>2</span></div>", 2)
39+
const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<pre data-type=\\\\\\"js\\\\\\"><code><span>show-it </span></code></pre><div class><span class>1</span><span class>2</span></div>\\", 2)
4040
4141
return function render(_ctx, _cache) {
4242
return _hoisted_1
4343
}"
4444
`;
4545
46-
exports[`stringify static html stringify v-text 1`] = `
46+
exports[`stringify static html > stringify v-text 1`] = `
4747
"const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
4848
49-
const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<pre data-type=\\"js\\"><code>&lt;span&gt;show-it &lt;/span&gt;</code></pre><div class><span class>1</span><span class>2</span></div>", 2)
49+
const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<pre data-type=\\\\\\"js\\\\\\"><code>&lt;span&gt;show-it &lt;/span&gt;</code></pre><div class><span class>1</span><span class>2</span></div>\\", 2)
5050
5151
return function render(_ctx, _cache) {
5252
return _hoisted_1

0 commit comments

Comments
 (0)