Migrate -transform-object-super tests to use jest expect assertions
This commit is contained in:
parent
8a31eabf5e
commit
d7987fbbd2
@ -12,5 +12,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -12,5 +12,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -20,5 +20,5 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const Base = {
|
const Base = {
|
||||||
get test() {
|
get test() {
|
||||||
assert.equal(this, obj);
|
expect(this).toBe(obj);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -15,5 +15,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const Base = {
|
const Base = {
|
||||||
get test() {
|
get test() {
|
||||||
assert.equal(this, obj);
|
expect(this).toBe(obj);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -15,5 +15,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || functio
|
|||||||
|
|
||||||
const Base = {
|
const Base = {
|
||||||
get test() {
|
get test() {
|
||||||
assert.equal(this, obj);
|
expect(this).toBe(obj);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,5 +24,5 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), 1);
|
expect(obj.get()).toBe(1);
|
||||||
|
|||||||
@ -11,5 +11,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -11,5 +11,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -18,5 +18,5 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -14,5 +14,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -14,5 +14,5 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -23,5 +23,5 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
assert.equal(obj.get(), undefined);
|
expect(obj.get()).toBeUndefined();
|
||||||
|
|||||||
@ -12,6 +12,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -12,6 +12,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, 3);
|
expect(Base.test).toBe(3);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -24,6 +24,6 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, 3);
|
expect(Base.test).toBe(3);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -16,6 +16,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -15,6 +15,6 @@ var obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -16,8 +16,8 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -16,9 +16,9 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(called, false);
|
expect(called).toBe(false);
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -14,10 +14,10 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
// this requires helpers to be in file (not external), so they
|
// this requires helpers to be in file (not external), so they
|
||||||
// are in "strict" mode code.
|
// are in "strict" mode code.
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -27,10 +27,10 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
// this requires helpers to be in file (not external), so they
|
// this requires helpers to be in file (not external), so they
|
||||||
// are in "strict" mode code.
|
// are in "strict" mode code.
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, 1);
|
expect(Base.test).toBe(1);
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -15,11 +15,11 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, false);
|
expect(desc.configurable).toBe(false);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -15,11 +15,11 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, false);
|
expect(desc.configurable).toBe(false);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -26,10 +26,10 @@ Object.defineProperty(obj, 'test', {
|
|||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, false);
|
expect(desc.configurable).toBe(false);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -15,11 +15,11 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, false);
|
expect(desc.enumerable).toBe(false);
|
||||||
|
|||||||
@ -15,11 +15,11 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, false);
|
expect(desc.enumerable).toBe(false);
|
||||||
|
|||||||
@ -26,10 +26,10 @@ Object.defineProperty(obj, 'test', {
|
|||||||
enumerable: false
|
enumerable: false
|
||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, true);
|
expect(desc.writable).toBe(true);
|
||||||
assert.equal(desc.enumerable, false);
|
expect(desc.enumerable).toBe(false);
|
||||||
|
|||||||
@ -14,11 +14,11 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, false);
|
expect(desc.writable).toBe(false);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -15,13 +15,13 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, false);
|
expect(desc.writable).toBe(false);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -15,13 +15,13 @@ Object.defineProperty(obj, 'test', {
|
|||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, false);
|
expect(desc.writable).toBe(false);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -26,12 +26,12 @@ Object.defineProperty(obj, 'test', {
|
|||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
const desc = Object.getOwnPropertyDescriptor(obj, 'test');
|
||||||
assert.equal(desc.configurable, true);
|
expect(desc.configurable).toBe(true);
|
||||||
assert.equal(desc.writable, false);
|
expect(desc.writable).toBe(false);
|
||||||
assert.equal(desc.enumerable, true);
|
expect(desc.enumerable).toBe(true);
|
||||||
|
|||||||
@ -11,6 +11,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -11,6 +11,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -22,6 +22,6 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ var obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(called, false);
|
expect(called).toBe(false);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -14,9 +14,9 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(called, false);
|
expect(called).toBe(false);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -11,10 +11,10 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
// this requires helpers to be in file (not external), so they
|
// this requires helpers to be in file (not external), so they
|
||||||
// are in "strict" mode code.
|
// are in "strict" mode code.
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -22,10 +22,10 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
// this requires helpers to be in file (not external), so they
|
// this requires helpers to be in file (not external), so they
|
||||||
// are in "strict" mode code.
|
// are in "strict" mode code.
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -9,6 +9,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -9,6 +9,6 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -20,6 +20,6 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 3);
|
expect(obj.test).toBe(3);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ var obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(value, 2);
|
expect(value).toBe(2);
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -14,9 +14,9 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.throws(() => {
|
expect(() => {
|
||||||
obj.set();
|
obj.set();
|
||||||
});
|
}).toThrow();
|
||||||
assert.equal(value, 2);
|
expect(value).toBe(2);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -5,7 +5,7 @@ const Base = {
|
|||||||
let value = 2;
|
let value = 2;
|
||||||
const obj = {
|
const obj = {
|
||||||
set test(v) {
|
set test(v) {
|
||||||
assert.equal(this, obj);
|
expect(this).toBe(obj);
|
||||||
value = v;
|
value = v;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(value, 3);
|
expect(value).toBe(3);
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const Base = {};
|
|||||||
let value = 2;
|
let value = 2;
|
||||||
const obj = _obj = {
|
const obj = _obj = {
|
||||||
set test(v) {
|
set test(v) {
|
||||||
assert.equal(this, obj);
|
expect(this).toBe(obj);
|
||||||
value = v;
|
value = v;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(value, 3);
|
expect(value).toBe(3);
|
||||||
assert.equal(obj.test, undefined);
|
expect(obj.test).toBeUndefined();
|
||||||
|
|||||||
@ -15,7 +15,7 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(value, 3);
|
expect(value).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -15,7 +15,7 @@ const obj = {
|
|||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
|
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(value, 3);
|
expect(value).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ const obj = _obj = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
Object.setPrototypeOf(obj, Base);
|
Object.setPrototypeOf(obj, Base);
|
||||||
assert.equal(obj.set(), 3);
|
expect(obj.set()).toBe(3);
|
||||||
assert.equal(value, 3);
|
expect(value).toBe(3);
|
||||||
assert.equal(Base.test, undefined);
|
expect(Base.test).toBeUndefined();
|
||||||
assert.equal(obj.test, 2);
|
expect(obj.test).toBe(2);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user