1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:58:11 +00:00

LibJS: Convert all remaining non-Array tests to the new system :)

This commit is contained in:
Matthew Olsson 2020-07-05 17:26:26 -07:00 committed by Andreas Kling
parent 918f4affd5
commit 15de2eda2b
72 changed files with 2394 additions and 1998 deletions

View file

@ -1,3 +1,6 @@
// This file must not be formatted by prettier. Make sure your IDE
// respects the .prettierignore file!
test("new-expression parsing", () => {
function Foo() {
this.x = 1;
@ -6,13 +9,15 @@ test("new-expression parsing", () => {
let foo = new Foo();
expect(foo.x).toBe(1);
foo = new Foo();
foo = new Foo
expect(foo.x).toBe(1);
foo = new Foo();
foo = new
Foo
();
expect(foo.x).toBe(1);
foo = new Foo() + 2;
foo = new Foo + 2
expect(foo).toBe("[object Object]2");
});
@ -26,10 +31,11 @@ test("new-expressions with object keys", () => {
foo = new a.b();
expect(foo.x).toBe(2);
foo = new a.b();
foo = new a.b;
expect(foo.x).toBe(2);
foo = new a.b();
foo = new
a.b();
expect(foo.x).toBe(2);
});