summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/classes
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-12-26 16:24:24 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-27 21:25:27 +0100
commit5122f98198e650f83e948a335e762aeeb306bbaa (patch)
treef00d89bcc36f1ff30176b32e03877005c54634df /Libraries/LibJS/Tests/classes
parent76239f89c21fccec2278394f85a7c1a3f02c3c90 (diff)
downloadserenity-5122f98198e650f83e948a335e762aeeb306bbaa.zip
Base+LibJS+LibWeb: Make prettier clean
Also use "// prettier-ignore" comments where necessary rather than excluding whole files (via .prettierignore).
Diffstat (limited to 'Libraries/LibJS/Tests/classes')
-rw-r--r--Libraries/LibJS/Tests/classes/class-expressions.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/Libraries/LibJS/Tests/classes/class-expressions.js b/Libraries/LibJS/Tests/classes/class-expressions.js
index d714b37f63..f67f54ff7f 100644
--- a/Libraries/LibJS/Tests/classes/class-expressions.js
+++ b/Libraries/LibJS/Tests/classes/class-expressions.js
@@ -1,14 +1,11 @@
-// This file must not be formatted by prettier. Make sure your IDE
-// respects the .prettierignore file!
-
test("basic functionality", () => {
const A = class {
constructor(x) {
- this.x = x;
+ this.x = x;
}
getX() {
- return this.x * 2;
+ return this.x * 2;
}
};
@@ -16,6 +13,7 @@ test("basic functionality", () => {
});
test("inline instantiation", () => {
+ // prettier-ignore
const a = new class {
constructor() {
this.x = 10;
@@ -30,6 +28,7 @@ test("inline instantiation", () => {
});
test("inline instantiation with argument", () => {
+ // prettier-ignore
const a = new class {
constructor(x) {
this.x = x;
@@ -53,7 +52,7 @@ test("extending class expressions", () => {
super(y);
this.y = y * 2;
}
- };
+ }
const a = new A(10);
expect(a.x).toBe(10);
@@ -61,9 +60,9 @@ test("extending class expressions", () => {
});
test("class expression name", () => {
- let A = class {}
+ let A = class {};
expect(A.name).toBe("A");
- let B = class C {}
+ let B = class C {};
expect(B.name).toBe("C");
});