Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 456b30b

Browse files
LittleSoundsxzz
authored andcommitted
chore: rename test and variable name
1 parent de64d7b commit 456b30b

File tree

2 files changed

+30
-34
lines changed

2 files changed

+30
-34
lines changed

packages/compiler-vapor/__tests__/transforms/__snapshots__/vBind.spec.ts.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`compiler: transform v-bind > .camel modifier 1`] = `
3+
exports[`compiler v-bind > .camel modifier 1`] = `
44
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
55
66
export function render(_ctx) {
@@ -14,7 +14,7 @@ export function render(_ctx) {
1414
}"
1515
`;
1616

17-
exports[`compiler: transform v-bind > .camel modifier w/ dynamic arg 1`] = `
17+
exports[`compiler v-bind > .camel modifier w/ dynamic arg 1`] = `
1818
"import { camelize as _camelize } from 'vue';
1919
2020
export function render(_ctx) {
@@ -28,7 +28,7 @@ export function render(_ctx) {
2828
}"
2929
`;
3030

31-
exports[`compiler: transform v-bind > .camel modifier w/ no expression 1`] = `
31+
exports[`compiler v-bind > .camel modifier w/ no expression 1`] = `
3232
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
3333
3434
export function render(_ctx) {
@@ -42,7 +42,7 @@ export function render(_ctx) {
4242
}"
4343
`;
4444

45-
exports[`compiler: transform v-bind > basic 1`] = `
45+
exports[`compiler v-bind > basic 1`] = `
4646
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
4747
4848
export function render(_ctx) {
@@ -56,7 +56,7 @@ export function render(_ctx) {
5656
}"
5757
`;
5858

59-
exports[`compiler: transform v-bind > dynamic arg 1`] = `
59+
exports[`compiler v-bind > dynamic arg 1`] = `
6060
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
6161
6262
export function render(_ctx) {
@@ -70,7 +70,7 @@ export function render(_ctx) {
7070
}"
7171
`;
7272

73-
exports[`compiler: transform v-bind > no expression (shorthand) 1`] = `
73+
exports[`compiler v-bind > no expression (shorthand) 1`] = `
7474
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
7575
7676
export function render(_ctx) {
@@ -84,7 +84,7 @@ export function render(_ctx) {
8484
}"
8585
`;
8686

87-
exports[`compiler: transform v-bind > no expression 1`] = `
87+
exports[`compiler v-bind > no expression 1`] = `
8888
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
8989
9090
export function render(_ctx) {
@@ -98,7 +98,7 @@ export function render(_ctx) {
9898
}"
9999
`;
100100

101-
exports[`compiler: transform v-bind > should error if empty expression 1`] = `
101+
exports[`compiler v-bind > should error if empty expression 1`] = `
102102
"import { template as _template } from 'vue/vapor';
103103
104104
export function render(_ctx) {

packages/compiler-vapor/__tests__/transforms/vBind.spec.ts

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ function compileWithVBind(
3434
return { ir, code }
3535
}
3636

37-
describe('compiler: transform v-bind', () => {
37+
describe('compiler v-bind', () => {
3838
test('basic', () => {
39-
const { ir: node, code } = compileWithVBind(`<div v-bind:id="id"/>`)
39+
const { ir, code } = compileWithVBind(`<div v-bind:id="id"/>`)
4040

41-
expect(node.dynamic.children[0]).toMatchObject({
41+
expect(ir.dynamic.children[0]).toMatchObject({
4242
id: 1,
4343
referenced: true,
4444
})
45-
expect(node.template[0]).toMatchObject({
45+
expect(ir.template[0]).toMatchObject({
4646
type: IRNodeTypes.TEMPLATE_FACTORY,
4747
template: '<div></div>',
4848
})
49-
expect(node.effect).lengthOf(1)
50-
expect(node.effect[0].expressions).lengthOf(1)
51-
expect(node.effect[0].operations).lengthOf(1)
52-
expect(node.effect[0]).toMatchObject({
49+
expect(ir.effect).lengthOf(1)
50+
expect(ir.effect[0].expressions).lengthOf(1)
51+
expect(ir.effect[0].operations).lengthOf(1)
52+
expect(ir.effect[0]).toMatchObject({
5353
expressions: [
5454
{
5555
type: NodeTypes.SIMPLE_EXPRESSION,
@@ -89,9 +89,9 @@ describe('compiler: transform v-bind', () => {
8989
})
9090

9191
test('no expression', () => {
92-
const { ir: node, code } = compileWithVBind(`<div v-bind:id />`)
92+
const { ir, code } = compileWithVBind(`<div v-bind:id />`)
9393

94-
expect(node.effect[0].operations[0]).toMatchObject({
94+
expect(ir.effect[0].operations[0]).toMatchObject({
9595
type: IRNodeTypes.SET_PROP,
9696
key: {
9797
content: `id`,
@@ -116,9 +116,9 @@ describe('compiler: transform v-bind', () => {
116116
})
117117

118118
test('no expression (shorthand)', () => {
119-
const { ir: node, code } = compileWithVBind(`<div :camel-case />`)
119+
const { ir, code } = compileWithVBind(`<div :camel-case />`)
120120

121-
expect(node.effect[0].operations[0]).toMatchObject({
121+
expect(ir.effect[0].operations[0]).toMatchObject({
122122
type: IRNodeTypes.SET_PROP,
123123
key: {
124124
content: `camel-case`,
@@ -137,8 +137,8 @@ describe('compiler: transform v-bind', () => {
137137
})
138138

139139
test('dynamic arg', () => {
140-
const { ir: node, code } = compileWithVBind(`<div v-bind:[id]="id"/>`)
141-
expect(node.effect[0].operations[0]).toMatchObject({
140+
const { ir, code } = compileWithVBind(`<div v-bind:[id]="id"/>`)
141+
expect(ir.effect[0].operations[0]).toMatchObject({
142142
type: IRNodeTypes.SET_PROP,
143143
element: 1,
144144
key: {
@@ -159,7 +159,7 @@ describe('compiler: transform v-bind', () => {
159159

160160
test('should error if empty expression', () => {
161161
const onError = vi.fn()
162-
const { ir: node, code } = compileWithVBind(`<div v-bind:arg="" />`, {
162+
const { ir, code } = compileWithVBind(`<div v-bind:arg="" />`, {
163163
onError,
164164
})
165165

@@ -170,7 +170,7 @@ describe('compiler: transform v-bind', () => {
170170
end: { line: 1, column: 19 },
171171
},
172172
})
173-
expect(node.template[0]).toMatchObject({
173+
expect(ir.template[0]).toMatchObject({
174174
type: IRNodeTypes.TEMPLATE_FACTORY,
175175
template: '<div arg=""></div>',
176176
})
@@ -180,11 +180,9 @@ describe('compiler: transform v-bind', () => {
180180
})
181181

182182
test('.camel modifier', () => {
183-
const { ir: node, code } = compileWithVBind(
184-
`<div v-bind:foo-bar.camel="id"/>`,
185-
)
183+
const { ir, code } = compileWithVBind(`<div v-bind:foo-bar.camel="id"/>`)
186184

187-
expect(node.effect[0].operations[0]).toMatchObject({
185+
expect(ir.effect[0].operations[0]).toMatchObject({
188186
key: {
189187
content: `fooBar`,
190188
isStatic: true,
@@ -200,9 +198,9 @@ describe('compiler: transform v-bind', () => {
200198
})
201199

202200
test('.camel modifier w/ no expression', () => {
203-
const { ir: node, code } = compileWithVBind(`<div v-bind:foo-bar.camel />`)
201+
const { ir, code } = compileWithVBind(`<div v-bind:foo-bar.camel />`)
204202

205-
expect(node.effect[0].operations[0]).toMatchObject({
203+
expect(ir.effect[0].operations[0]).toMatchObject({
206204
key: {
207205
content: `fooBar`,
208206
isStatic: true,
@@ -219,11 +217,9 @@ describe('compiler: transform v-bind', () => {
219217
})
220218

221219
test('.camel modifier w/ dynamic arg', () => {
222-
const { ir: node, code } = compileWithVBind(
223-
`<div v-bind:[foo].camel="id"/>`,
224-
)
220+
const { ir, code } = compileWithVBind(`<div v-bind:[foo].camel="id"/>`)
225221

226-
expect(node.effect[0].operations[0]).toMatchObject({
222+
expect(ir.effect[0].operations[0]).toMatchObject({
227223
runtimeCamelize: true,
228224
key: {
229225
content: `foo`,

0 commit comments

Comments
 (0)