Test flow parser that both valid in ts and flow (#19901)
This commit is contained in:
1 parent
aaa71f4b0e
commit
9f114788fd
6 files changed
+101
-99
No files matched your search
@@ -747,67 +747,6 @@ class Overload {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`after-jsx-generic.tsx format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
let comp = (
|
||||
<>
|
||||
<Component<number> /* comment1 */></Component>
|
||||
<Component<number> foo /* comment2 */></Component>
|
||||
<Component<number> /* comment3 */ bar></Component>
|
||||
<Component<number> foo /* comment4 */ bar></Component>
|
||||
|
||||
<Component<number>
|
||||
// comment5
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment6
|
||||
></Component>
|
||||
<Component<number>
|
||||
// comment7
|
||||
foo
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment8
|
||||
bar
|
||||
></Component>
|
||||
</>
|
||||
);
|
||||
|
||||
=====================================output=====================================
|
||||
let comp = (
|
||||
<>
|
||||
<Component<number> /* comment1 */></Component>
|
||||
<Component<number> foo /* comment2 */></Component>
|
||||
<Component<number> /* comment3 */ bar></Component>
|
||||
<Component<number> foo /* comment4 */ bar></Component>
|
||||
|
||||
<Component<number>
|
||||
// comment5
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment6
|
||||
></Component>
|
||||
<Component<number>
|
||||
// comment7
|
||||
foo
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment8
|
||||
bar
|
||||
></Component>
|
||||
</>
|
||||
);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`declare_function.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
@@ -974,27 +913,6 @@ export type AsyncExecuteOptions = child_process$execFileOpts & {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`jsx.tsx format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
var example1 = <div>
|
||||
https://test
|
||||
</div>;
|
||||
|
||||
var example2 = <div>
|
||||
/*test*/
|
||||
</div>;
|
||||
|
||||
=====================================output=====================================
|
||||
var example1 = <div>https://test</div>;
|
||||
|
||||
var example2 = <div>/*test*/</div>;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`location.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
@@ -1548,23 +1466,6 @@ interface Foo {
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`types.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
(() => {
|
||||
// swallow error and fallback to using directory as path
|
||||
}) as string[];
|
||||
|
||||
=====================================output=====================================
|
||||
(() => {
|
||||
// swallow error and fallback to using directory as path
|
||||
}) as string[];
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`union.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript"]
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`after-jsx-generic.tsx format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "flow"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
let comp = (
|
||||
<>
|
||||
<Component<number> /* comment1 */></Component>
|
||||
<Component<number> foo /* comment2 */></Component>
|
||||
<Component<number> /* comment3 */ bar></Component>
|
||||
<Component<number> foo /* comment4 */ bar></Component>
|
||||
|
||||
<Component<number>
|
||||
// comment5
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment6
|
||||
></Component>
|
||||
<Component<number>
|
||||
// comment7
|
||||
foo
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment8
|
||||
bar
|
||||
></Component>
|
||||
</>
|
||||
);
|
||||
|
||||
=====================================output=====================================
|
||||
let comp = (
|
||||
<>
|
||||
<Component<number> /* comment1 */></Component>
|
||||
<Component<number> foo /* comment2 */></Component>
|
||||
<Component<number> /* comment3 */ bar></Component>
|
||||
<Component<number> foo /* comment4 */ bar></Component>
|
||||
|
||||
<Component<number>
|
||||
// comment5
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment6
|
||||
></Component>
|
||||
<Component<number>
|
||||
// comment7
|
||||
foo
|
||||
></Component>
|
||||
<Component<number>
|
||||
foo
|
||||
// comment8
|
||||
bar
|
||||
></Component>
|
||||
</>
|
||||
);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`jsx.tsx format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "flow"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
var example1 = <div>
|
||||
https://test
|
||||
</div>;
|
||||
|
||||
var example2 = <div>
|
||||
/*test*/
|
||||
</div>;
|
||||
|
||||
=====================================output=====================================
|
||||
var example1 = <div>https://test</div>;
|
||||
|
||||
var example2 = <div>/*test*/</div>;
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`types.ts format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["typescript", "flow"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
(() => {
|
||||
// swallow error and fallback to using directory as path
|
||||
}) as string[];
|
||||
|
||||
=====================================output=====================================
|
||||
(() => {
|
||||
// swallow error and fallback to using directory as path
|
||||
}) as string[];
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
runFormatTest(import.meta, ["typescript", "flow"]);
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user