Skip to content

Commit

Permalink
build: 1.0.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 28, 2017
1 parent f5d9523 commit afa35d3
Show file tree
Hide file tree
Showing 5 changed files with 14,933 additions and 52 deletions.
43 changes: 30 additions & 13 deletions dist/vue-test-utils.amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3384,6 +3384,18 @@ Wrapper.prototype.trigger = function trigger (type, options) {
this.update();
};

function logEvents (vm, emitted, emittedByOrder) {
var emit = vm.$emit;
vm.$emit = function (name) {
var args = [], len = arguments.length - 1;
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];

(emitted[name] || (emitted[name] = [])).push(args);
emittedByOrder.push({ name: name, args: args });
return emit.call.apply(emit, [ vm, name ].concat( args ))
};
}

//

function update () {
Expand All @@ -3402,12 +3414,24 @@ var VueWrapper = (function (Wrapper$$1) {

this.vm = vm;
this.isVueComponent = true;
this._emitted = Object.create(null);
this._emittedByOrder = [];

logEvents(vm, this._emitted, this._emittedByOrder);
}

if ( Wrapper$$1 ) VueWrapper.__proto__ = Wrapper$$1;
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
VueWrapper.prototype.constructor = VueWrapper;

VueWrapper.prototype.emitted = function emitted () {
return this._emitted
};

VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
return this._emittedByOrder
};

return VueWrapper;
}(Wrapper));

Expand Down Expand Up @@ -3457,14 +3481,10 @@ function addSlots (vm, slots) {

//

function createInterceptPlugin (interceptedProperties) {
return {
install: function (Vue$$1) {
Object.keys(interceptedProperties).forEach(function (key) {
Vue$$1.prototype[key] = interceptedProperties[key];
});
}
}
function addMocks (mockedProperties, Vue$$1) {
Object.keys(mockedProperties).forEach(function (key) {
Vue$$1.prototype[key] = mockedProperties[key];
});
}

function addAttrs (vm, attrs) {
Expand Down Expand Up @@ -3542,11 +3562,8 @@ function createConstructor (component, options) {

var Constructor = vue.extend(component);

if (options.intercept) {
// creates a plugin that adds properties, and then install on local Constructor
// this does not affect the base Vue class
var interceptPlugin = createInterceptPlugin(options.intercept);
Constructor.use(interceptPlugin);
if (options.mocks) {
addMocks(options.mocks, Constructor);
}

var vm = new Constructor(options);
Expand Down
43 changes: 30 additions & 13 deletions dist/vue-test-utils.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -3385,6 +3385,18 @@ Wrapper.prototype.trigger = function trigger (type, options) {
this.update();
};

function logEvents (vm, emitted, emittedByOrder) {
var emit = vm.$emit;
vm.$emit = function (name) {
var args = [], len = arguments.length - 1;
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];

(emitted[name] || (emitted[name] = [])).push(args);
emittedByOrder.push({ name: name, args: args });
return emit.call.apply(emit, [ vm, name ].concat( args ))
};
}

//

function update () {
Expand All @@ -3403,12 +3415,24 @@ var VueWrapper = (function (Wrapper$$1) {

this.vm = vm;
this.isVueComponent = true;
this._emitted = Object.create(null);
this._emittedByOrder = [];

logEvents(vm, this._emitted, this._emittedByOrder);
}

if ( Wrapper$$1 ) VueWrapper.__proto__ = Wrapper$$1;
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
VueWrapper.prototype.constructor = VueWrapper;

VueWrapper.prototype.emitted = function emitted () {
return this._emitted
};

VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
return this._emittedByOrder
};

return VueWrapper;
}(Wrapper));

Expand Down Expand Up @@ -3458,14 +3482,10 @@ function addSlots (vm, slots) {

//

function createInterceptPlugin (interceptedProperties) {
return {
install: function (Vue$$1) {
Object.keys(interceptedProperties).forEach(function (key) {
Vue$$1.prototype[key] = interceptedProperties[key];
});
}
}
function addMocks (mockedProperties, Vue$$1) {
Object.keys(mockedProperties).forEach(function (key) {
Vue$$1.prototype[key] = mockedProperties[key];
});
}

function addAttrs (vm, attrs) {
Expand Down Expand Up @@ -3543,11 +3563,8 @@ function createConstructor (component, options) {

var Constructor = vue.extend(component);

if (options.intercept) {
// creates a plugin that adds properties, and then install on local Constructor
// this does not affect the base Vue class
var interceptPlugin = createInterceptPlugin(options.intercept);
Constructor.use(interceptPlugin);
if (options.mocks) {
addMocks(options.mocks, Constructor);
}

var vm = new Constructor(options);
Expand Down
43 changes: 30 additions & 13 deletions dist/vue-test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,18 @@ Wrapper.prototype.trigger = function trigger (type, options) {
this.update();
};

function logEvents (vm, emitted, emittedByOrder) {
var emit = vm.$emit;
vm.$emit = function (name) {
var args = [], len = arguments.length - 1;
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];

(emitted[name] || (emitted[name] = [])).push(args);
emittedByOrder.push({ name: name, args: args });
return emit.call.apply(emit, [ vm, name ].concat( args ))
};
}

//

function update () {
Expand All @@ -873,12 +885,24 @@ var VueWrapper = (function (Wrapper$$1) {

this.vm = vm;
this.isVueComponent = true;
this._emitted = Object.create(null);
this._emittedByOrder = [];

logEvents(vm, this._emitted, this._emittedByOrder);
}

if ( Wrapper$$1 ) VueWrapper.__proto__ = Wrapper$$1;
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
VueWrapper.prototype.constructor = VueWrapper;

VueWrapper.prototype.emitted = function emitted () {
return this._emitted
};

VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
return this._emittedByOrder
};

return VueWrapper;
}(Wrapper));

Expand Down Expand Up @@ -928,14 +952,10 @@ function addSlots (vm, slots) {

//

function createInterceptPlugin (interceptedProperties) {
return {
install: function (Vue$$1) {
Object.keys(interceptedProperties).forEach(function (key) {
Vue$$1.prototype[key] = interceptedProperties[key];
});
}
}
function addMocks (mockedProperties, Vue$$1) {
Object.keys(mockedProperties).forEach(function (key) {
Vue$$1.prototype[key] = mockedProperties[key];
});
}

function addAttrs (vm, attrs) {
Expand Down Expand Up @@ -1013,11 +1033,8 @@ function createConstructor (component, options) {

var Constructor = vue.extend(component);

if (options.intercept) {
// creates a plugin that adds properties, and then install on local Constructor
// this does not affect the base Vue class
var interceptPlugin = createInterceptPlugin(options.intercept);
Constructor.use(interceptPlugin);
if (options.mocks) {
addMocks(options.mocks, Constructor);
}

var vm = new Constructor(options);
Expand Down
43 changes: 30 additions & 13 deletions dist/vue-test-utils.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3388,6 +3388,18 @@ Wrapper.prototype.trigger = function trigger (type, options) {
this.update();
};

function logEvents (vm, emitted, emittedByOrder) {
var emit = vm.$emit;
vm.$emit = function (name) {
var args = [], len = arguments.length - 1;
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];

(emitted[name] || (emitted[name] = [])).push(args);
emittedByOrder.push({ name: name, args: args });
return emit.call.apply(emit, [ vm, name ].concat( args ))
};
}

//

function update () {
Expand All @@ -3406,12 +3418,24 @@ var VueWrapper = (function (Wrapper$$1) {

this.vm = vm;
this.isVueComponent = true;
this._emitted = Object.create(null);
this._emittedByOrder = [];

logEvents(vm, this._emitted, this._emittedByOrder);
}

if ( Wrapper$$1 ) VueWrapper.__proto__ = Wrapper$$1;
VueWrapper.prototype = Object.create( Wrapper$$1 && Wrapper$$1.prototype );
VueWrapper.prototype.constructor = VueWrapper;

VueWrapper.prototype.emitted = function emitted () {
return this._emitted
};

VueWrapper.prototype.emittedByOrder = function emittedByOrder () {
return this._emittedByOrder
};

return VueWrapper;
}(Wrapper));

Expand Down Expand Up @@ -3461,14 +3485,10 @@ function addSlots (vm, slots) {

//

function createInterceptPlugin (interceptedProperties) {
return {
install: function (Vue$$1) {
Object.keys(interceptedProperties).forEach(function (key) {
Vue$$1.prototype[key] = interceptedProperties[key];
});
}
}
function addMocks (mockedProperties, Vue$$1) {
Object.keys(mockedProperties).forEach(function (key) {
Vue$$1.prototype[key] = mockedProperties[key];
});
}

function addAttrs (vm, attrs) {
Expand Down Expand Up @@ -3546,11 +3566,8 @@ function createConstructor (component, options) {

var Constructor = vue.extend(component);

if (options.intercept) {
// creates a plugin that adds properties, and then install on local Constructor
// this does not affect the base Vue class
var interceptPlugin = createInterceptPlugin(options.intercept);
Constructor.use(interceptPlugin);
if (options.mocks) {
addMocks(options.mocks, Constructor);
}

var vm = new Constructor(options);
Expand Down
Loading

0 comments on commit afa35d3

Please sign in to comment.