Skip to content

Commit ecd3aa1

Browse files
committed
build: 1.0.0-beta.1
1 parent 21d619d commit ecd3aa1

File tree

4 files changed

+164
-40
lines changed

4 files changed

+164
-40
lines changed

dist/vue-test-utils.amd.js

+41-10
Original file line numberDiff line numberDiff line change
@@ -2823,11 +2823,22 @@ WrapperArray.prototype.contains = function contains (selector) {
28232823

28242824
return this.wrappers.every(function (wrapper) { return wrapper.contains(selector); })
28252825
};
2826-
28272826
WrapperArray.prototype.exists = function exists () {
28282827
return this.wrappers.length > 0
28292828
};
28302829

2830+
WrapperArray.prototype.emitted = function emitted () {
2831+
this.throwErrorIfWrappersIsEmpty('emitted');
2832+
2833+
throwError('emitted must be called on a single wrapper, use at(i) to access a wrapper');
2834+
};
2835+
2836+
WrapperArray.prototype.emittedByOrder = function emittedByOrder () {
2837+
this.throwErrorIfWrappersIsEmpty('emittedByOrder');
2838+
2839+
throwError('emittedByOrder must be called on a single wrapper, use at(i) to access a wrapper');
2840+
};
2841+
28312842
WrapperArray.prototype.hasAttribute = function hasAttribute (attribute, value) {
28322843
this.throwErrorIfWrappersIsEmpty('hasAttribute');
28332844

@@ -2949,6 +2960,14 @@ ErrorWrapper.prototype.contains = function contains () {
29492960
throwError(("find did not return " + (this.selector) + ", cannot call contains() on empty Wrapper"));
29502961
};
29512962

2963+
ErrorWrapper.prototype.emitted = function emitted () {
2964+
throwError(("find did not return " + (this.selector) + ", cannot call emitted() on empty Wrapper"));
2965+
};
2966+
2967+
ErrorWrapper.prototype.emittedByOrder = function emittedByOrder () {
2968+
throwError(("find did not return " + (this.selector) + ", cannot call emittedByOrder() on empty Wrapper"));
2969+
};
2970+
29522971
ErrorWrapper.prototype.exists = function exists () {
29532972
return false
29542973
};
@@ -3054,6 +3073,26 @@ Wrapper.prototype.contains = function contains (selector) {
30543073
return false
30553074
};
30563075

3076+
/**
3077+
* Returns an object containing custom events emitted by the Wrapper vm
3078+
*/
3079+
Wrapper.prototype.emitted = function emitted () {
3080+
if (!this._emitted && !this.vm) {
3081+
throwError('wrapper.emitted() can only be called on a Vue instance');
3082+
}
3083+
return this._emitted
3084+
};
3085+
3086+
/**
3087+
* Returns an Array containing custom events emitted by the Wrapper vm
3088+
*/
3089+
Wrapper.prototype.emittedByOrder = function emittedByOrder () {
3090+
if (!this._emittedByOrder && !this.vm) {
3091+
throwError('wrapper.emittedByOrder() can only be called on a Vue instance');
3092+
}
3093+
return this._emittedByOrder
3094+
};
3095+
30573096
/**
30583097
* Utility to check wrapper exists. Returns true as Wrapper always exists
30593098
*/
@@ -3139,7 +3178,7 @@ Wrapper.prototype.hasStyle = function hasStyle (style, value) {
31393178

31403179
var elStyle = window.getComputedStyle(this.element)[style];
31413180
var mockNodeStyle = window.getComputedStyle(mockNode)[style];
3142-
return elStyle === mockNodeStyle
3181+
return !!(elStyle && mockNodeStyle && elStyle === mockNodeStyle)
31433182
};
31443183

31453184
/**
@@ -3424,14 +3463,6 @@ var VueWrapper = (function (Wrapper$$1) {
34243463
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
34253464
VueWrapper.prototype.constructor = VueWrapper;
34263465

3427-
VueWrapper.prototype.emitted = function emitted () {
3428-
return this._emitted
3429-
};
3430-
3431-
VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
3432-
return this._emittedByOrder
3433-
};
3434-
34353466
return VueWrapper;
34363467
}(Wrapper));
34373468

dist/vue-test-utils.iife.js

+41-10
Original file line numberDiff line numberDiff line change
@@ -2824,11 +2824,22 @@ WrapperArray.prototype.contains = function contains (selector) {
28242824

28252825
return this.wrappers.every(function (wrapper) { return wrapper.contains(selector); })
28262826
};
2827-
28282827
WrapperArray.prototype.exists = function exists () {
28292828
return this.wrappers.length > 0
28302829
};
28312830

2831+
WrapperArray.prototype.emitted = function emitted () {
2832+
this.throwErrorIfWrappersIsEmpty('emitted');
2833+
2834+
throwError('emitted must be called on a single wrapper, use at(i) to access a wrapper');
2835+
};
2836+
2837+
WrapperArray.prototype.emittedByOrder = function emittedByOrder () {
2838+
this.throwErrorIfWrappersIsEmpty('emittedByOrder');
2839+
2840+
throwError('emittedByOrder must be called on a single wrapper, use at(i) to access a wrapper');
2841+
};
2842+
28322843
WrapperArray.prototype.hasAttribute = function hasAttribute (attribute, value) {
28332844
this.throwErrorIfWrappersIsEmpty('hasAttribute');
28342845

@@ -2950,6 +2961,14 @@ ErrorWrapper.prototype.contains = function contains () {
29502961
throwError(("find did not return " + (this.selector) + ", cannot call contains() on empty Wrapper"));
29512962
};
29522963

2964+
ErrorWrapper.prototype.emitted = function emitted () {
2965+
throwError(("find did not return " + (this.selector) + ", cannot call emitted() on empty Wrapper"));
2966+
};
2967+
2968+
ErrorWrapper.prototype.emittedByOrder = function emittedByOrder () {
2969+
throwError(("find did not return " + (this.selector) + ", cannot call emittedByOrder() on empty Wrapper"));
2970+
};
2971+
29532972
ErrorWrapper.prototype.exists = function exists () {
29542973
return false
29552974
};
@@ -3055,6 +3074,26 @@ Wrapper.prototype.contains = function contains (selector) {
30553074
return false
30563075
};
30573076

3077+
/**
3078+
* Returns an object containing custom events emitted by the Wrapper vm
3079+
*/
3080+
Wrapper.prototype.emitted = function emitted () {
3081+
if (!this._emitted && !this.vm) {
3082+
throwError('wrapper.emitted() can only be called on a Vue instance');
3083+
}
3084+
return this._emitted
3085+
};
3086+
3087+
/**
3088+
* Returns an Array containing custom events emitted by the Wrapper vm
3089+
*/
3090+
Wrapper.prototype.emittedByOrder = function emittedByOrder () {
3091+
if (!this._emittedByOrder && !this.vm) {
3092+
throwError('wrapper.emittedByOrder() can only be called on a Vue instance');
3093+
}
3094+
return this._emittedByOrder
3095+
};
3096+
30583097
/**
30593098
* Utility to check wrapper exists. Returns true as Wrapper always exists
30603099
*/
@@ -3140,7 +3179,7 @@ Wrapper.prototype.hasStyle = function hasStyle (style, value) {
31403179

31413180
var elStyle = window.getComputedStyle(this.element)[style];
31423181
var mockNodeStyle = window.getComputedStyle(mockNode)[style];
3143-
return elStyle === mockNodeStyle
3182+
return !!(elStyle && mockNodeStyle && elStyle === mockNodeStyle)
31443183
};
31453184

31463185
/**
@@ -3425,14 +3464,6 @@ var VueWrapper = (function (Wrapper$$1) {
34253464
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
34263465
VueWrapper.prototype.constructor = VueWrapper;
34273466

3428-
VueWrapper.prototype.emitted = function emitted () {
3429-
return this._emitted
3430-
};
3431-
3432-
VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
3433-
return this._emittedByOrder
3434-
};
3435-
34363467
return VueWrapper;
34373468
}(Wrapper));
34383469

dist/vue-test-utils.js

+41-10
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,22 @@ WrapperArray.prototype.contains = function contains (selector) {
294294

295295
return this.wrappers.every(function (wrapper) { return wrapper.contains(selector); })
296296
};
297-
298297
WrapperArray.prototype.exists = function exists () {
299298
return this.wrappers.length > 0
300299
};
301300

301+
WrapperArray.prototype.emitted = function emitted () {
302+
this.throwErrorIfWrappersIsEmpty('emitted');
303+
304+
throwError('emitted must be called on a single wrapper, use at(i) to access a wrapper');
305+
};
306+
307+
WrapperArray.prototype.emittedByOrder = function emittedByOrder () {
308+
this.throwErrorIfWrappersIsEmpty('emittedByOrder');
309+
310+
throwError('emittedByOrder must be called on a single wrapper, use at(i) to access a wrapper');
311+
};
312+
302313
WrapperArray.prototype.hasAttribute = function hasAttribute (attribute, value) {
303314
this.throwErrorIfWrappersIsEmpty('hasAttribute');
304315

@@ -420,6 +431,14 @@ ErrorWrapper.prototype.contains = function contains () {
420431
throwError(("find did not return " + (this.selector) + ", cannot call contains() on empty Wrapper"));
421432
};
422433

434+
ErrorWrapper.prototype.emitted = function emitted () {
435+
throwError(("find did not return " + (this.selector) + ", cannot call emitted() on empty Wrapper"));
436+
};
437+
438+
ErrorWrapper.prototype.emittedByOrder = function emittedByOrder () {
439+
throwError(("find did not return " + (this.selector) + ", cannot call emittedByOrder() on empty Wrapper"));
440+
};
441+
423442
ErrorWrapper.prototype.exists = function exists () {
424443
return false
425444
};
@@ -525,6 +544,26 @@ Wrapper.prototype.contains = function contains (selector) {
525544
return false
526545
};
527546

547+
/**
548+
* Returns an object containing custom events emitted by the Wrapper vm
549+
*/
550+
Wrapper.prototype.emitted = function emitted () {
551+
if (!this._emitted && !this.vm) {
552+
throwError('wrapper.emitted() can only be called on a Vue instance');
553+
}
554+
return this._emitted
555+
};
556+
557+
/**
558+
* Returns an Array containing custom events emitted by the Wrapper vm
559+
*/
560+
Wrapper.prototype.emittedByOrder = function emittedByOrder () {
561+
if (!this._emittedByOrder && !this.vm) {
562+
throwError('wrapper.emittedByOrder() can only be called on a Vue instance');
563+
}
564+
return this._emittedByOrder
565+
};
566+
528567
/**
529568
* Utility to check wrapper exists. Returns true as Wrapper always exists
530569
*/
@@ -610,7 +649,7 @@ Wrapper.prototype.hasStyle = function hasStyle (style, value) {
610649

611650
var elStyle = window.getComputedStyle(this.element)[style];
612651
var mockNodeStyle = window.getComputedStyle(mockNode)[style];
613-
return elStyle === mockNodeStyle
652+
return !!(elStyle && mockNodeStyle && elStyle === mockNodeStyle)
614653
};
615654

616655
/**
@@ -895,14 +934,6 @@ var VueWrapper = (function (Wrapper$$1) {
895934
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
896935
VueWrapper.prototype.constructor = VueWrapper;
897936

898-
VueWrapper.prototype.emitted = function emitted () {
899-
return this._emitted
900-
};
901-
902-
VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
903-
return this._emittedByOrder
904-
};
905-
906937
return VueWrapper;
907938
}(Wrapper));
908939

dist/vue-test-utils.umd.js

+41-10
Original file line numberDiff line numberDiff line change
@@ -2827,11 +2827,22 @@ WrapperArray.prototype.contains = function contains (selector) {
28272827

28282828
return this.wrappers.every(function (wrapper) { return wrapper.contains(selector); })
28292829
};
2830-
28312830
WrapperArray.prototype.exists = function exists () {
28322831
return this.wrappers.length > 0
28332832
};
28342833

2834+
WrapperArray.prototype.emitted = function emitted () {
2835+
this.throwErrorIfWrappersIsEmpty('emitted');
2836+
2837+
throwError('emitted must be called on a single wrapper, use at(i) to access a wrapper');
2838+
};
2839+
2840+
WrapperArray.prototype.emittedByOrder = function emittedByOrder () {
2841+
this.throwErrorIfWrappersIsEmpty('emittedByOrder');
2842+
2843+
throwError('emittedByOrder must be called on a single wrapper, use at(i) to access a wrapper');
2844+
};
2845+
28352846
WrapperArray.prototype.hasAttribute = function hasAttribute (attribute, value) {
28362847
this.throwErrorIfWrappersIsEmpty('hasAttribute');
28372848

@@ -2953,6 +2964,14 @@ ErrorWrapper.prototype.contains = function contains () {
29532964
throwError(("find did not return " + (this.selector) + ", cannot call contains() on empty Wrapper"));
29542965
};
29552966

2967+
ErrorWrapper.prototype.emitted = function emitted () {
2968+
throwError(("find did not return " + (this.selector) + ", cannot call emitted() on empty Wrapper"));
2969+
};
2970+
2971+
ErrorWrapper.prototype.emittedByOrder = function emittedByOrder () {
2972+
throwError(("find did not return " + (this.selector) + ", cannot call emittedByOrder() on empty Wrapper"));
2973+
};
2974+
29562975
ErrorWrapper.prototype.exists = function exists () {
29572976
return false
29582977
};
@@ -3058,6 +3077,26 @@ Wrapper.prototype.contains = function contains (selector) {
30583077
return false
30593078
};
30603079

3080+
/**
3081+
* Returns an object containing custom events emitted by the Wrapper vm
3082+
*/
3083+
Wrapper.prototype.emitted = function emitted () {
3084+
if (!this._emitted && !this.vm) {
3085+
throwError('wrapper.emitted() can only be called on a Vue instance');
3086+
}
3087+
return this._emitted
3088+
};
3089+
3090+
/**
3091+
* Returns an Array containing custom events emitted by the Wrapper vm
3092+
*/
3093+
Wrapper.prototype.emittedByOrder = function emittedByOrder () {
3094+
if (!this._emittedByOrder && !this.vm) {
3095+
throwError('wrapper.emittedByOrder() can only be called on a Vue instance');
3096+
}
3097+
return this._emittedByOrder
3098+
};
3099+
30613100
/**
30623101
* Utility to check wrapper exists. Returns true as Wrapper always exists
30633102
*/
@@ -3143,7 +3182,7 @@ Wrapper.prototype.hasStyle = function hasStyle (style, value) {
31433182

31443183
var elStyle = window.getComputedStyle(this.element)[style];
31453184
var mockNodeStyle = window.getComputedStyle(mockNode)[style];
3146-
return elStyle === mockNodeStyle
3185+
return !!(elStyle && mockNodeStyle && elStyle === mockNodeStyle)
31473186
};
31483187

31493188
/**
@@ -3428,14 +3467,6 @@ var VueWrapper = (function (Wrapper$$1) {
34283467
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
34293468
VueWrapper.prototype.constructor = VueWrapper;
34303469

3431-
VueWrapper.prototype.emitted = function emitted () {
3432-
return this._emitted
3433-
};
3434-
3435-
VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
3436-
return this._emittedByOrder
3437-
};
3438-
34393470
return VueWrapper;
34403471
}(Wrapper));
34413472

0 commit comments

Comments
 (0)