Skip to content

Commit

Permalink
prettierx test: move prettierX-specific test variations
Browse files Browse the repository at this point in the history
into tests/format/x subdirectory tree

based on some updates proposed in:

- #603

update test comments

rename dirpath -> dirPath to avoid spellcheck issues with
updates from upstream Prettier

Co-authored-by: Adaline Valentina Simonian <[email protected]>
Co-authored-by: Christopher J. Brody <[email protected]>
  • Loading branch information
Christopher J. Brody and adalinesimonian committed Jun 28, 2021
1 parent a1002df commit f3f7526
Show file tree
Hide file tree
Showing 53 changed files with 113 additions and 113 deletions.
9 changes: 0 additions & 9 deletions tests/computed_props/with-inner-spacing/jsfmt.spec.js

This file was deleted.

9 changes: 0 additions & 9 deletions tests/empty_paren_comment/with-inner-spacing/jsfmt.spec.js

This file was deleted.

9 changes: 0 additions & 9 deletions tests/empty_statement/with-inner-spacing/jsfmt.spec.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// This test script runs for test files in parent directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/..`;

run_spec(dirpath, ["__ng_interpolation"], {
run_spec(dirPath, ["__ng_interpolation"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
computedPropertySpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../flow_function_parentheses`;

// [prettierx] test with --paren-spacing, only with defaults
// including arrowParens: "avoid"
// (note that this combination is **not** recommended)
run_spec(dirpath, ["flow", "babel", "babel-flow"], {
run_spec(dirPath, ["flow", "babel", "babel-flow"], {
spaceInParens: true,
typeAngleBracketSpacing: true,
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// This test script runs for test files in parent directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/..`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// "Standard JS":
alignObjectProperties: true,
// prettierx: test with --paren-spacing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../arrows`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] recommended option, especially in combo with --paren-spacing
arrowParens: "avoid",
// [prettierx] test with --paren-spacing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../binary-expressions`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
computedPropertySpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../break-calls`;

run_spec(dirpath, ["babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel-flow", "flow", "typescript"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
arrayBracketSpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../comments_closure_typecast`;

run_spec(dirpath, ["babel", "babel-flow"], {
run_spec(dirPath, ["babel", "babel-flow"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
arrayBracketSpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// [prettierx] test script notice:
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirPath = `${__dirname}/../../../../computed_props`;

run_spec(dirPath, ["babel", "babel-flow"], {
computedPropertySpacing: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// [prettierx] test script notice:
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirPath = `${__dirname}/../../../../empty_statement`;

run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
spaceInParens: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// [prettierx] test script notice:
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirPath = `${__dirname}/../../../../empty_paren_comment`;

run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
spaceInParens: true,
});
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../if`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] test with --break-before-else
breakBeforeElse: true,
// recommended:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../method-chain`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] recommended setting with --paren-spacing
arrowParens: "avoid",
// [prettierx] test with --paren-spacing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// This test script runs for test files in parent directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/..`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
indentChains: false,
spaceInParens: true,
spaceUnaryOps: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../template`;

run_spec(dirpath, ["babel", "babel-flow"], {
run_spec(dirPath, ["babel", "babel-flow"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
arrayBracketSpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../ternaries`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] balanced ternary formatting option
// (with improved consistency with "Standard JS"):
offsetTernaryExpressions: true,
Expand All @@ -13,7 +13,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
tabWidth: 4,
// [prettierx] balanced ternary formatting option
Expand All @@ -24,7 +24,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
useTabs: true,
// [prettierx] balanced ternary formatting option
Expand All @@ -35,7 +35,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
useTabs: true,
tabWidth: 4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../ternaries`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
spaceInParens: true,
arrayBracketSpacing: true,
computedPropertySpacing: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// This test script runs for test files in parent directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/..`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] balanced ternary formatting option,
// for consistency with "Standard JS":
offsetTernaryExpressions: true,
Expand All @@ -13,7 +13,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
tabWidth: 4,
// [prettierx] balanced ternary formatting option,
Expand All @@ -24,7 +24,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
useTabs: true,
// [prettierx] balanced ternary formatting option,
Expand All @@ -35,7 +35,7 @@ run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
trailingComma: "none",
});

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// variation from ../jsfmt.spec.js:
useTabs: true,
tabWidth: 4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../test_declarations`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
// [prettierx] recommended option, especially in combo with --paren-spacing
arrowParens: "avoid",
// [prettierx] test with --paren-spacing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../jsx`;

run_spec(dirpath, ["babel", "babel-flow", "flow", "typescript"], {
run_spec(dirPath, ["babel", "babel-flow", "flow", "typescript"], {
singleQuote: false,
jsxSingleQuote: false,
// [prettierx] test with --paren-spacing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../css_scss`;

run_spec(dirpath, ["scss"], {
run_spec(dirPath, ["scss"], {
// [prettierx] test with --css-paren-spacing
cssParenSpacing: true,
});
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../typescript_conditional_types`;

run_spec(dirpath, ["typescript"], {
run_spec(dirPath, ["typescript"], {
// [prettierx] balanced ternary formatting option
// (with improved consistency with "Standard JS"):
offsetTernaryExpressions: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../typescript/conformance/types/indexedAccesType`;

run_spec(dirpath, ["typescript"], {
run_spec(dirPath, ["typescript"], {
// [prettierx] test with --paren-spacing
spaceInParens: true,
typeAngleBracketSpacing: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// [prettierx] test script notice:
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirPath = `${__dirname}/../../../../typescript/conformance/types/mappedType`;

run_spec(dirPath, ["typescript"], {
typeCurlySpacing: false,
});
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [prettierx] test script notice:
// This test script runs for test files in parent directory,
// This test script runs for test files in another directory,
// **not** on any files in *this* directory.

const dirpath = `${__dirname}/..`;
const dirPath = `${__dirname}/../../../../typescript/custom/modifiers`;

run_spec(dirpath, ["typescript"], {
run_spec(dirPath, ["typescript"], {
// [prettierx] test with spacing options (...)
typeAngleBracketSpacing: true,
typeBracketSpacing: true,
Expand Down
Loading

0 comments on commit f3f7526

Please sign in to comment.