Migrate all remaining fixtures to jest expect

This commit is contained in:
Deven Bansod 2018-03-24 14:44:56 +05:30
parent db42a5d70f
commit c8d82d6483
265 changed files with 1763 additions and 1801 deletions

View File

@ -20,5 +20,5 @@ async function main() {
} }
return main().then(() => { return main().then(() => {
assert.deepEqual(actual, expected); expect(actual).toEqual(expected);
}); });

View File

@ -20,5 +20,5 @@ async function main() {
} }
return main().then(() => { return main().then(() => {
assert.deepEqual(actual, expected); expect(actual).toEqual(expected);
}); });

View File

@ -24,15 +24,15 @@ class MyClass {
const inst = new MyClass(); const inst = new MyClass();
const expectedOrder = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; const expectedOrder = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
assert.deepEqual(actualOrder, expectedOrder); expect(actualOrder).toEqual(expectedOrder);
assert.equal(MyClass[1], 10); expect(MyClass[1]).toBe(10);
assert.equal(inst[2], 13); expect(inst[2]).toBe(13);
assert.equal(inst[3], "foo"); expect(inst[3]).toBe("foo");
inst[4] = "baz"; inst[4] = "baz";
assert.equal(inst.bar, "baz"); expect(inst.bar).toBe("baz");
assert.equal(inst[5], 14); expect(inst[5]).toBe(14);
assert.equal(MyClass[6], 11); expect(MyClass[6]).toBe(11);
assert.equal(MyClass[7], 12); expect(MyClass[7]).toBe(12);
assert.ok(typeof inst[8] === "function"); expect(typeof inst[8]).toBe("function");
assert.equal(inst[9], 15); expect(inst[9]).toBe(15);

View File

@ -5,9 +5,9 @@ function test(x) {
} }
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -5,9 +5,9 @@ function test(x) {
} }
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -12,9 +12,9 @@ function test(x) {
}; };
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -2,6 +2,6 @@ var Foo = class {
static num = 0; static num = 0;
} }
assert.equal(Foo.num, 0); expect(Foo.num).toBe(0);
assert.equal(Foo.num = 1, 1); expect(Foo.num = 1).toBe(1);
assert.equal(Foo.name, "Foo"); expect(Foo.name).toBe("Foo");

View File

@ -2,5 +2,5 @@ class Foo {
static num; static num;
} }
assert.equal("num" in Foo, true); expect("num" in Foo).toBe(true);
assert.equal(Foo.num, undefined); expect(Foo.num).toBeUndefined();

View File

@ -3,7 +3,7 @@ class Foo {
static str = "foo"; static str = "foo";
} }
assert.equal(Foo.num, 0); expect(Foo.num).toBe(0);
assert.equal(Foo.num = 1, 1); expect(Foo.num = 1).toBe(1);
assert.equal(Foo.str, "foo"); expect(Foo.str).toBe("foo");
assert.equal(Foo.str = "bar", "bar"); expect(Foo.str = "bar").toBe("bar");

View File

@ -5,9 +5,9 @@ function test(x) {
} }
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -5,9 +5,9 @@ function test(x) {
} }
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -7,9 +7,9 @@ function test(x) {
}; };
x = 'deadbeef'; x = 'deadbeef';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
x = 'wrong'; x = 'wrong';
assert.strictEqual(new F().foo, 1); expect(new F().foo).toBe(1);
} }
test('foo'); test('foo');

View File

@ -2,6 +2,6 @@ var Foo = class {
static num = 0; static num = 0;
} }
assert.equal(Foo.num, 0); expect(Foo.num).toBe(0);
assert.equal(Foo.num = 1, 1); expect(Foo.num = 1).toBe(1);
assert.equal(Foo.name, "Foo"); expect(Foo.name).toBe("Foo");

View File

@ -2,5 +2,5 @@ class Foo {
static num; static num;
} }
assert.equal("num" in Foo, true); expect("num" in Foo).toBe(true);
assert.equal(Foo.num, undefined); expect(Foo.num).toBeUndefined();

View File

@ -3,7 +3,7 @@ class Foo {
static str = "foo"; static str = "foo";
} }
assert.equal(Foo.num, 0); expect(Foo.num).toBe(0);
assert.equal(Foo.num = 1, 1); expect(Foo.num = 1).toBe(1);
assert.equal(Foo.str, "foo"); expect(Foo.str).toBe("foo");
assert.equal(Foo.str = "bar", "bar"); expect(Foo.str = "bar").toBe("bar");

View File

@ -7,4 +7,4 @@ class Parent {
parent() {}; parent() {};
} }
assert.equal(Parent.staticProp, "prop"); expect(Parent.staticProp).toBe("prop");

View File

@ -9,5 +9,5 @@ class Parent {
parent(){} parent(){}
} }
assert.equal(typeof Parent.prototype.parent, "function") expect(typeof Parent.prototype.parent).toBe("function");
assert.equal(typeof Parent.prototype.child, "function") expect(typeof Parent.prototype.child).toBe("function");

View File

@ -11,4 +11,4 @@ export default class Foo {
} }
} }
assert.deepEqual(calls, ["Foo"]); expect(calls).toEqual(["Foo"]);

View File

@ -25,4 +25,4 @@ class Example {
prop2 = 2; prop2 = 2;
} }
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

View File

@ -26,4 +26,4 @@ class Example2 {
prop2 = 2; prop2 = 2;
} }
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -58,8 +58,8 @@ class Example {
} }
} }
assert(Example.prototype.hasOwnProperty('decoratedProps')); expect(Example.prototype.hasOwnProperty('decoratedProps'));
assert.deepEqual(Example.prototype.decoratedProps, [ expect(Example.prototype.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -74,42 +74,42 @@ const inst = new Example();
const descs = Object.getOwnPropertyDescriptors(Example.prototype); const descs = Object.getOwnPropertyDescriptors(Example.prototype);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite(), "__1__"); expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf(), "__2__"); expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite(), "__3__"); expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum(), "__4__"); expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite(), "__5__"); expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf(), "__6__"); expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write(), "__7__"); expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._(), "__8__"); expect(inst._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(name, 4); expect(name).toBe(4);
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
class Example { class Example {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -59,8 +59,8 @@ class Example {
} }
assert(Example.prototype.hasOwnProperty('decoratedProps')); expect(Example.prototype.hasOwnProperty('decoratedProps'));
assert.deepEqual(Example.prototype.decoratedProps, [ expect(Example.prototype.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -76,42 +76,42 @@ const inst = new Example();
const descs = Object.getOwnPropertyDescriptors(Example.prototype); const descs = Object.getOwnPropertyDescriptors(Example.prototype);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite(), "__1__"); expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf(), "__2__"); expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite(), "__3__"); expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum(), "__4__"); expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite(), "__5__"); expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf(), "__6__"); expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write(), "__7__"); expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._(), "__8__"); expect(inst._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(name, "str"); expect(name).toBe("str");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
class Example { class Example {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -23,5 +23,5 @@ class Example extends Base {
let inst = new Example(); let inst = new Example();
assert.equal(inst.prop, "__3__"); expect(inst.prop).toBe("__3__");
assert.equal(inst.prop2, "__4__"); expect(inst.prop2).toBe("__4__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -44,8 +44,8 @@ class Example {
const inst = new Example(); const inst = new Example();
assert(Example.prototype.hasOwnProperty("decoratedProps")); expect(Example.prototype.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -58,42 +58,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite, "__1__"); expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf, "__2__"); expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite, "__3__"); expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum, "__4__"); expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite, "__5__"); expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf, "__6__"); expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write, "__7__"); expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._, "__8__"); expect(inst._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, "prop"); expect(name).toBe("prop");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
let {initializer} = descriptor; let {initializer} = descriptor;
delete descriptor.initializer; delete descriptor.initializer;
@ -24,4 +24,4 @@ class Example {
let inst = new Example(); let inst = new Example();
assert.equal(inst.prop, "__3__"); expect(inst.prop).toBe("__3__");

View File

@ -7,5 +7,5 @@ class Example {
} }
let inst = new Example(); let inst = new Example();
assert(inst.hasOwnProperty("prop")); expect(inst.hasOwnProperty("prop")).toBe(true);
assert.equal(inst.prop, undefined); expect(inst.prop).toBeUndefined();

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -44,8 +44,8 @@ class Example {
const inst = new Example(); const inst = new Example();
assert(Example.prototype.hasOwnProperty("decoratedProps")); expect(Example.prototype.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -58,42 +58,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite, "__1__"); expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf, "__2__"); expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite, "__3__"); expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum, "__4__"); expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite, "__5__"); expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf, "__6__"); expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write, "__7__"); expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._, "__8__"); expect(inst._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -58,8 +58,8 @@ class Example {
} }
} }
assert(Example.hasOwnProperty("decoratedProps")); expect(Example.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(Example.decoratedProps, [ expect(Example.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -72,42 +72,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example); const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(Example.enumconfwrite(), "__1__"); expect(Example.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(Example.enumconf(), "__2__"); expect(Example.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(Example.enumwrite(), "__3__"); expect(Example.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(Example.enum(), "__4__"); expect(Example.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(Example.confwrite(), "__5__"); expect(Example.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(Example.conf(), "__6__"); expect(Example.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(Example.write(), "__7__"); expect(Example.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(Example._(), "__8__"); expect(Example._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, 4); expect(name).toBe(4);
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
class Example { class Example {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -59,8 +59,8 @@ class Example {
} }
assert(Example.hasOwnProperty("decoratedProps")); expect(Example.hasOwnProperty("decoratedProps"));
assert.deepEqual(Example.decoratedProps, [ expect(Example.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -73,42 +73,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example); const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(Example.enumconfwrite(), "__1__"); expect(Example.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(Example.enumconf(), "__2__"); expect(Example.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(Example.enumwrite(), "__3__"); expect(Example.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(Example.enum(), "__4__"); expect(Example.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable);
assert.equal(Example.confwrite(), "__5__"); expect(Example.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(Example.conf(), "__6__"); expect(Example.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(Example.write(), "__7__"); expect(Example.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(Example._(), "__8__"); expect(Example._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(name, "str"); expect(name).toBe("str");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
class Example { class Example {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -44,8 +44,8 @@ class Example {
const inst = new Example(); const inst = new Example();
assert(Example.hasOwnProperty("decoratedProps")); expect(Example.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(Example.decoratedProps, [ expect(Example.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -58,42 +58,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example); const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(Example.enumconfwrite, "__1__"); expect(Example.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(Example.enumconf, "__2__"); expect(Example.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(Example.enumwrite, "__3__"); expect(Example.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(Example.enum, "__4__"); expect(Example.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(Example.confwrite, "__5__"); expect(Example.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(Example.conf, "__6__"); expect(Example.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(Example.write, "__7__"); expect(Example.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(Example._, "__8__"); expect(Example._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, "prop"); expect(name).toBe("prop");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
let {initializer} = descriptor; let {initializer} = descriptor;
delete descriptor.initializer; delete descriptor.initializer;
@ -22,4 +22,4 @@ class Example {
static prop = 3; static prop = 3;
} }
assert.equal(Example.prop, "__3__"); expect(Example.prop).toBe("__3__");

View File

@ -6,5 +6,5 @@ class Example {
@dec static prop; @dec static prop;
} }
assert(Example.hasOwnProperty("prop")); expect(Example.hasOwnProperty("prop")).toBeTruthy();
assert.equal(Example.prop, undefined); expect(Example.prop).toBe(undefined);

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -44,8 +44,8 @@ class Example {
const inst = new Example(); const inst = new Example();
assert(Example.hasOwnProperty("decoratedProps")); expect(Example.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(Example.decoratedProps, [ expect(Example.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -58,42 +58,42 @@ assert.deepEqual(Example.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(Example); const descs = Object.getOwnPropertyDescriptors(Example);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(Example.enumconfwrite, "__1__"); expect(Example.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(Example.enumconf, "__2__"); expect(Example.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(Example.enumwrite, "__3__"); expect(Example.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(Example.enum, "__4__"); expect(Example.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(Example.confwrite, "__5__"); expect(Example.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable);
assert.equal(Example.conf, "__6__"); expect(Example.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(Example.write, "__7__"); expect(Example.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(Example._, "__8__"); expect(Example._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -58,8 +58,8 @@ const inst = {
}, },
} }
assert(inst.hasOwnProperty('decoratedProps')); expect(inst.hasOwnProperty('decoratedProps')).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -72,42 +72,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite(), "__1__"); expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf(), "__2__"); expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite(), "__3__"); expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum(), "__4__"); expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable);
assert.equal(inst.confwrite(), "__5__"); expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf(), "__6__"); expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write(), "__7__"); expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._(), "__8__"); expect(inst._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, 4); expect(name).toBe(4);
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
const inst = { const inst = {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -58,8 +58,8 @@ const inst = {
}, },
} }
assert(inst.hasOwnProperty('decoratedProps')); expect(inst.hasOwnProperty('decoratedProps')).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -72,42 +72,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite(), "__1__"); expect(inst.enumconfwrite()).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf(), "__2__"); expect(inst.enumconf()).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite(), "__3__"); expect(inst.enumwrite()).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum(), "__4__"); expect(inst.enum()).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite(), "__5__"); expect(inst.confwrite()).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf(), "__6__"); expect(inst.conf()).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write(), "__7__"); expect(inst.write()).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._(), "__8__"); expect(inst._()).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, "str"); expect(name).toBe("str");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
const inst = { const inst = {

View File

@ -22,4 +22,4 @@ const obj = {
prop2: 2, prop2: 2,
} }
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8]); expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8]);

View File

@ -23,4 +23,4 @@ const obj = {
prop2: 2, prop2: 2,
} }
assert.deepEqual(calls, [1, 2, 3, 4, 5, 6, 7, 8]); expect(calls).toEqual([1, 2, 3, 4, 5, 6, 7, 8]);

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -43,8 +43,8 @@ const inst = {
}; };
assert(inst.hasOwnProperty("decoratedProps")); expect(inst.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -57,42 +57,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite, "__1__"); expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf, "__2__"); expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite, "__3__"); expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum, "__4__"); expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite, "__5__"); expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf, "__6__"); expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write, "__7__"); expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._, "__8__"); expect(inst._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, "prop"); expect(name).toBe("prop");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
let {initializer} = descriptor; let {initializer} = descriptor;
delete descriptor.initializer; delete descriptor.initializer;
@ -22,4 +22,4 @@ let inst = {
prop: 3 prop: 3
}; };
assert.equal(inst.prop, "__3__"); expect(inst.prop).toBe("__3__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, 4); expect(name).toBe(4);
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
const inst = { const inst = {

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor) { function dec(target, name, descriptor) {
assert(target); expect(target).toBeTruthy();
assert.equal(typeof name, "string"); expect(typeof name).toBe("string");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
target.decoratedProps = (target.decoratedProps || []).concat([name]); target.decoratedProps = (target.decoratedProps || []).concat([name]);
@ -42,8 +42,8 @@ const inst = {
_: 8, _: 8,
}; };
assert(inst.hasOwnProperty("decoratedProps")); expect(inst.hasOwnProperty("decoratedProps")).toBeTruthy();
assert.deepEqual(inst.decoratedProps, [ expect(inst.decoratedProps).toEqual([
"enumconfwrite", "enumconfwrite",
"enumconf", "enumconf",
"enumwrite", "enumwrite",
@ -56,42 +56,42 @@ assert.deepEqual(inst.decoratedProps, [
const descs = Object.getOwnPropertyDescriptors(inst); const descs = Object.getOwnPropertyDescriptors(inst);
assert(descs.enumconfwrite.enumerable); expect(descs.enumconfwrite.enumerable).toBeTruthy();
assert(descs.enumconfwrite.writable); expect(descs.enumconfwrite.writable).toBeTruthy();
assert(descs.enumconfwrite.configurable); expect(descs.enumconfwrite.configurable).toBeTruthy();
assert.equal(inst.enumconfwrite, "__1__"); expect(inst.enumconfwrite).toBe("__1__");
assert(descs.enumconf.enumerable); expect(descs.enumconf.enumerable).toBeTruthy();
assert.equal(descs.enumconf.writable, false); expect(descs.enumconf.writable).toBe(false);
assert(descs.enumconf.configurable); expect(descs.enumconf.configurable).toBeTruthy();
assert.equal(inst.enumconf, "__2__"); expect(inst.enumconf).toBe("__2__");
assert(descs.enumwrite.enumerable); expect(descs.enumwrite.enumerable).toBeTruthy();
assert(descs.enumwrite.writable); expect(descs.enumwrite.writable).toBeTruthy();
assert.equal(descs.enumwrite.configurable, false); expect(descs.enumwrite.configurable).toBe(false);
assert.equal(inst.enumwrite, "__3__"); expect(inst.enumwrite).toBe("__3__");
assert(descs.enum.enumerable); expect(descs.enum.enumerable).toBeTruthy();
assert.equal(descs.enum.writable, false); expect(descs.enum.writable).toBe(false);
assert.equal(descs.enum.configurable, false); expect(descs.enum.configurable).toBe(false);
assert.equal(inst.enum, "__4__"); expect(inst.enum).toBe("__4__");
assert.equal(descs.confwrite.enumerable, false); expect(descs.confwrite.enumerable).toBe(false);
assert(descs.confwrite.writable); expect(descs.confwrite.writable).toBeTruthy();
assert(descs.confwrite.configurable); expect(descs.confwrite.configurable).toBeTruthy();
assert.equal(inst.confwrite, "__5__"); expect(inst.confwrite).toBe("__5__");
assert.equal(descs.conf.enumerable, false); expect(descs.conf.enumerable).toBe(false);
assert.equal(descs.conf.writable, false); expect(descs.conf.writable).toBe(false);
assert(descs.conf.configurable); expect(descs.conf.configurable).toBeTruthy();
assert.equal(inst.conf, "__6__"); expect(inst.conf).toBe("__6__");
assert.equal(descs.write.enumerable, false); expect(descs.write.enumerable).toBe(false);
assert(descs.write.writable); expect(descs.write.writable).toBeTruthy();
assert.equal(descs.write.configurable, false); expect(descs.write.configurable).toBe(false);
assert.equal(inst.write, "__7__"); expect(inst.write).toBe("__7__");
assert.equal(descs._.enumerable, false); expect(descs._.enumerable).toBe(false);
assert.equal(descs._.writable, false); expect(descs._.writable).toBe(false);
assert.equal(descs._.configurable, false); expect(descs._.configurable).toBe(false);
assert.equal(inst._, "__8__"); expect(inst._).toBe("__8__");

View File

@ -1,7 +1,7 @@
function dec(target, name, descriptor){ function dec(target, name, descriptor){
assert(target); expect(target).toBeTruthy();
assert.equal(name, "str"); expect(name).toBe("str");
assert.equal(typeof descriptor, "object"); expect(typeof descriptor).toBe("object");
} }
const inst = { const inst = {

View File

@ -19,7 +19,7 @@ var lib = {};
::lib.g() ::lib.g()
::lib.h(); ::lib.h();
assert.deepEqual(operations, [ expect(operations).toEqual([
'get lib.f', 'get lib.f',
'lib.f()', 'lib.f()',
'get lib.g', 'get lib.g',

View File

@ -9,5 +9,5 @@ const it = gen();
it.next(1); it.next(1);
it.next(2); it.next(2);
assert.equal(sent, 1); expect(sent).toBe(1);
assert.equal(yielded, 2); expect(yielded).toBe(2);

View File

@ -11,13 +11,13 @@ function* gen() {
} }
const it = gen(); const it = gen();
assert.deepEqual(values, []); expect(values).toEqual([]);
assert.equal(it.next(1).value, "foo"); expect(it.next(1).value).toBe("foo");
assert.deepEqual(values, [ 1, 1 ]); expect(values).toEqual([ 1, 1 ]);
assert.equal(it.next(2).value, undefined); expect(it.next(2).value).toBeUndefined();
assert.deepEqual(values, [ 1, 1, 2, 2 ]); expect(values).toEqual([ 1, 1, 2, 2 ]);
assert.equal(it.next(3).done, true); expect(it.next(3).done).toBe(true);
assert.deepEqual(values, [ 1, 1, 2, 2, 3, 3, 3 ]); expect(values).toEqual([ 1, 1, 2, 2, 3, 3, 3 ]);

View File

@ -1,72 +0,0 @@
var x = 0;
var sets = 0;
var obj = {
get x() {
return x;
},
set x(value) {
sets++;
x = value;
},
};
assert.equal(obj.x ||= 1, 1);
assert.equal(sets, 1);
assert.equal(obj.x ||= 2, 1);
assert.equal(sets, 1);
assert.equal(obj.x &&= 0, 0);
assert.equal(sets, 2);
assert.equal(obj.x &&= 3, 0);
assert.equal(sets, 2);
var gets = 0;
var deep = {
get obj() {
gets++;
return obj;
},
};
assert.equal(deep.obj.x ||= 1, 1);
assert.equal(gets, 1);
assert.equal(deep.obj.x ||= 2, 1);
assert.equal(gets, 2);
assert.equal(deep.obj.x &&= 0, 0);
assert.equal(gets, 3);
assert.equal(deep.obj.x &&= 3, 0);
assert.equal(gets, 4);
var key = 0;
assert.equal(obj[++key] ||= 1, 1);
assert.equal(key, 1);
key = 0;
assert.equal(obj[++key] ||= 2, 1);
assert.equal(key, 1);
key = 0;
assert.equal(obj[++key] &&= 0, 0);
assert.equal(key, 1);
key = 0;
assert.equal(obj[++key] &&= 3, 0);
assert.equal(key, 1);
key = 0;
assert.equal(deep.obj[++key] ||= 1, 1);
assert.equal(gets, 5);
assert.equal(key, 1);
key = 0;
assert.equal(deep.obj[++key] ||= 2, 1);
assert.equal(gets, 6);
assert.equal(key, 1);
key = 0;
assert.equal(deep.obj[++key] &&= 0, 0);
assert.equal(gets, 7);
assert.equal(key, 1);
key = 0;
assert.equal(deep.obj[++key] &&= 3, 0);
assert.equal(gets, 8);
assert.equal(key, 1);

View File

@ -11,15 +11,15 @@ var obj = {
}, },
}; };
assert.equal(obj.x ||= 1, 1); expect(obj.x ||= 1).toBe(1);
assert.equal(sets, 1); expect(sets).toBe(1);
assert.equal(obj.x ||= 2, 1); expect(obj.x ||= 2).toBe(1);
assert.equal(sets, 1); expect(sets).toBe(1);
assert.equal(obj.x &&= 0, 0); expect(obj.x &&= 0).toBe(0);
assert.equal(sets, 2); expect(sets).toBe(2);
assert.equal(obj.x &&= 3, 0); expect(obj.x &&= 3).toBe(0);
assert.equal(sets, 2); expect(sets).toBe(2);
var gets = 0; var gets = 0;
var deep = { var deep = {
@ -29,44 +29,44 @@ var deep = {
}, },
}; };
assert.equal(deep.obj.x ||= 1, 1); expect(deep.obj.x ||= 1).toBe(1);
assert.equal(gets, 1); expect(gets).toBe(1);
assert.equal(deep.obj.x ||= 2, 1); expect(deep.obj.x ||= 2).toBe(1);
assert.equal(gets, 2); expect(gets).toBe(2);
assert.equal(deep.obj.x &&= 0, 0); expect(deep.obj.x &&= 0).toBe(0);
assert.equal(gets, 3); expect(gets).toBe(3);
assert.equal(deep.obj.x &&= 3, 0); expect(deep.obj.x &&= 3).toBe(0);
assert.equal(gets, 4); expect(gets).toBe(4);
var key = 0; var key = 0;
assert.equal(obj[++key] ||= 1, 1); expect(obj[++key] ||= 1).toBe(1);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[++key] ||= 2, 1); expect(obj[++key] ||= 2).toBe(1);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[++key] &&= 0, 0); expect(obj[++key] &&= 0).toBe(0);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[++key] &&= 3, 0); expect(obj[++key] &&= 3).toBe(0);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(deep.obj[++key] ||= 1, 1); expect(deep.obj[++key] ||= 1).toBe(1);
assert.equal(gets, 5); expect(gets).toBe(5);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(deep.obj[++key] ||= 2, 1); expect(deep.obj[++key] ||= 2).toBe(1);
assert.equal(gets, 6); expect(gets).toBe(6);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(deep.obj[++key] &&= 0, 0); expect(deep.obj[++key] &&= 0).toBe(0);
assert.equal(gets, 7); expect(gets).toBe(7);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(deep.obj[++key] &&= 3, 0); expect(deep.obj[++key] &&= 3).toBe(0);
assert.equal(gets, 8); expect(gets).toBe(8);
assert.equal(key, 1); expect(key).toBe(1);

View File

@ -13,14 +13,14 @@ var obj = {
} }
}; };
assert.equal(obj.x || (obj.x = 1), 1); expect(obj.x || (obj.x = 1)).toBe(1);
assert.equal(sets, 1); expect(sets).toBe(1);
assert.equal(obj.x || (obj.x = 2), 1); expect(obj.x || (obj.x = 2)).toBe(1);
assert.equal(sets, 1); expect(sets).toBe(1);
assert.equal(obj.x && (obj.x = 0), 0); expect(obj.x && (obj.x = 0)).toBe(0);
assert.equal(sets, 2); expect(sets).toBe(2);
assert.equal(obj.x && (obj.x = 3), 0); expect(obj.x && (obj.x = 3)).toBe(0);
assert.equal(sets, 2); expect(sets).toBe(2);
var gets = 0; var gets = 0;
var deep = { var deep = {
get obj() { get obj() {
@ -29,39 +29,39 @@ var deep = {
} }
}; };
assert.equal((_deep$obj = deep.obj).x || (_deep$obj.x = 1), 1); expect((_deep$obj = deep.obj).x || (_deep$obj.x = 1)).toBe(1);
assert.equal(gets, 1); expect(gets).toBe(1);
assert.equal((_deep$obj2 = deep.obj).x || (_deep$obj2.x = 2), 1); expect((_deep$obj2 = deep.obj).x || (_deep$obj2.x = 2)).toBe(1);
assert.equal(gets, 2); expect(gets).toBe(2);
assert.equal((_deep$obj3 = deep.obj).x && (_deep$obj3.x = 0), 0); expect((_deep$obj3 = deep.obj).x && (_deep$obj3.x = 0)).toBe(0);
assert.equal(gets, 3); expect(gets).toBe(3);
assert.equal((_deep$obj4 = deep.obj).x && (_deep$obj4.x = 3), 0); expect((_deep$obj4 = deep.obj).x && (_deep$obj4.x = 3)).toBe(0);
assert.equal(gets, 4); expect(gets).toBe(4);
var key = 0; var key = 0;
assert.equal(obj[_ref = ++key] || (obj[_ref] = 1), 1); expect(obj[_ref = ++key] || (obj[_ref] = 1)).toBe(1);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[_ref2 = ++key] || (obj[_ref2] = 2), 1); expect(obj[_ref2 = ++key] || (obj[_ref2] = 2)).toBe(1);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[_ref3 = ++key] && (obj[_ref3] = 0), 0); expect(obj[_ref3 = ++key] && (obj[_ref3] = 0)).toBe(0);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal(obj[_ref4 = ++key] && (obj[_ref4] = 3), 0); expect(obj[_ref4 = ++key] && (obj[_ref4] = 3)).toBe(0);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal((_deep$obj5 = deep.obj)[_ref5 = ++key] || (_deep$obj5[_ref5] = 1), 1); expect((_deep$obj5 = deep.obj)[_ref5 = ++key] || (_deep$obj5[_ref5] = 1)).toBe(1);
assert.equal(gets, 5); expect(gets).toBe(5);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal((_deep$obj6 = deep.obj)[_ref6 = ++key] || (_deep$obj6[_ref6] = 2), 1); expect((_deep$obj6 = deep.obj)[_ref6 = ++key] || (_deep$obj6[_ref6] = 2)).toBe(1);
assert.equal(gets, 6); expect(gets).toBe(6);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal((_deep$obj7 = deep.obj)[_ref7 = ++key] && (_deep$obj7[_ref7] = 0), 0); expect((_deep$obj7 = deep.obj)[_ref7 = ++key] && (_deep$obj7[_ref7] = 0)).toBe(0);
assert.equal(gets, 7); expect(gets).toBe(7);
assert.equal(key, 1); expect(key).toBe(1);
key = 0; key = 0;
assert.equal((_deep$obj8 = deep.obj)[_ref8 = ++key] && (_deep$obj8[_ref8] = 3), 0); expect((_deep$obj8 = deep.obj)[_ref8 = ++key] && (_deep$obj8[_ref8] = 3)).toBe(0);
assert.equal(gets, 8); expect(gets).toBe(8);
assert.equal(key, 1); expect(key).toBe(1);

View File

@ -1,19 +1,19 @@
assert.equal(null ?? undefined, undefined); expect(null ?? undefined).toBeUndefined(undefined);
assert.equal(undefined ?? null, null); expect(undefined ?? null).toBeNull();
assert.equal(false ?? true, false); expect(false ?? true).toBe(false);
assert.equal(0 ?? 1, 0); expect(0 ?? 1).toBe(0);
assert.equal("" ?? "foo", ""); expect("" ?? "foo").toBe("");
var obj = { exists: true }; var obj = { exists: true };
assert.equal(obj.exists ?? false, true); expect(obj.exists ?? false).toBe(true);
assert.equal(obj.doesNotExist ?? "foo", "foo"); expect(obj.doesNotExist ?? "foo").toBe("foo");
var counter = 0; var counter = 0;
function sideEffect() { return counter++; } function sideEffect() { return counter++; }
assert.equal(sideEffect() ?? -1, 0); expect(sideEffect() ?? -1).toBe(0);
var counter2 = 0; var counter2 = 0;
var obj2 = { var obj2 = {
get foo() { return counter2++; } get foo() { return counter2++; }
}; };
assert.equal(obj2.foo ?? -1, 0); expect(obj2.foo ?? -1).toBe(0);

View File

@ -1,19 +1,19 @@
assert.equal(Number("1_000"), Number("1000")); expect(Number("1_000")).toBe(Number("1000"));
assert.equal(Number("0xAE_BE_CE"), Number("0xAEBECE")); expect(Number("0xAE_BE_CE")).toBe(Number("0xAEBECE"));
assert.equal(Number("0b1010_0001_1000_0101"), Number("0b1010000110000101")); expect(Number("0b1010_0001_1000_0101")).toBe(Number("0b1010000110000101"));
assert.equal(Number("0o0_6_6_6"), Number("0o0666")); expect(Number("0o0_6_6_6")).toBe(Number("0o0666"));
assert.equal(new Number("1_000").valueOf(), new Number("1000").valueOf()); expect(new Number("1_000").valueOf()).toBe(new Number("1000").valueOf());
assert.equal(new Number("0xAE_BE_CE").valueOf(), new Number("0xAEBECE").valueOf()); expect(new Number("0xAE_BE_CE").valueOf()).toBe(new Number("0xAEBECE").valueOf());
assert.equal(new Number("0b1010_0001_1000_0101").valueOf(), new Number("0b1010000110000101").valueOf()); expect(new Number("0b1010_0001_1000_0101").valueOf()).toBe(new Number("0b1010000110000101").valueOf());
assert.equal(new Number("0o0_6_6_6").valueOf(), new Number("0o0666").valueOf()); expect(new Number("0o0_6_6_6").valueOf()).toBe(new Number("0o0666").valueOf());
assert.equal(Number(1_000), Number("1000")); expect(Number(1_000)).toBe(Number("1000"));
assert.equal(Number(0xAE_BE_CE), Number("0xAEBECE")); expect(Number(0xAE_BE_CE)).toBe(Number("0xAEBECE"));
assert.equal(Number(0b1010_0001_1000_0101), Number("0b1010000110000101")); expect(Number(0b1010_0001_1000_0101)).toBe(Number("0b1010000110000101"));
assert.equal(Number(0o0_6_6_6), Number("0o0666")); expect(Number(0o0_6_6_6)).toBe(Number("0o0666"));
assert.equal(new Number(1_000).valueOf(), new Number("1000").valueOf()); expect(new Number(1_000).valueOf()).toBe(new Number("1000").valueOf());
assert.equal(new Number(0xAE_BE_CE).valueOf(), new Number("0xAEBECE").valueOf()); expect(new Number(0xAE_BE_CE).valueOf()).toBe(new Number("0xAEBECE").valueOf());
assert.equal(new Number(0b1010_0001_1000_0101).valueOf(), new Number("0b1010000110000101").valueOf()); expect(new Number(0b1010_0001_1000_0101).valueOf()).toBe(new Number("0b1010000110000101").valueOf());
assert.equal(new Number(0o0_6_6_6).valueOf(), new Number("0o0666").valueOf()); expect(new Number(0o0_6_6_6).valueOf()).toBe(new Number("0o0666").valueOf());

View File

@ -1,4 +1,4 @@
assert.equal(1_000, 1000); expect(1_000).toBe(1000);
assert.equal(0xAE_BE_CE, 0xAEBECE); expect(0xAE_BE_CE).toBe(0xAEBECE);
assert.equal(0b1010_0001_1000_0101, 0b1010000110000101); expect(0b1010_0001_1000_0101).toBe(0b1010000110000101);
assert.equal(0o0_6_6_6, 0o0666); expect(0o0_6_6_6).toBe(0o0666);

View File

@ -1,4 +1,4 @@
assert.equal(1_000, 1000); expect(1_000).toBe(1000);
assert.equal(0xAE_BE_CE, 11452110); expect(0xAE_BE_CE).toBe(11452110);
assert.equal(0b1010_0001_1000_0101, 41349); expect(0b1010_0001_1000_0101).toBe(41349);
assert.equal(0o0_6_6_6, 438); expect(0o0_6_6_6).toBe(438);

View File

@ -2,20 +2,20 @@ var key, x, y, z;
// impure // impure
key = 1; key = 1;
var { [key++]: y, ...x } = { 1: 1, a: 1 }; var { [key++]: y, ...x } = { 1: 1, a: 1 };
assert.deepEqual({ a: 1 }, x); expect(x).toEqual({ a: 1 });
assert.equal(key, 2); expect(key).toBe(2);
assert.equal(1, y); expect(1).toBe(y);
// takes care of the order // takes care of the order
key = 1; key = 1;
var { [++key]: y, [++key]: z, ...rest} = {2: 2, 3: 3}; var { [++key]: y, [++key]: z, ...rest} = {2: 2, 3: 3};
assert.equal(y, 2); expect(y).toBe(2);
assert.equal(z, 3); expect(z).toBe(3);
// pure, computed property should remain as-is // pure, computed property should remain as-is
key = 2; key = 2;
({ [key]: y, z, ...x } = {2: "two", z: "zee"}); ({ [key]: y, z, ...x } = {2: "two", z: "zee"});
assert.equal(y, "two"); expect(y).toBe("two");
assert.deepEqual(x, {}); expect(x).toEqual({});
assert.equal(z, "zee"); expect(z).toBe("zee");

View File

@ -2,20 +2,20 @@ var key, x, y, z;
// impure // impure
key = 1; key = 1;
var { [key++]: y, ...x } = { 1: 1, a: 1 }; var { [key++]: y, ...x } = { 1: 1, a: 1 };
assert.deepEqual({ a: 1 }, x); expect(x).toEqual({ a: 1 });
assert.equal(key, 2); expect(key).toBe(2);
assert.equal(1, y); expect(y).toBe(1);
// takes care of the order // takes care of the order
key = 1; key = 1;
var { [++key]: y, [++key]: z, ...rest} = {2: 2, 3: 3}; var { [++key]: y, [++key]: z, ...rest} = {2: 2, 3: 3};
assert.equal(y, 2); expect(y).toBe(2);
assert.equal(z, 3); expect(z).toBe(3);
// pure, computed property should remain as-is // pure, computed property should remain as-is
key = 2; key = 2;
({ [key]: y, z, ...x } = {2: "two", z: "zee"}); ({ [key]: y, z, ...x } = {2: "two", z: "zee"});
assert.equal(y, "two"); expect(y).toBe("two");
assert.deepEqual(x, {}); expect(x).toEqual({});
assert.equal(z, "zee"); expect(z).toBe("zee");

View File

@ -12,11 +12,11 @@ var _$a = {
} = _$a, } = _$a,
x = babelHelpers.objectWithoutProperties(_$a, [_ref].map(babelHelpers.toPropertyKey)); x = babelHelpers.objectWithoutProperties(_$a, [_ref].map(babelHelpers.toPropertyKey));
assert.deepEqual({ expect(x).toEqual({
a: 1 a: 1
}, x); });
assert.equal(key, 2); expect(key).toBe(2);
assert.equal(1, y); // takes care of the order expect(y).toBe(1); // takes care of the order
key = 1; key = 1;
@ -32,8 +32,8 @@ var _$ = {
} = _$, } = _$,
rest = babelHelpers.objectWithoutProperties(_$, [_ref2, _ref3].map(babelHelpers.toPropertyKey)); rest = babelHelpers.objectWithoutProperties(_$, [_ref2, _ref3].map(babelHelpers.toPropertyKey));
assert.equal(y, 2); expect(y).toBe(2);
assert.equal(z, 3); // pure, computed property should remain as-is expect(z).toBe(3); // pure, computed property should remain as-is
key = 2; key = 2;
var _$z = { var _$z = {
@ -46,6 +46,6 @@ var _$z = {
} = _$z); } = _$z);
x = babelHelpers.objectWithoutProperties(_$z, [key, "z"].map(babelHelpers.toPropertyKey)); x = babelHelpers.objectWithoutProperties(_$z, [key, "z"].map(babelHelpers.toPropertyKey));
_$z; _$z;
assert.equal(y, "two"); expect(y).toBe("two");
assert.deepEqual(x, {}); expect(x).toEqual({});
assert.equal(z, "zee"); expect(z).toBe("zee");

View File

@ -18,4 +18,4 @@ var obj = {
var { a: { ...bar }, b: { ...baz }, ...foo } = obj; var { a: { ...bar }, b: { ...baz }, ...foo } = obj;
assert.strictEqual(result, "barbazfoo"); expect(result).toBe("barbazfoo");

View File

@ -8,8 +8,8 @@ const {
...rest ...rest
} = a; } = a;
assert.deepEqual(rest, {"foo": "bar"}); expect(rest).toEqual({"foo": "bar"});
assert.equal(omit, "three"); expect(omit).toBe("three");
const [k1, k2, k3, k4, k5] = [null, undefined, true, false, {toString() { return "warrior"; }}]; const [k1, k2, k3, k4, k5] = [null, undefined, true, false, {toString() { return "warrior"; }}];
const c = { const c = {
@ -29,12 +29,12 @@ const {
...vrest ...vrest
} = c; } = c;
assert.equal(v1, "1"); expect(v1).toBe("1");
assert.equal(v2, "2"); expect(v2).toBe("2");
assert.equal(v3, "3"); expect(v3).toBe("3");
assert.equal(v4, "4"); expect(v4).toBe("4");
assert.equal(v5, "5"); expect(v5).toBe("5");
assert.deepEqual(vrest, {}); expect(vrest).toEqual({});
// shouldn't convert symbols to strings // shouldn't convert symbols to strings
const sx = Symbol(); const sx = Symbol();
@ -50,5 +50,5 @@ const {
[sy]: dy [sy]: dy
} = d; } = d;
assert.equal(dx, "sx"); expect(dx).toBe("sx");
assert.equal(dy, "sy"); expect(dy).toBe("sy");

View File

@ -8,8 +8,8 @@ const {
...rest ...rest
} = a; } = a;
assert.deepEqual(rest, {"foo": "bar"}); expect(rest).toEqual({"foo": "bar"});
assert.equal(omit, "three"); expect(omit).toBe("three");
const [k1, k2, k3, k4, k5] = [null, undefined, true, false, {toString() { return "warrior"; }}]; const [k1, k2, k3, k4, k5] = [null, undefined, true, false, {toString() { return "warrior"; }}];
const c = { const c = {
@ -29,12 +29,12 @@ const {
...vrest ...vrest
} = c; } = c;
assert.equal(v1, "1"); expect(v1).toBe("1");
assert.equal(v2, "2"); expect(v2).toBe("2");
assert.equal(v3, "3"); expect(v3).toBe("3");
assert.equal(v4, "4"); expect(v4).toBe("4");
assert.equal(v5, "5"); expect(v5).toBe("5");
assert.deepEqual(vrest, {}); expect(vrest).toEqual({});
// shouldn't convert symbols to strings // shouldn't convert symbols to strings
const sx = Symbol(); const sx = Symbol();
@ -50,5 +50,5 @@ const {
[sy]: dy [sy]: dy
} = d; } = d;
assert.equal(dx, "sx"); expect(dx).toBe("sx");
assert.equal(dy, "sy"); expect(dy).toBe("sy");

View File

@ -6,10 +6,10 @@ const {
[3]: omit [3]: omit
} = a, } = a,
rest = babelHelpers.objectWithoutProperties(a, ["3"]); rest = babelHelpers.objectWithoutProperties(a, ["3"]);
assert.deepEqual(rest, { expect(rest).toEqual({
"foo": "bar" "foo": "bar"
}); });
assert.equal(omit, "three"); expect(omit).toBe("three");
const [k1, k2, k3, k4, k5] = [null, undefined, true, false, { const [k1, k2, k3, k4, k5] = [null, undefined, true, false, {
toString() { toString() {
return "warrior"; return "warrior";
@ -31,12 +31,12 @@ const {
[k5]: v5 [k5]: v5
} = c, } = c,
vrest = babelHelpers.objectWithoutProperties(c, [k1, k2, k3, k4, k5].map(babelHelpers.toPropertyKey)); vrest = babelHelpers.objectWithoutProperties(c, [k1, k2, k3, k4, k5].map(babelHelpers.toPropertyKey));
assert.equal(v1, "1"); expect(v1).toBe("1");
assert.equal(v2, "2"); expect(v2).toBe("2");
assert.equal(v3, "3"); expect(v3).toBe("3");
assert.equal(v4, "4"); expect(v4).toBe("4");
assert.equal(v5, "5"); expect(v5).toBe("5");
assert.deepEqual(vrest, {}); // shouldn't convert symbols to strings expect(vrest).toEqual({}); // shouldn't convert symbols to strings
const sx = Symbol(); const sx = Symbol();
const sy = Symbol(); const sy = Symbol();
@ -48,5 +48,5 @@ const {
[sx]: dx, [sx]: dx,
[sy]: dy [sy]: dy
} = d; } = d;
assert.equal(dx, "sx"); expect(dx).toBe("sx");
assert.equal(dy, "sy"); expect(dy).toBe("sy");

View File

@ -8,13 +8,13 @@ Object.defineProperty(src, sym2, { value: "not enumerable" });
const {...rest} = src; const {...rest} = src;
assert.strictEqual(rest[sym], "symbol"); expect(rest[sym]).toBe("symbol");
assert.strictEqual(rest.a, "string"); expect(rest.a).toBe("string");
assert.deepEqual(Object.getOwnPropertyNames(rest), ["a"]); expect(Object.getOwnPropertyNames(rest)).toEqual(["a"]);
assert.deepEqual(Object.getOwnPropertySymbols(rest), [sym]); expect(Object.getOwnPropertySymbols(rest)).toEqual([sym]);
const { [sym]: dst, ...noSym } = src; const { [sym]: dst, ...noSym } = src;
assert.strictEqual(dst, "symbol"); expect(dst).toBe("symbol");
assert.strictEqual(noSym.a, "string"); expect(noSym.a).toBe("string");
assert.deepEqual(Object.getOwnPropertySymbols(noSym), []); expect(Object.getOwnPropertySymbols(noSym)).toEqual([]);

View File

@ -20,21 +20,21 @@ const obj2 = { NOSET: 123, NOWRITE: 456 };
// (spread defines them) // (spread defines them)
const obj2Spread = { ...obj2 }; const obj2Spread = { ...obj2 };
assert.deepEqual(obj, objSpread); expect(objSpread).toEqual(obj);
assert.deepEqual(obj2, obj2Spread); expect(obj2Spread).toEqual(obj2);
const KEY = Symbol('key'); const KEY = Symbol('key');
const obj3Spread = { ...{ get foo () { return 'bar' } }, [KEY]: 'symbol' }; const obj3Spread = { ...{ get foo () { return 'bar' } }, [KEY]: 'symbol' };
assert.equal(Object.getOwnPropertyDescriptor(obj3Spread, 'foo').value, 'bar'); expect(Object.getOwnPropertyDescriptor(obj3Spread, 'foo').value).toBe('bar');
assert.equal(Object.getOwnPropertyDescriptor(obj3Spread, KEY).value, 'symbol'); expect(Object.getOwnPropertyDescriptor(obj3Spread, KEY).value).toBe('symbol');
const obj4Spread = { ...Object.prototype }; const obj4Spread = { ...Object.prototype };
assert.isUndefined(Object.getOwnPropertyDescriptor(obj4Spread, 'hasOwnProperty')); expect(Object.getOwnPropertyDescriptor(obj4Spread, 'hasOwnProperty')).toBeUndefined();
assert.doesNotThrow(() => ({ ...null, ...undefined })); expect(() => ({ ...null, ...undefined })).not.toThrow();
const o = Object.create(null); const o = Object.create(null);
o.a = 'foo'; o.a = 'foo';
o.__proto__ = []; o.__proto__ = [];
const o2 = { ...o }; const o2 = { ...o };
assert.equal(false, Array.isArray(Object.getPrototypeOf(o2))); expect(Array.isArray(Object.getPrototypeOf(o2))).toBe(false);

View File

@ -11,18 +11,18 @@ const obj = {
}; };
const a = obj?.a; const a = obj?.a;
assert.equal(a, obj.a); expect(a).toBe(obj.a);
const b = obj?.a?.b; const b = obj?.a?.b;
assert.equal(b, obj.a.b); expect(b).toBe(obj.a.b);
const bad = obj?.b?.b; const bad = obj?.b?.b;
assert.equal(bad, undefined); expect(bad).toBeUndefined();
let val; let val;
val = obj?.a?.b; val = obj?.a?.b;
assert.equal(val, obj.a.b); expect(val).toBe(obj.a.b);
assert.throws(() => { expect(() => {
const bad = obj?.b.b; const bad = obj?.b.b;
}); }).toThrow();

View File

@ -7,16 +7,16 @@ const obj = {
}; };
let test = delete obj?.a?.b; let test = delete obj?.a?.b;
assert.equal(obj.a.b, undefined); expect(obj.a.b).toBeUndefined();
assert.equal(test, true); expect(test).toBe(true);
test = delete obj?.a.b; test = delete obj?.a.b;
assert.equal(obj.a.b, undefined); expect(obj.a.b).toBeUndefined();
assert.equal(test, true); expect(test).toBe(true);
test = delete obj?.b?.b; test = delete obj?.b?.b;
assert.equal(obj.b, undefined); expect(obj.b).toBeUndefined();
assert.equal(test, undefined); expect(test).toBeUndefined();
delete obj?.a; delete obj?.a;
assert.equal(obj.a, undefined); expect(obj.a).toBeUndefined();

View File

@ -7,13 +7,13 @@ const obj = {
}; };
let test = +obj?.a?.b; let test = +obj?.a?.b;
assert.equal(test, 0); expect(test).toBe(0);
test = +obj?.a.b; test = +obj?.a.b;
assert.equal(test, 0); expect(test).toBe(0);
test = +obj?.b?.b; test = +obj?.b?.b;
assert.isNaN(test); expect(test).toBe(NaN);
test = +obj?.b?.b; test = +obj?.b?.b;
assert.isNaN(test); expect(test).toBe(NaN);

View File

@ -3,7 +3,7 @@ var result = [5,10]
|> _ => _.reduce( (a,b) => a + b ) |> _ => _.reduce( (a,b) => a + b )
|> sum => sum + 1 |> sum => sum + 1
assert.equal(result, 31) expect(result).toBe(31);
var inc = (x) => x + 1; var inc = (x) => x + 1;
@ -11,4 +11,4 @@ var double = (x) => x * 2;
var result2 = [4, 9].map( x => x |> inc |> double ) var result2 = [4, 9].map( x => x |> inc |> double )
assert.deepEqual(result2, [10, 20]) expect(result2).toEqual([10, 20]);

View File

@ -3,7 +3,7 @@ var result = [5,10]
|> _ => _.reduce( (a,b) => a + b ) |> _ => _.reduce( (a,b) => a + b )
|> sum => sum + 1 |> sum => sum + 1
assert.equal(result, 31) expect(result).toBe(31);
var inc = (x) => x + 1; var inc = (x) => x + 1;
@ -11,4 +11,4 @@ var double = (x) => x * 2;
var result2 = [4, 9].map( x => x |> inc |> double ) var result2 = [4, 9].map( x => x |> inc |> double )
assert.deepEqual(result2, [10, 20]) expect(result2).toEqual([10, 20]);

View File

@ -1,7 +1,7 @@
var _ref, _ref2, _sum; var _ref, _ref2, _sum;
var result = (_ref = [5, 10], (_ref2 = _ref.map(x => x * 2), (_sum = _ref2.reduce((a, b) => a + b), _sum + 1))); var result = (_ref = [5, 10], (_ref2 = _ref.map(x => x * 2), (_sum = _ref2.reduce((a, b) => a + b), _sum + 1)));
assert.equal(result, 31); expect(result).toBe(31);
var inc = x => x + 1; var inc = x => x + 1;
@ -12,4 +12,4 @@ var result2 = [4, 9].map(x => {
return _ref3 = (_x = x, inc(_x)), double(_ref3); return _ref3 = (_x = x, inc(_x)), double(_ref3);
}); });
assert.deepEqual(result2, [10, 20]); expect(result2).toEqual([10, 20]);

View File

@ -9,5 +9,5 @@ var result = 1
|> then((x) => x + 1); |> then((x) => x + 1);
result.then(val => { result.then(val => {
assert.equal(val, 3); expect(val).toBe(3);
}); });

View File

@ -9,5 +9,5 @@ var result = 1
|> then((x) => x + 1); |> then((x) => x + 1);
result.then(val => { result.then(val => {
assert.equal(val, 3); expect(val).toBe(3);
}); });

View File

@ -8,5 +8,5 @@ function then(fn) {
var result = (_ref = (_ = 1, (async x => (await x) + 1)(_)), then(x => x + 1)(_ref)); var result = (_ref = (_ = 1, (async x => (await x) + 1)(_)), then(x => x + 1)(_ref));
result.then(val => { result.then(val => {
assert.equal(val, 3); expect(val).toBe(3);
}); });

View File

@ -1,3 +1,3 @@
var inc = (x) => x + 1 var inc = (x) => x + 1
assert.equal(10 |> inc, 11); expect(10 |> inc).toBe(11);

View File

@ -1,3 +1,3 @@
var inc = (x) => x + 1 var inc = (x) => x + 1
assert.equal(10 |> inc, 11); expect(10 |> inc).toBe(11);

View File

@ -2,4 +2,4 @@ var _;
var inc = x => x + 1; var inc = x => x + 1;
assert.equal((_ = 10, inc(_)), 11); expect((_ = 10, inc(_))).toBe(11);

View File

@ -1,4 +1,4 @@
var inc = (x) => x + 1; var inc = (x) => x + 1;
var double = (x) => x * 2; var double = (x) => x * 2;
assert.equal(10 |> inc |> double, 22); expect(10 |> inc |> double).toBe(22);

View File

@ -1,4 +1,4 @@
var inc = (x) => x + 1; var inc = (x) => x + 1;
var double = (x) => x * 2; var double = (x) => x * 2;
assert.equal(10 |> inc |> double, 22); expect(10 |> inc |> double).toBe(22);

View File

@ -4,4 +4,4 @@ var inc = x => x + 1;
var double = x => x * 2; var double = x => x * 2;
assert.equal((_ref = (_ = 10, inc(_)), double(_ref)), 22); expect((_ref = (_ = 10, inc(_)), double(_ref))).toBe(22);

View File

@ -3,4 +3,4 @@ var map = (fn) => (array) => array.map(fn);
var result = [10,20] |> map(x => x * 20); var result = [10,20] |> map(x => x * 20);
assert.deepEqual(result, [200, 400]) expect(result).toEqual([200, 400]);

View File

@ -3,4 +3,4 @@ var map = (fn) => (array) => array.map(fn);
var result = [10,20] |> map(x => x * 20); var result = [10,20] |> map(x => x * 20);
assert.deepEqual(result, [200, 400]) expect(result).toEqual([200, 400]);

View File

@ -3,4 +3,4 @@ var _ref;
var map = fn => array => array.map(fn); var map = fn => array => array.map(fn);
var result = (_ref = [10, 20], map(x => x * 20)(_ref)); var result = (_ref = [10, 20], map(x => x * 20)(_ref));
assert.deepEqual(result, [200, 400]); expect(result).toEqual([200, 400]);

View File

@ -5,4 +5,4 @@ var result = a
|> (a, b) => b |> (a, b) => b
|> (a, b) => c; |> (a, b) => c;
assert.equal(result, c) expect(result).toBe(c);

View File

@ -5,4 +5,4 @@ var result = a
|> (a, b) => b |> (a, b) => b
|> (a, b) => c; |> (a, b) => c;
assert.equal(result, c) expect(result).toBe(c);

View File

@ -8,4 +8,4 @@ var result = (_a = a, ((a, b) => {
return _b = b, ((a, b) => c)(_b); return _b = b, ((a, b) => c)(_b);
})(_a)); })(_a));
assert.equal(result, c); expect(result).toBe(c);

View File

@ -1,7 +1,7 @@
// Array destructing // Array destructing
const result = [0] |> ([x]) => x; const result = [0] |> ([x]) => x;
assert.equal(result, 0); expect(result).toBe(0);
// Object destructuring // Object destructuring
const result2 = { y: 1, z: 2 } |> ({ y, z }) => y + z; const result2 = { y: 1, z: 2 } |> ({ y, z }) => y + z;
assert.equal(result2, 3); expect(result2).toBe(3);

View File

@ -1,7 +1,7 @@
// Array destructing // Array destructing
const result = [0] |> ([x]) => x; const result = [0] |> ([x]) => x;
assert.equal(result, 0); expect(result).toBe(0);
// Object destructuring // Object destructuring
const result2 = { y: 1, z: 2 } |> ({ y, z }) => y + z; const result2 = { y: 1, z: 2 } |> ({ y, z }) => y + z;
assert.equal(result, 3); expect(result).toBe(3);

View File

@ -2,7 +2,7 @@ var _ref, _y$z;
// Array destructing // Array destructing
const result = (_ref = [0], (([x]) => x)(_ref)); const result = (_ref = [0], (([x]) => x)(_ref));
assert.equal(result, 0); // Object destructuring expect(result).toBe(0); // Object destructuring
const result2 = (_y$z = { const result2 = (_y$z = {
y: 1, y: 1,
@ -11,4 +11,4 @@ const result2 = (_y$z = {
y, y,
z z
}) => y + z)(_y$z)); }) => y + z)(_y$z));
assert.equal(result, 3); expect(result).toBe(3);

View File

@ -10,4 +10,4 @@ var obj = {
} }
var result = obj.prop |> obj.method; var result = obj.prop |> obj.method;
assert.equal(result, 1); expect(result).toBe(1);

View File

@ -10,4 +10,4 @@ var obj = {
} }
var result = obj.prop |> obj.method; var result = obj.prop |> obj.method;
assert.equal(result, 1); expect(result).toBe(1);

View File

@ -12,4 +12,4 @@ var obj = {
}; };
var result = (_obj$prop = obj.prop, obj.method(_obj$prop)); var result = (_obj$prop = obj.prop, obj.method(_obj$prop));
assert.equal(result, 1); expect(result).toBe(1);

View File

@ -3,5 +3,5 @@
var result = '(function() { return this; })()' var result = '(function() { return this; })()'
|> eval; |> eval;
assert.notEqual(result, undefined); expect(result).not.toBeUndefined();
})(); })();

View File

@ -3,5 +3,5 @@
var result = '(function() { return this; })()' var result = '(function() { return this; })()'
|> eval; |> eval;
assert.notEqual(result, undefined); expect(result).not.toBeUndefined();
})(); })();

View File

@ -4,5 +4,5 @@
var _functionReturn; var _functionReturn;
var result = (_functionReturn = '(function() { return this; })()', (0, eval)(_functionReturn)); var result = (_functionReturn = '(function() { return this; })()', (0, eval)(_functionReturn));
assert.notEqual(result, undefined); expect(result).not.toBeUndefined();
})(); })();

View File

@ -2,4 +2,4 @@ var array = [10,20,30];
var last = array |> a => a[a.length-1]; var last = array |> a => a[a.length-1];
assert.equal(last, 30); expect(last).toBe(30);

View File

@ -2,4 +2,4 @@ var array = [10,20,30];
var last = array |> a => a[a.length-1]; var last = array |> a => a[a.length-1];
assert.equal(last, 30); expect(last).toBe(30);

View File

@ -2,4 +2,4 @@ var _a;
var array = [10, 20, 30]; var array = [10, 20, 30];
var last = (_a = array, _a[_a.length - 1]); var last = (_a = array, _a[_a.length - 1]);
assert.equal(last, 30); expect(last).toBe(30);

Some files were not shown because too many files have changed in this diff Show More