Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
test(rome_js_formatter): update prettier tests (#3684)
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov authored Nov 14, 2022
1 parent 9b5dcdc commit e8b2f33
Show file tree
Hide file tree
Showing 349 changed files with 12,664 additions and 324 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
source: crates/rome_js_formatter/tests/prettier_tests.rs
info:
test_file: js/arrays/holes-in-args.js
---

# Input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
source: crates/rome_js_formatter/tests/prettier_tests.rs
info:
test_file: js/arrays/numbers-negative.js
---

# Input
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
x = (bifornCringerMoshedPerplexSawder) => ((askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => (f00) => {
averredBathersBoxroomBuggyNurl();
} // BOOM
)

x2 = (a) => ((askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askTrovenaBeenaDependsRowans3) => {
c();
} /* ! */ // KABOOM
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
x =
(bifornCringerMoshedPerplexSawder) =>
(askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) =>
(f00) => {
averredBathersBoxroomBuggyNurl();
}; // BOOM

x2 =
(a) =>
(
askTrovenaBeenaDependsRowans1,
askTrovenaBeenaDependsRowans2,
askTrovenaBeenaDependsRowans3,
) => {
c();
} /* ! */; // KABOOM
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(a => {}).length
typeof (() => {});
export default (() => {})();
(() => {})()``;
(() => {})``;
new (() => {});
if ((() => {}) ? 1 : 0) {}
let f = () => ({}())
let a = () => ({} instanceof a);
a = () => ({} && a);
a = () => ({}() && a);
a = () => ({} && a && b);
a = () => ({} + a);
a = () => ({}()() && a);
a = () => ({}.b && a);
a = () => ({}[b] && a);
a = () => ({}`` && a);
a = () => ({} = 0);
a = () => ({}, a);
a => a instanceof {};
a => ({}().b && 0)
a => ({}().c = 0)
x => ({}()())
x => ({}()``)
x => ({}().b);
a = b => c;
x => (y = z);
x => (y += z);
f(a => ({})) + 1;
(a => ({})) || 0;
a = b => c;
a = b => {
return c
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
((a) => {}).length;
typeof (() => {});
export default (() => {})();
(() => {})()``;
(() => {})``;
new (() => {})();
if ((() => {}) ? 1 : 0) {
}
let f = () => ({}());
let a = () => ({} instanceof a);
a = () => ({} && a);
a = () => ({}() && a);
a = () => ({} && a && b);
a = () => ({} + a);
a = () => ({}()() && a);
a = () => ({}.b && a);
a = () => ({}[b] && a);
a = () => ({}`` && a);
a = () => ({} = 0);
a = () => ({}, a);
(a) => a instanceof {};
(a) => ({}().b && 0);
(a) => ({}().c = 0);
(x) => ({}()());
(x) => ({}()``);
(x) => ({}().b);
a = (b) => c;
(x) => (y = z);
(x) => (y += z);
f((a) => ({})) + 1;
((a) => ({})) || 0;
a = (b) => c;
a = (b) => {
return c;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
source: crates/rome_js_formatter/tests/prettier_tests.rs
info:
test_file: js/arrows/arrow_function_expression.js
---

# Input

```js
(a => {}).length
typeof (() => {});
export default (() => {})();
(() => {})()``;
(() => {})``;
new (() => {});
if ((() => {}) ? 1 : 0) {}
let f = () => ({}())
let a = () => ({} instanceof a);
a = () => ({} && a);
a = () => ({}() && a);
a = () => ({} && a && b);
a = () => ({} + a);
a = () => ({}()() && a);
a = () => ({}.b && a);
a = () => ({}[b] && a);
a = () => ({}`` && a);
a = () => ({} = 0);
a = () => ({}, a);
a => a instanceof {};
a => ({}().b && 0)
a => ({}().c = 0)
x => ({}()())
x => ({}()``)
x => ({}().b);
a = b => c;
x => (y = z);
x => (y += z);
f(a => ({})) + 1;
(a => ({})) || 0;
a = b => c;
a = b => {
return c
};
```


# Prettier differences

```diff
--- Prettier
+++ Rome
@@ -6,24 +6,24 @@
new (() => {})();
if ((() => {}) ? 1 : 0) {
}
-let f = () => ({}());
-let a = () => ({} instanceof a);
-a = () => ({} && a);
-a = () => ({}() && a);
-a = () => ({} && a && b);
-a = () => ({} + a);
-a = () => ({}()() && a);
-a = () => ({}.b && a);
-a = () => ({}[b] && a);
-a = () => ({}`` && a);
+let f = () => ({})();
+let a = () => ({}) instanceof a;
+a = () => ({}) && a;
+a = () => ({})() && a;
+a = () => ({}) && a && b;
+a = () => ({}) + a;
+a = () => ({})()() && a;
+a = () => ({}).b && a;
+a = () => ({})[b] && a;
+a = () => ({})`` && a;
a = () => ({} = 0);
-a = () => ({}, a);
+a = () => (({}), a);
(a) => a instanceof {};
-(a) => ({}().b && 0);
-(a) => ({}().c = 0);
-(x) => ({}()());
-(x) => ({}()``);
-(x) => ({}().b);
+(a) => ({})().b && 0;
+(a) => (({})().c = 0);
+(x) => ({})()();
+(x) => ({})()``;
+(x) => ({})().b;
a = (b) => c;
(x) => (y = z);
(x) => (y += z);
```

# Output

```js
((a) => {}).length;
typeof (() => {});
export default (() => {})();
(() => {})()``;
(() => {})``;
new (() => {})();
if ((() => {}) ? 1 : 0) {
}
let f = () => ({})();
let a = () => ({}) instanceof a;
a = () => ({}) && a;
a = () => ({})() && a;
a = () => ({}) && a && b;
a = () => ({}) + a;
a = () => ({})()() && a;
a = () => ({}).b && a;
a = () => ({})[b] && a;
a = () => ({})`` && a;
a = () => ({} = 0);
a = () => (({}), a);
(a) => a instanceof {};
(a) => ({})().b && 0;
(a) => (({})().c = 0);
(x) => ({})()();
(x) => ({})()``;
(x) => ({})().b;
a = (b) => c;
(x) => (y = z);
(x) => (y += z);
f((a) => ({})) + 1;
((a) => ({})) || 0;
a = (b) => c;
a = (b) => {
return c;
};
```



Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
bifornCringer = askTrovenaBeenaDepends = glimseGlyphs = (
argumentOne,
argumentTwo,
) => restOfTheArguments12345678 => {
return "baz";
};

bifornCringer = askTrovenaBeenaDepends = glimseGlyphs = (
argumentOne,
argumentTwo,
argumentThree
) => restOfTheArguments12345678 => {
return "baz";
};

bifornCringer = askTrovenaBeenaDepends = glimseGlyphs = (
argumentOne,
argumentTwo,
argumentThree
) => {
return "baz";
};

const bifornCringer1 =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo) => (restOfTheArguments12345678) => {
return "baz";
};

const bifornCringer2 =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) =>
(restOfTheArguments12345678) => {
return "baz";
};

const bifornCringer3 =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) => {
return "baz";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
bifornCringer =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo) => (restOfTheArguments12345678) => {
return "baz";
};

bifornCringer =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) =>
(restOfTheArguments12345678) => {
return "baz";
};

bifornCringer =
askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) => {
return "baz";
};

const bifornCringer1 =
(askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo) => (restOfTheArguments12345678) => {
return "baz";
});

const bifornCringer2 =
(askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) =>
(restOfTheArguments12345678) => {
return "baz";
});

const bifornCringer3 =
(askTrovenaBeenaDepends =
glimseGlyphs =
(argumentOne, argumentTwo, argumentThree) => {
return "baz";
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a = () => ({} = this);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a = () => ({} = this);
Loading

0 comments on commit e8b2f33

Please sign in to comment.