update tests

pull/709/head
Rich Harris 7 years ago
parent 0a806585b3
commit 3f73f252ac

@ -115,9 +115,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -91,9 +91,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -124,9 +124,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -109,9 +109,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -115,9 +115,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -115,9 +115,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -103,9 +103,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {
@ -194,9 +197,13 @@ function SvelteComponent ( options ) {
this._fragment.mount( options.target, null );
}
callAll(this._beforecreate);
callAll(this._oncreate);
callAll(this._aftercreate);
if ( !options._root ) {
this._block = true;
callAll(this._beforecreate);
callAll(this._oncreate);
callAll(this._aftercreate);
this._block = false;
}
}
assign( SvelteComponent.prototype, proto );

@ -76,9 +76,13 @@ function SvelteComponent ( options ) {
this._fragment.mount( options.target, null );
}
callAll(this._beforecreate);
callAll(this._oncreate);
callAll(this._aftercreate);
if ( !options._root ) {
this._block = true;
callAll(this._beforecreate);
callAll(this._oncreate);
callAll(this._aftercreate);
this._block = false;
}
}
assign( SvelteComponent.prototype, proto );

@ -91,9 +91,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {
@ -159,7 +162,10 @@ function SvelteComponent ( options ) {
this._fragment.create();
this._fragment.mount( options.target, null );
}
callAll(this._oncreate);
if ( !options._root ) {
callAll(this._oncreate);
}
}
assign( SvelteComponent.prototype, proto );

@ -51,7 +51,10 @@ function SvelteComponent ( options ) {
this._fragment.create();
this._fragment.mount( options.target, null );
}
callAll(this._oncreate);
if ( !options._root ) {
callAll(this._oncreate);
}
}
assign( SvelteComponent.prototype, proto );

@ -115,9 +115,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._block) return;
this._root._block = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._block = false;
}
function callAll(fns) {

@ -137,10 +137,9 @@ describe("runtime", () => {
throw err;
}
let usedObjectAssign = false;
Object.assign = () => {
throw new Error(
"cannot use Object.assign in generated code, as it is not supported everywhere"
);
usedObjectAssign = true;
};
global.window = window;
@ -182,14 +181,18 @@ describe("runtime", () => {
assert.htmlEqual(target.innerHTML, config.html);
}
Object.assign = Object_assign;
if (config.test) {
config.test(assert, component, target, window, raf);
} else {
component.destroy();
assert.equal(target.innerHTML, "");
}
if (usedObjectAssign) {
throw new Error(
"cannot use Object.assign in generated code, as it is not supported everywhere"
);
}
})
.catch(err => {
Object.assign = Object_assign;

Loading…
Cancel
Save