Skip to content

Commit dc7a1b1

Browse files
committed
chore: publish 1.1.2
1 parent 890b153 commit dc7a1b1

File tree

5 files changed

+41
-149
lines changed

5 files changed

+41
-149
lines changed

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
],
66
"npmClient": "yarn",
77
"useWorkspaces": true,
8-
"version": "1.1.1"
8+
"version": "1.1.2"
99
}

packages/server-test-utils/dist/vue-server-test-utils.js

+10-37
Original file line numberDiff line numberDiff line change
@@ -13454,28 +13454,6 @@ function getCoreProperties(componentOptions) {
1345413454
}
1345513455
}
1345613456

13457-
function createClassString(staticClass, dynamicClass) {
13458-
// :class="someComputedObject" can return a string, object or undefined
13459-
// if it is a string, we don't need to do anything special.
13460-
var evaluatedDynamicClass = dynamicClass;
13461-
13462-
// if it is an object, eg { 'foo': true }, we need to evaluate it.
13463-
// see https://github.com/vuejs/vue-test-utils/issues/1474 for more context.
13464-
if (typeof dynamicClass === 'object') {
13465-
evaluatedDynamicClass = Object.keys(dynamicClass).reduce(function (acc, key) {
13466-
if (dynamicClass[key]) {
13467-
return acc + ' ' + key
13468-
}
13469-
return acc
13470-
}, '');
13471-
}
13472-
13473-
if (staticClass && evaluatedDynamicClass) {
13474-
return staticClass + ' ' + evaluatedDynamicClass
13475-
}
13476-
return staticClass || evaluatedDynamicClass
13477-
}
13478-
1347913457
function resolveOptions(component, _Vue) {
1348013458
if (isDynamicComponent(component)) {
1348113459
return {}
@@ -13528,20 +13506,13 @@ function createStubFromComponent(
1352813506

1352913507
return h(
1353013508
tagName,
13531-
{
13532-
ref: componentOptions.functional ? context.data.ref : undefined,
13533-
domProps: componentOptions.functional
13534-
? context.data.domProps
13535-
: undefined,
13536-
attrs: componentOptions.functional
13537-
? Object.assign({}, context.props,
13538-
context.data.attrs,
13539-
{class: createClassString(
13540-
context.data.staticClass,
13541-
context.data.class
13542-
)})
13543-
: Object.assign({}, this.$props)
13544-
},
13509+
componentOptions.functional
13510+
? Object.assign({}, context.data,
13511+
{attrs: Object.assign({}, context.props,
13512+
context.data.attrs)})
13513+
: {
13514+
attrs: Object.assign({}, this.$props)
13515+
},
1354513516
context
1354613517
? context.children
1354713518
: this.$options._renderChildren ||
@@ -13838,8 +13809,10 @@ function createInstance(
1383813809
};
1383913810

1384013811
// options "propsData" can only be used during instance creation with the `new` keyword
13812+
// "data" should be set only on component under test to avoid reactivity issues
1384113813
var propsData = options.propsData;
13842-
var rest$1 = objectWithoutProperties( options, ["propsData"] );
13814+
var data = options.data;
13815+
var rest$1 = objectWithoutProperties( options, ["propsData", "data"] );
1384313816
var rest = rest$1; // eslint-disable-line
1384413817
var Parent = _Vue.extend(Object.assign({}, rest,
1384513818
parentComponentOptions));

packages/test-utils/dist/vue-test-utils.iife.js

+10-37
Original file line numberDiff line numberDiff line change
@@ -2281,28 +2281,6 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
22812281
}
22822282
}
22832283

2284-
function createClassString(staticClass, dynamicClass) {
2285-
// :class="someComputedObject" can return a string, object or undefined
2286-
// if it is a string, we don't need to do anything special.
2287-
var evaluatedDynamicClass = dynamicClass;
2288-
2289-
// if it is an object, eg { 'foo': true }, we need to evaluate it.
2290-
// see https://github.com/vuejs/vue-test-utils/issues/1474 for more context.
2291-
if (typeof dynamicClass === 'object') {
2292-
evaluatedDynamicClass = Object.keys(dynamicClass).reduce(function (acc, key) {
2293-
if (dynamicClass[key]) {
2294-
return acc + ' ' + key
2295-
}
2296-
return acc
2297-
}, '');
2298-
}
2299-
2300-
if (staticClass && evaluatedDynamicClass) {
2301-
return staticClass + ' ' + evaluatedDynamicClass
2302-
}
2303-
return staticClass || evaluatedDynamicClass
2304-
}
2305-
23062284
function resolveOptions(component, _Vue) {
23072285
if (isDynamicComponent(component)) {
23082286
return {}
@@ -2355,20 +2333,13 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
23552333

23562334
return h(
23572335
tagName,
2358-
{
2359-
ref: componentOptions.functional ? context.data.ref : undefined,
2360-
domProps: componentOptions.functional
2361-
? context.data.domProps
2362-
: undefined,
2363-
attrs: componentOptions.functional
2364-
? Object.assign({}, context.props,
2365-
context.data.attrs,
2366-
{class: createClassString(
2367-
context.data.staticClass,
2368-
context.data.class
2369-
)})
2370-
: Object.assign({}, this.$props)
2371-
},
2336+
componentOptions.functional
2337+
? Object.assign({}, context.data,
2338+
{attrs: Object.assign({}, context.props,
2339+
context.data.attrs)})
2340+
: {
2341+
attrs: Object.assign({}, this.$props)
2342+
},
23722343
context
23732344
? context.children
23742345
: this.$options._renderChildren ||
@@ -2665,8 +2636,10 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
26652636
};
26662637

26672638
// options "propsData" can only be used during instance creation with the `new` keyword
2639+
// "data" should be set only on component under test to avoid reactivity issues
26682640
var propsData = options.propsData;
2669-
var rest$1 = objectWithoutProperties( options, ["propsData"] );
2641+
var data = options.data;
2642+
var rest$1 = objectWithoutProperties( options, ["propsData", "data"] );
26702643
var rest = rest$1; // eslint-disable-line
26712644
var Parent = _Vue.extend(Object.assign({}, rest,
26722645
parentComponentOptions));

packages/test-utils/dist/vue-test-utils.js

+10-37
Original file line numberDiff line numberDiff line change
@@ -2285,28 +2285,6 @@ function getCoreProperties(componentOptions) {
22852285
}
22862286
}
22872287

2288-
function createClassString(staticClass, dynamicClass) {
2289-
// :class="someComputedObject" can return a string, object or undefined
2290-
// if it is a string, we don't need to do anything special.
2291-
var evaluatedDynamicClass = dynamicClass;
2292-
2293-
// if it is an object, eg { 'foo': true }, we need to evaluate it.
2294-
// see https://github.com/vuejs/vue-test-utils/issues/1474 for more context.
2295-
if (typeof dynamicClass === 'object') {
2296-
evaluatedDynamicClass = Object.keys(dynamicClass).reduce(function (acc, key) {
2297-
if (dynamicClass[key]) {
2298-
return acc + ' ' + key
2299-
}
2300-
return acc
2301-
}, '');
2302-
}
2303-
2304-
if (staticClass && evaluatedDynamicClass) {
2305-
return staticClass + ' ' + evaluatedDynamicClass
2306-
}
2307-
return staticClass || evaluatedDynamicClass
2308-
}
2309-
23102288
function resolveOptions(component, _Vue) {
23112289
if (isDynamicComponent(component)) {
23122290
return {}
@@ -2359,20 +2337,13 @@ function createStubFromComponent(
23592337

23602338
return h(
23612339
tagName,
2362-
{
2363-
ref: componentOptions.functional ? context.data.ref : undefined,
2364-
domProps: componentOptions.functional
2365-
? context.data.domProps
2366-
: undefined,
2367-
attrs: componentOptions.functional
2368-
? Object.assign({}, context.props,
2369-
context.data.attrs,
2370-
{class: createClassString(
2371-
context.data.staticClass,
2372-
context.data.class
2373-
)})
2374-
: Object.assign({}, this.$props)
2375-
},
2340+
componentOptions.functional
2341+
? Object.assign({}, context.data,
2342+
{attrs: Object.assign({}, context.props,
2343+
context.data.attrs)})
2344+
: {
2345+
attrs: Object.assign({}, this.$props)
2346+
},
23762347
context
23772348
? context.children
23782349
: this.$options._renderChildren ||
@@ -2669,8 +2640,10 @@ function createInstance(
26692640
};
26702641

26712642
// options "propsData" can only be used during instance creation with the `new` keyword
2643+
// "data" should be set only on component under test to avoid reactivity issues
26722644
var propsData = options.propsData;
2673-
var rest$1 = objectWithoutProperties( options, ["propsData"] );
2645+
var data = options.data;
2646+
var rest$1 = objectWithoutProperties( options, ["propsData", "data"] );
26742647
var rest = rest$1; // eslint-disable-line
26752648
var Parent = _Vue.extend(Object.assign({}, rest,
26762649
parentComponentOptions));

packages/test-utils/dist/vue-test-utils.umd.js

+10-37
Original file line numberDiff line numberDiff line change
@@ -2284,28 +2284,6 @@
22842284
}
22852285
}
22862286

2287-
function createClassString(staticClass, dynamicClass) {
2288-
// :class="someComputedObject" can return a string, object or undefined
2289-
// if it is a string, we don't need to do anything special.
2290-
var evaluatedDynamicClass = dynamicClass;
2291-
2292-
// if it is an object, eg { 'foo': true }, we need to evaluate it.
2293-
// see https://github.com/vuejs/vue-test-utils/issues/1474 for more context.
2294-
if (typeof dynamicClass === 'object') {
2295-
evaluatedDynamicClass = Object.keys(dynamicClass).reduce(function (acc, key) {
2296-
if (dynamicClass[key]) {
2297-
return acc + ' ' + key
2298-
}
2299-
return acc
2300-
}, '');
2301-
}
2302-
2303-
if (staticClass && evaluatedDynamicClass) {
2304-
return staticClass + ' ' + evaluatedDynamicClass
2305-
}
2306-
return staticClass || evaluatedDynamicClass
2307-
}
2308-
23092287
function resolveOptions(component, _Vue) {
23102288
if (isDynamicComponent(component)) {
23112289
return {}
@@ -2358,20 +2336,13 @@
23582336

23592337
return h(
23602338
tagName,
2361-
{
2362-
ref: componentOptions.functional ? context.data.ref : undefined,
2363-
domProps: componentOptions.functional
2364-
? context.data.domProps
2365-
: undefined,
2366-
attrs: componentOptions.functional
2367-
? Object.assign({}, context.props,
2368-
context.data.attrs,
2369-
{class: createClassString(
2370-
context.data.staticClass,
2371-
context.data.class
2372-
)})
2373-
: Object.assign({}, this.$props)
2374-
},
2339+
componentOptions.functional
2340+
? Object.assign({}, context.data,
2341+
{attrs: Object.assign({}, context.props,
2342+
context.data.attrs)})
2343+
: {
2344+
attrs: Object.assign({}, this.$props)
2345+
},
23752346
context
23762347
? context.children
23772348
: this.$options._renderChildren ||
@@ -2668,8 +2639,10 @@
26682639
};
26692640

26702641
// options "propsData" can only be used during instance creation with the `new` keyword
2642+
// "data" should be set only on component under test to avoid reactivity issues
26712643
var propsData = options.propsData;
2672-
var rest$1 = objectWithoutProperties( options, ["propsData"] );
2644+
var data = options.data;
2645+
var rest$1 = objectWithoutProperties( options, ["propsData", "data"] );
26732646
var rest = rest$1; // eslint-disable-line
26742647
var Parent = _Vue.extend(Object.assign({}, rest,
26752648
parentComponentOptions));

0 commit comments

Comments
 (0)