This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(rome_js_formatter): update prettier tests (#3684)
- Loading branch information
1 parent
9b5dcdc
commit e8b2f33
Showing
349 changed files
with
12,664 additions
and
324 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
crates/rome_js_formatter/tests/specs/prettier/js/arrays/holes-in-args.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/rome_js_formatter/tests/specs/prettier/js/arrays/numbers-negative.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...es/rome_js_formatter/tests/specs/prettier/js/arrows/arrow-chain-with-trailing-comments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
16 changes: 16 additions & 0 deletions
16
...matter/tests/specs/prettier/js/arrows/arrow-chain-with-trailing-comments.js.prettier-snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
34 changes: 34 additions & 0 deletions
34
crates/rome_js_formatter/tests/specs/prettier/js/arrows/arrow_function_expression.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; |
35 changes: 35 additions & 0 deletions
35
...me_js_formatter/tests/specs/prettier/js/arrows/arrow_function_expression.js.prettier-snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
136 changes: 136 additions & 0 deletions
136
crates/rome_js_formatter/tests/specs/prettier/js/arrows/arrow_function_expression.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
``` | ||
|
||
|
||
|
44 changes: 44 additions & 0 deletions
44
crates/rome_js_formatter/tests/specs/prettier/js/arrows/assignment-chain-with-arrow-chain.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
}; |
43 changes: 43 additions & 0 deletions
43
...rmatter/tests/specs/prettier/js/arrows/assignment-chain-with-arrow-chain.js.prettier-snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
}); |
1 change: 1 addition & 0 deletions
1
crates/rome_js_formatter/tests/specs/prettier/js/arrows/block_like.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a = () => ({} = this); |
1 change: 1 addition & 0 deletions
1
crates/rome_js_formatter/tests/specs/prettier/js/arrows/block_like.js.prettier-snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a = () => ({} = this); |
Oops, something went wrong.