Skip to content

Commit

Permalink
[prettierx] test even more cases on all Babel parsers
Browse files Browse the repository at this point in the history
(in prettierx-rebase-branch-001)

for improved consistency with prettierX 0.18.x
  • Loading branch information
brodycj committed Jun 29, 2021
1 parent b87a3ef commit c8ac73e
Show file tree
Hide file tree
Showing 26 changed files with 190 additions and 160 deletions.
32 changes: 16 additions & 16 deletions tests/format/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`arrow.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -54,7 +54,7 @@ function f2() {

exports[`bitwise-flags.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -76,7 +76,7 @@ const all = FLAG_A | FLAG_B | FLAG_C;

exports[`call.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -206,7 +206,7 @@ printWidth: 80

exports[`comment.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -327,7 +327,7 @@ foo[

exports[`equality.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -357,7 +357,7 @@ x !== y !== z;

exports[`exp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -387,7 +387,7 @@ a ** (b * c);

exports[`if.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -426,7 +426,7 @@ if (

exports[`inline-jsx.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -464,7 +464,7 @@ const avatar2 = (hasAvatar || showPlaceholder) && (

exports[`inline-object-array.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -658,7 +658,7 @@ const obj = {

exports[`jsx_parent.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -749,7 +749,7 @@ exports[`like-regexp.js [espree] format 1`] = `

exports[`like-regexp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -763,7 +763,7 @@ printWidth: 80

exports[`math.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -819,7 +819,7 @@ x & (y >> z);
exports[`return.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -866,7 +866,7 @@ function foo3() {
exports[`short-right.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -913,7 +913,7 @@ defaultContent.filter((defaultLocale) => {
exports[`test.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -1002,7 +1002,7 @@ foo(
exports[`unary.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down
4 changes: 3 additions & 1 deletion tests/format/js/binary-expressions/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
run_spec(__dirname, ["babel", "flow", "typescript"], {
// [prettierx] test with all Babel parsers
// (babel-ts is normally included with typescript by default)
run_spec(__dirname, ["babel", "babel-flow", "flow", "typescript"], {
errors: { espree: ["like-regexp.js"] },
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`array.js - {"objectCurlySpacing":false} format 1`] = `
====================================options=====================================
objectCurlySpacing: false
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -19,7 +19,7 @@ const arr2 = [1, 2, 3, 4];

exports[`array.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -36,7 +36,7 @@ const arr2 = [1, 2, 3, 4];
exports[`object.js - {"objectCurlySpacing":false} format 1`] = `
====================================options=====================================
objectCurlySpacing: false
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -52,7 +52,7 @@ const obj2 = {a: 1, b: 2, c: 3};

exports[`object.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down
6 changes: 4 additions & 2 deletions tests/format/js/bracket-spacing/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
run_spec(__dirname, ["babel", "flow", "typescript"]);
// [prettierx] test with all Babel parsers
// (babel-ts is normally included with typescript by default)
run_spec(__dirname, ["babel", "babel-flow", "flow", "typescript"]);
// [prettierx]: broken-out bracket spacing options
run_spec(__dirname, ["babel", "flow", "typescript"], {
run_spec(__dirname, ["babel", "babel-flow", "flow", "typescript"], {
objectCurlySpacing: false,
});
8 changes: 4 additions & 4 deletions tests/format/js/break-calls/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`break.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -104,7 +104,7 @@ expect(

exports[`parent.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -134,7 +134,7 @@ runtimeAgent.getProperties(

exports[`react.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -316,7 +316,7 @@ function Comp5() {

exports[`reduce.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down
4 changes: 3 additions & 1 deletion tests/format/js/break-calls/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
run_spec(__dirname, ["babel", "flow", "typescript"]);
// [prettierx] test with all Babel parsers
// (babel-ts is normally included with typescript by default)
run_spec(__dirname, ["babel", "babel-flow", "flow", "typescript"]);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`binary-expr.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -17,7 +17,7 @@ var a = b || /** @type {string} */ (c);

exports[`closure-compiler-type-cast.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -151,7 +151,7 @@ const style2 = /**

exports[`comment-in-the-middle.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -185,7 +185,7 @@ console.log(a.foo());

exports[`comment-placement.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -230,7 +230,7 @@ const foo5 = /** @type {string} */ (value);

exports[`extra-spaces-and-asterisks.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -258,7 +258,7 @@ const foo8 = /** @type {!Foo} ** * * */ (bar);

exports[`iife.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -296,7 +296,7 @@ const helpers = /** @type {Helpers} */ (
exports[`iife-issue-5850-isolated.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -311,7 +311,7 @@ const a = /** @param {*} b */ ((b) => {})();
exports[`issue-4124.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -357,7 +357,7 @@ const test = /** @type (function (*): ?|undefined) */ (foo);
exports[`issue-8045.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -420,7 +420,7 @@ function jsdocCastInReturn() {
exports[`issue-9358.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -446,7 +446,7 @@ const fooooba3 = /** @type {Array.<fooo.barr.baaaaaaz>} */ (
exports[`member.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand All @@ -460,7 +460,7 @@ foo = /** @type {!Baz} */ (baz).bar;
exports[`nested.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -490,7 +490,7 @@ const BarImpl = /** @type {BarConstructor} */ (
exports[`non-casts.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -538,7 +538,7 @@ const w1 = /** @typefoo Foo */ value;
exports[`object-with-comment.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down Expand Up @@ -573,7 +573,7 @@ const objectWithComment2 = /** @type MyType */ (
exports[`ways-to-specify-type.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
parsers: ["babel", "babel-flow", "babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down
4 changes: 3 additions & 1 deletion tests/format/js/comments-closure-typecast/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
run_spec(__dirname, ["babel"]);
// [prettierx] test with all Babel parsers
// [TBD] Skip flow & typescript for now due to differences in the snapshot)
run_spec(__dirname, ["babel", "babel-flow", "babel-ts"]);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`classes.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
parsers: ["babel", "babel-flow", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
Expand Down
4 changes: 3 additions & 1 deletion tests/format/js/computed-props/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
run_spec(__dirname, ["babel", "flow", "typescript"]);
// [prettierx] test with all Babel parsers
// (babel-ts is normally included with typescript by default)
run_spec(__dirname, ["babel", "babel-flow", "flow", "typescript"]);
Loading

0 comments on commit c8ac73e

Please sign in to comment.