Skip to content

Commit 5d51668

Browse files
committed
chore(release): add dist files 1.0.0-beta.32
1 parent 228cd1a commit 5d51668

File tree

4 files changed

+169
-133
lines changed

4 files changed

+169
-133
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -2458,8 +2458,14 @@ function createInstance(
24582458
// root instance when it's instantiated
24592459
var instanceOptions = extractInstanceOptions(options);
24602460

2461+
var globalComponents = _Vue.options.components || {};
2462+
var componentsToStub = Object.assign(
2463+
Object.create(globalComponents),
2464+
componentOptions.components
2465+
);
2466+
24612467
var stubComponentsObject = createStubsFromStubsObject(
2462-
componentOptions.components,
2468+
componentsToStub,
24632469
// $FlowIgnore
24642470
options.stubs,
24652471
_Vue

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

+54-44
Original file line numberDiff line numberDiff line change
@@ -2527,8 +2527,14 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
25272527
// root instance when it's instantiated
25282528
var instanceOptions = extractInstanceOptions(options);
25292529

2530+
var globalComponents = _Vue.options.components || {};
2531+
var componentsToStub = Object.assign(
2532+
Object.create(globalComponents),
2533+
componentOptions.components
2534+
);
2535+
25302536
var stubComponentsObject = createStubsFromStubsObject(
2531-
componentOptions.components,
2537+
componentsToStub,
25322538
// $FlowIgnore
25332539
options.stubs,
25342540
_Vue
@@ -10628,63 +10634,67 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
1062810634
Wrapper.prototype.setProps = function setProps (data) {
1062910635
var this$1 = this;
1063010636

10631-
var originalConfig = Vue.config.silent;
10632-
Vue.config.silent = config.silent;
10637+
// Validate the setProps method call
1063310638
if (this.isFunctionalComponent) {
1063410639
throwError(
1063510640
"wrapper.setProps() cannot be called on a functional component"
1063610641
);
1063710642
}
10643+
1063810644
if (!this.vm) {
1063910645
throwError("wrapper.setProps() can only be called on a Vue instance");
1064010646
}
1064110647

10642-
Object.keys(data).forEach(function (key) {
10643-
if (
10644-
typeof data[key] === 'object' &&
10645-
data[key] !== null &&
10646-
// $FlowIgnore : Problem with possibly null this.vm
10647-
data[key] === this$1.vm[key]
10648-
) {
10649-
throwError(
10650-
"wrapper.setProps() called with the same object of the existing " +
10651-
key + " property. You must call wrapper.setProps() with a new " +
10652-
"object to trigger reactivity"
10653-
);
10654-
}
10655-
if (
10656-
!this$1.vm ||
10657-
!this$1.vm.$options._propKeys ||
10658-
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10659-
) {
10660-
if (VUE_VERSION > 2.3) {
10648+
// Save the original "silent" config so that we can directly mutate props
10649+
var originalConfig = Vue.config.silent;
10650+
Vue.config.silent = config.silent;
10651+
10652+
try {
10653+
Object.keys(data).forEach(function (key) {
10654+
// Don't let people set entire objects, because reactivity won't work
10655+
if (
10656+
typeof data[key] === 'object' &&
10657+
data[key] !== null &&
1066110658
// $FlowIgnore : Problem with possibly null this.vm
10662-
this$1.vm.$attrs[key] = data[key];
10663-
return
10659+
data[key] === this$1.vm[key]
10660+
) {
10661+
throwError(
10662+
"wrapper.setProps() called with the same object of the existing " +
10663+
key + " property. You must call wrapper.setProps() with a new " +
10664+
"object to trigger reactivity"
10665+
);
1066410666
}
10665-
throwError(
10666-
"wrapper.setProps() called with " + key + " property which " +
10667-
"is not defined on the component"
10668-
);
10669-
}
1067010667

10671-
if (this$1.vm && this$1.vm._props) {
10672-
// Set actual props value
10673-
this$1.vm._props[key] = data[key];
10674-
// $FlowIgnore : Problem with possibly null this.vm
10675-
this$1.vm[key] = data[key];
10676-
} else {
10677-
// $FlowIgnore : Problem with possibly null this.vm.$options
10678-
this$1.vm.$options.propsData[key] = data[key];
10668+
if (
10669+
!this$1.vm ||
10670+
!this$1.vm.$options._propKeys ||
10671+
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10672+
) {
10673+
if (VUE_VERSION > 2.3) {
10674+
// $FlowIgnore : Problem with possibly null this.vm
10675+
this$1.vm.$attrs[key] = data[key];
10676+
return
10677+
}
10678+
throwError(
10679+
"wrapper.setProps() called with " + key + " property which " +
10680+
"is not defined on the component"
10681+
);
10682+
}
10683+
10684+
// Actually set the prop
1067910685
// $FlowIgnore : Problem with possibly null this.vm
1068010686
this$1.vm[key] = data[key];
10681-
// $FlowIgnore : Need to call this twice to fix watcher bug in 2.0.x
10682-
this$1.vm[key] = data[key];
10683-
}
10684-
});
10685-
// $FlowIgnore : Problem with possibly null this.vm
10686-
this.vm.$forceUpdate();
10687-
Vue.config.silent = originalConfig;
10687+
});
10688+
10689+
// $FlowIgnore : Problem with possibly null this.vm
10690+
this.vm.$forceUpdate();
10691+
} catch (err) {
10692+
throw err
10693+
} finally {
10694+
// Ensure you teardown the modifications you made to the user's config
10695+
// After all the props are set, then reset the state
10696+
Vue.config.silent = originalConfig;
10697+
}
1068810698
};
1068910699

1069010700
/**

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

+54-44
Original file line numberDiff line numberDiff line change
@@ -2531,8 +2531,14 @@ function createInstance(
25312531
// root instance when it's instantiated
25322532
var instanceOptions = extractInstanceOptions(options);
25332533

2534+
var globalComponents = _Vue.options.components || {};
2535+
var componentsToStub = Object.assign(
2536+
Object.create(globalComponents),
2537+
componentOptions.components
2538+
);
2539+
25342540
var stubComponentsObject = createStubsFromStubsObject(
2535-
componentOptions.components,
2541+
componentsToStub,
25362542
// $FlowIgnore
25372543
options.stubs,
25382544
_Vue
@@ -10632,63 +10638,67 @@ Wrapper.prototype.setMethods = function setMethods (methods) {
1063210638
Wrapper.prototype.setProps = function setProps (data) {
1063310639
var this$1 = this;
1063410640

10635-
var originalConfig = Vue.config.silent;
10636-
Vue.config.silent = config.silent;
10641+
// Validate the setProps method call
1063710642
if (this.isFunctionalComponent) {
1063810643
throwError(
1063910644
"wrapper.setProps() cannot be called on a functional component"
1064010645
);
1064110646
}
10647+
1064210648
if (!this.vm) {
1064310649
throwError("wrapper.setProps() can only be called on a Vue instance");
1064410650
}
1064510651

10646-
Object.keys(data).forEach(function (key) {
10647-
if (
10648-
typeof data[key] === 'object' &&
10649-
data[key] !== null &&
10650-
// $FlowIgnore : Problem with possibly null this.vm
10651-
data[key] === this$1.vm[key]
10652-
) {
10653-
throwError(
10654-
"wrapper.setProps() called with the same object of the existing " +
10655-
key + " property. You must call wrapper.setProps() with a new " +
10656-
"object to trigger reactivity"
10657-
);
10658-
}
10659-
if (
10660-
!this$1.vm ||
10661-
!this$1.vm.$options._propKeys ||
10662-
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10663-
) {
10664-
if (VUE_VERSION > 2.3) {
10652+
// Save the original "silent" config so that we can directly mutate props
10653+
var originalConfig = Vue.config.silent;
10654+
Vue.config.silent = config.silent;
10655+
10656+
try {
10657+
Object.keys(data).forEach(function (key) {
10658+
// Don't let people set entire objects, because reactivity won't work
10659+
if (
10660+
typeof data[key] === 'object' &&
10661+
data[key] !== null &&
1066510662
// $FlowIgnore : Problem with possibly null this.vm
10666-
this$1.vm.$attrs[key] = data[key];
10667-
return
10663+
data[key] === this$1.vm[key]
10664+
) {
10665+
throwError(
10666+
"wrapper.setProps() called with the same object of the existing " +
10667+
key + " property. You must call wrapper.setProps() with a new " +
10668+
"object to trigger reactivity"
10669+
);
1066810670
}
10669-
throwError(
10670-
"wrapper.setProps() called with " + key + " property which " +
10671-
"is not defined on the component"
10672-
);
10673-
}
1067410671

10675-
if (this$1.vm && this$1.vm._props) {
10676-
// Set actual props value
10677-
this$1.vm._props[key] = data[key];
10678-
// $FlowIgnore : Problem with possibly null this.vm
10679-
this$1.vm[key] = data[key];
10680-
} else {
10681-
// $FlowIgnore : Problem with possibly null this.vm.$options
10682-
this$1.vm.$options.propsData[key] = data[key];
10672+
if (
10673+
!this$1.vm ||
10674+
!this$1.vm.$options._propKeys ||
10675+
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10676+
) {
10677+
if (VUE_VERSION > 2.3) {
10678+
// $FlowIgnore : Problem with possibly null this.vm
10679+
this$1.vm.$attrs[key] = data[key];
10680+
return
10681+
}
10682+
throwError(
10683+
"wrapper.setProps() called with " + key + " property which " +
10684+
"is not defined on the component"
10685+
);
10686+
}
10687+
10688+
// Actually set the prop
1068310689
// $FlowIgnore : Problem with possibly null this.vm
1068410690
this$1.vm[key] = data[key];
10685-
// $FlowIgnore : Need to call this twice to fix watcher bug in 2.0.x
10686-
this$1.vm[key] = data[key];
10687-
}
10688-
});
10689-
// $FlowIgnore : Problem with possibly null this.vm
10690-
this.vm.$forceUpdate();
10691-
Vue.config.silent = originalConfig;
10691+
});
10692+
10693+
// $FlowIgnore : Problem with possibly null this.vm
10694+
this.vm.$forceUpdate();
10695+
} catch (err) {
10696+
throw err
10697+
} finally {
10698+
// Ensure you teardown the modifications you made to the user's config
10699+
// After all the props are set, then reset the state
10700+
Vue.config.silent = originalConfig;
10701+
}
1069210702
};
1069310703

1069410704
/**

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

+54-44
Original file line numberDiff line numberDiff line change
@@ -2530,8 +2530,14 @@
25302530
// root instance when it's instantiated
25312531
var instanceOptions = extractInstanceOptions(options);
25322532

2533+
var globalComponents = _Vue.options.components || {};
2534+
var componentsToStub = Object.assign(
2535+
Object.create(globalComponents),
2536+
componentOptions.components
2537+
);
2538+
25332539
var stubComponentsObject = createStubsFromStubsObject(
2534-
componentOptions.components,
2540+
componentsToStub,
25352541
// $FlowIgnore
25362542
options.stubs,
25372543
_Vue
@@ -10631,63 +10637,67 @@
1063110637
Wrapper.prototype.setProps = function setProps (data) {
1063210638
var this$1 = this;
1063310639

10634-
var originalConfig = Vue.config.silent;
10635-
Vue.config.silent = config.silent;
10640+
// Validate the setProps method call
1063610641
if (this.isFunctionalComponent) {
1063710642
throwError(
1063810643
"wrapper.setProps() cannot be called on a functional component"
1063910644
);
1064010645
}
10646+
1064110647
if (!this.vm) {
1064210648
throwError("wrapper.setProps() can only be called on a Vue instance");
1064310649
}
1064410650

10645-
Object.keys(data).forEach(function (key) {
10646-
if (
10647-
typeof data[key] === 'object' &&
10648-
data[key] !== null &&
10649-
// $FlowIgnore : Problem with possibly null this.vm
10650-
data[key] === this$1.vm[key]
10651-
) {
10652-
throwError(
10653-
"wrapper.setProps() called with the same object of the existing " +
10654-
key + " property. You must call wrapper.setProps() with a new " +
10655-
"object to trigger reactivity"
10656-
);
10657-
}
10658-
if (
10659-
!this$1.vm ||
10660-
!this$1.vm.$options._propKeys ||
10661-
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10662-
) {
10663-
if (VUE_VERSION > 2.3) {
10651+
// Save the original "silent" config so that we can directly mutate props
10652+
var originalConfig = Vue.config.silent;
10653+
Vue.config.silent = config.silent;
10654+
10655+
try {
10656+
Object.keys(data).forEach(function (key) {
10657+
// Don't let people set entire objects, because reactivity won't work
10658+
if (
10659+
typeof data[key] === 'object' &&
10660+
data[key] !== null &&
1066410661
// $FlowIgnore : Problem with possibly null this.vm
10665-
this$1.vm.$attrs[key] = data[key];
10666-
return
10662+
data[key] === this$1.vm[key]
10663+
) {
10664+
throwError(
10665+
"wrapper.setProps() called with the same object of the existing " +
10666+
key + " property. You must call wrapper.setProps() with a new " +
10667+
"object to trigger reactivity"
10668+
);
1066710669
}
10668-
throwError(
10669-
"wrapper.setProps() called with " + key + " property which " +
10670-
"is not defined on the component"
10671-
);
10672-
}
1067310670

10674-
if (this$1.vm && this$1.vm._props) {
10675-
// Set actual props value
10676-
this$1.vm._props[key] = data[key];
10677-
// $FlowIgnore : Problem with possibly null this.vm
10678-
this$1.vm[key] = data[key];
10679-
} else {
10680-
// $FlowIgnore : Problem with possibly null this.vm.$options
10681-
this$1.vm.$options.propsData[key] = data[key];
10671+
if (
10672+
!this$1.vm ||
10673+
!this$1.vm.$options._propKeys ||
10674+
!this$1.vm.$options._propKeys.some(function (prop) { return prop === key; })
10675+
) {
10676+
if (VUE_VERSION > 2.3) {
10677+
// $FlowIgnore : Problem with possibly null this.vm
10678+
this$1.vm.$attrs[key] = data[key];
10679+
return
10680+
}
10681+
throwError(
10682+
"wrapper.setProps() called with " + key + " property which " +
10683+
"is not defined on the component"
10684+
);
10685+
}
10686+
10687+
// Actually set the prop
1068210688
// $FlowIgnore : Problem with possibly null this.vm
1068310689
this$1.vm[key] = data[key];
10684-
// $FlowIgnore : Need to call this twice to fix watcher bug in 2.0.x
10685-
this$1.vm[key] = data[key];
10686-
}
10687-
});
10688-
// $FlowIgnore : Problem with possibly null this.vm
10689-
this.vm.$forceUpdate();
10690-
Vue.config.silent = originalConfig;
10690+
});
10691+
10692+
// $FlowIgnore : Problem with possibly null this.vm
10693+
this.vm.$forceUpdate();
10694+
} catch (err) {
10695+
throw err
10696+
} finally {
10697+
// Ensure you teardown the modifications you made to the user's config
10698+
// After all the props are set, then reset the state
10699+
Vue.config.silent = originalConfig;
10700+
}
1069110701
};
1069210702

1069310703
/**

0 commit comments

Comments
 (0)