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

Commit

Permalink
chore: move the new tests to their own file
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev authored Jul 18, 2023
1 parent 52c0626 commit cd530e2
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 14 deletions.
14 changes: 0 additions & 14 deletions crates/rome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ const APPLY_TRAILING_COMMA_AFTER: &str = r#"const a = [
const APPLY_ARROW_PARENTHESES_BEFORE: &str = r#"
action => {}
(action) => {}
(action?) => {}
(action: h) => {}
(action): h => {}
(
action
// hhhhhhhh
) => {}
({ action }) => {}
([ action ]) => {}
(...action) => {}
Expand All @@ -70,13 +63,6 @@ action => {}

const APPLY_ARROW_PARENTHESES_AFTER: &str = r#"action => {};
action => {};
(action?) => {};
(action: h) => {};
(action): h => {};
(
action
// hhhhhhhh
) => {}
({ action }) => {};
([action]) => {};
(...action) => {};
Expand Down
13 changes: 13 additions & 0 deletions crates/rome_js_formatter/tests/specs/ts/arrow/arrow_parentheses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
action => {}
(action) => {}
(action?) => {}
(action: string) => {}
(action): void => {}
(
action
// hhhhhhhh
) => {}
({ action }) => {}
([ action ]) => {}
(...action) => {}
(action = 1) => {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info: ts/arrow/arrow_parentheses.ts
---

# Input

```ts
action => {}
(action) => {}
(action?) => {}
(action: string) => {}
(action): void => {}
(
action
// hhhhhhhh
) => {}
({ action }) => {}
([ action ]) => {}
(...action) => {}
(action = 1) => {}

```


=============================

# Outputs

## Output 1

-----
Indent style: Tab
Line width: 80
Quote style: Double Quotes
JSX quote style: Double Quotes
Quote properties: As needed
Trailing comma: All
Semicolons: Always
Arrow parentheses: Always
-----

```ts
(action) => {};
(action) => {};
(action?) => {};
(action: string) => {};
(action): void => {};
(
action,
// hhhhhhhh
) => {};
({ action }) => {};
([action]) => {};
(...action) => {};
(action = 1) => {};
```

## Output 2

-----
Indent style: Tab
Line width: 80
Quote style: Double Quotes
JSX quote style: Double Quotes
Quote properties: As needed
Trailing comma: All
Semicolons: Always
Arrow parentheses: As needed
-----

```ts
action => {};
action => {};
(action?) => {};
(action: string) => {};
(action): void => {};
(
action,
// hhhhhhhh
) => {};
({ action }) => {};
([action]) => {};
(...action) => {};
(action = 1) => {};
```


7 changes: 7 additions & 0 deletions crates/rome_js_formatter/tests/specs/ts/arrow/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cases": [
{
"arrow_parentheses": "AsNeeded"
}
]
}

0 comments on commit cd530e2

Please sign in to comment.