From 3375cfe6050721d2f08956ecb056e3d33155975f Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 24 Jan 2017 14:35:37 -0800 Subject: [PATCH] Move tests around (#454) * new_tests * move_all_clobbered_tests * remove all the tests that no longer exist * re-run flow tests * Move all the flow tests to tests/flow and prettier to tests/ * Move prettier tests to their own folders * Add jsfmt files * run prettier snapshot tests --- .../__snapshots__/jsfmt.spec.js.snap | 51 - tests/array_spread/jsfmt.spec.js | 1 - tests/arrays/__snapshots__/jsfmt.spec.js.snap | 101 -- tests/arrows/__snapshots__/jsfmt.spec.js.snap | 54 +- tests/arrows/block_like.js | 1 + tests/async/__snapshots__/jsfmt.spec.js.snap | 522 +----- tests/async/await_parse.js | 27 +- .../__snapshots__/jsfmt.spec.js.snap | 61 + .../jsfmt.spec.js | 0 .../test.js} | 0 .../classes/__snapshots__/jsfmt.spec.js.snap | 277 ---- .../__snapshots__/jsfmt.spec.js.snap | 140 -- .../__snapshots__/jsfmt.spec.js.snap | 14 + tests/{annot/any => directives}/jsfmt.spec.js | 0 .../directives.js => directives/test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 1467 ----------------- .../__snapshots__/jsfmt.spec.js.snap | 28 - .../exports/__snapshots__/jsfmt.spec.js.snap | 12 + tests/{annot => exports}/jsfmt.spec.js | 0 .../{prettier/exports.js => exports/test.js} | 0 .../abnormal/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/abnormal/break-continue.js | 0 tests/{annot2 => flow/abnormal}/jsfmt.spec.js | 0 tests/{ => flow}/abnormal/return.js | 0 .../annot/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/annot/annot.js | 0 tests/{ => flow}/annot/any/A.js | 0 tests/{ => flow}/annot/any/B.js | 0 .../any/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow/annot}/any/jsfmt.spec.js | 0 tests/{ => flow}/annot/forward_ref.js | 0 tests/{ => flow}/annot/issue-530.js | 0 tests/{arith => flow/annot}/jsfmt.spec.js | 0 tests/{ => flow}/annot/leak.js | 0 tests/{ => flow}/annot/other.js | 0 tests/{ => flow}/annot/scope.js | 0 tests/{ => flow}/annot/test.js | 0 tests/{ => flow}/annot2/A.js | 0 tests/{ => flow}/annot2/B.js | 0 tests/{ => flow}/annot2/T.js | 0 .../annot2/__snapshots__/jsfmt.spec.js.snap | 0 .../annot2}/jsfmt.spec.js | 0 .../any/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/any/any.js | 0 tests/{ => flow}/any/anyexportflowfile.js | 0 tests/{ => flow}/any/flowfixme.js | 0 tests/{ => flow}/any/flowissue.js | 0 tests/{arraylib => flow/any}/jsfmt.spec.js | 0 tests/{ => flow}/any/nonflowfile.js | 0 tests/{ => flow}/any/propagate.js | 0 tests/{ => flow}/any/reach.js | 0 tests/{ => flow}/arith/Arith.js | 0 .../arith/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/arith/exponent.js | 0 tests/{ => flow}/arith/generic.js | 0 .../arith}/jsfmt.spec.js | 0 tests/{ => flow}/arith/mult.js | 0 tests/{ => flow}/arith/relational.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../array-filter}/jsfmt.spec.js | 0 tests/{ => flow}/array-filter/test.js | 0 tests/{ => flow}/array-filter/test2.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 20 + .../array_spread}/jsfmt.spec.js | 0 tests/{ => flow}/array_spread/test.js | 0 .../arraylib/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/arraylib/array_lib.js | 0 .../lib => flow/arraylib}/jsfmt.spec.js | 0 tests/{ => flow}/arrays/Arrays.js | 0 .../arrays/__snapshots__/jsfmt.spec.js.snap | 100 ++ tests/{binary => flow/arrays}/jsfmt.spec.js | 0 tests/{ => flow}/arrays/numeric_elem.js | 0 .../arrows/__snapshots__/jsfmt.spec.js.snap | 52 + tests/{ => flow}/arrows/advanced_arrows.js | 0 tests/{ => flow}/arrows/arrows.js | 2 - tests/{binding => flow/arrows}/jsfmt.spec.js | 0 .../async/__snapshots__/jsfmt.spec.js.snap | 519 ++++++ tests/{ => flow}/async/async.js | 0 tests/{ => flow}/async/async2.js | 0 tests/{ => flow}/async/async3.js | 0 tests/{ => flow}/async/async_base_class.js | 0 tests/{ => flow}/async/async_parse.js | 0 tests/{ => flow}/async/async_promise.js | 0 tests/{ => flow}/async/async_return_void.js | 0 tests/flow/async/await_parse.js | 24 + tests/{bom => flow/async}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../async_iteration/delegate_yield.js | 0 tests/{ => flow}/async_iteration/generator.js | 0 .../async_iteration}/jsfmt.spec.js | 0 tests/{ => flow}/async_iteration/return.js | 0 tests/{ => flow}/async_iteration/throw.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/autocomplete/customfun.js | 0 .../autocomplete}/jsfmt.spec.js | 0 tests/{ => flow}/autocomplete/unknown.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/auxiliary/client.js | 0 .../auxiliary}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../auxiliary/lib}/jsfmt.spec.js | 0 tests/{ => flow}/auxiliary/lib/lib.js | 0 .../binary/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/binary/in.js | 0 .../binary}/jsfmt.spec.js | 0 .../binding/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/binding/const.js | 0 .../{callable => flow/binding}/jsfmt.spec.js | 0 tests/{ => flow}/binding/rebinding.js | 0 tests/{ => flow}/binding/scope.js | 0 tests/{ => flow}/binding/tdz.js | 0 tests/{ => flow}/bom/FormData.js | 0 tests/{ => flow}/bom/MutationObserver.js | 0 .../bom/__snapshots__/jsfmt.spec.js.snap | 0 .../bom}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../bounded_poly}/jsfmt.spec.js | 0 tests/{ => flow}/bounded_poly/scope.js | 0 tests/{ => flow}/bounded_poly/test.js | 0 .../break/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/break/break.js | 0 .../break}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../builtin_uses}/jsfmt.spec.js | 0 tests/{ => flow}/builtin_uses/test.js | 0 tests/{ => flow}/builtin_uses/test2.js | 0 .../builtins/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/builtins/array.js | 0 tests/{ => flow}/builtins/genericfoo.js | 0 .../builtins}/jsfmt.spec.js | 0 tests/{ => flow}/call_properties/A.js | 0 tests/{ => flow}/call_properties/B.js | 0 tests/{ => flow}/call_properties/C.js | 0 tests/{ => flow}/call_properties/D.js | 0 tests/{ => flow}/call_properties/E.js | 0 tests/{ => flow}/call_properties/F.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../call_properties}/jsfmt.spec.js | 0 .../callable/__snapshots__/jsfmt.spec.js.snap | 0 .../{commonjs => flow/callable}/jsfmt.spec.js | 0 tests/{ => flow}/callable/optional.js | 0 tests/{ => flow}/callable/primitives.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../check-contents}/jsfmt.spec.js | 0 tests/{ => flow}/check-contents/not_flow.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../class_munging}/jsfmt.spec.js | 0 .../{ => flow}/class_munging/with_munging.js | 0 .../class_munging/without_munging.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../class_statics}/jsfmt.spec.js | 0 tests/{ => flow}/class_statics/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../class_subtyping}/jsfmt.spec.js | 0 tests/{ => flow}/class_subtyping/test.js | 0 tests/{ => flow}/class_subtyping/test2.js | 0 tests/{ => flow}/class_subtyping/test3.js | 0 tests/{ => flow}/class_subtyping/test4.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../class_type}/jsfmt.spec.js | 0 tests/{ => flow}/class_type/test.js | 0 tests/{ => flow}/class_type/test2.js | 0 tests/{ => flow}/classes/A.js | 0 tests/{ => flow}/classes/B.js | 0 tests/{ => flow}/classes/C.js | 0 tests/{ => flow}/classes/D.js | 0 .../classes/__snapshots__/jsfmt.spec.js.snap | 276 ++++ tests/{ => flow}/classes/class_shapes.js | 0 tests/{ => flow}/classes/expr.js | 0 .../dir => flow/classes}/jsfmt.spec.js | 0 tests/{ => flow}/classes/loc.js | 0 tests/{ => flow}/classes/statics.js | 0 tests/{ => flow}/closure/Closure.js | 0 .../closure/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/closure/cond_havoc.js | 0 tests/{ => flow}/closure/const.js | 0 .../closure}/jsfmt.spec.js | 0 tests/{ => flow}/commonjs/Abs.js | 0 tests/{ => flow}/commonjs/Rel.js | 0 .../commonjs/__snapshots__/jsfmt.spec.js.snap | 0 .../commonjs}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 139 ++ .../src => flow/computed_props}/jsfmt.spec.js | 0 tests/{ => flow}/computed_props/test.js | 0 tests/{ => flow}/computed_props/test2.js | 0 tests/{ => flow}/computed_props/test3.js | 0 tests/{ => flow}/computed_props/test4.js | 0 tests/{ => flow}/computed_props/test5.js | 0 tests/{ => flow}/computed_props/test6.js | 0 tests/{ => flow}/computed_props/test7.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/conditional/conditional.js | 0 .../conditional}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_all}/jsfmt.spec.js | 0 tests/{ => flow}/config_all/no_at_flow.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_all_false}/jsfmt.spec.js | 0 .../{ => flow}/config_all_false/no_at_flow.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_all_weak}/jsfmt.spec.js | 0 .../{ => flow}/config_all_weak/no_at_flow.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_file_extensions}/jsfmt.spec.js | 0 .../{ => flow}/config_file_extensions/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../dir/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/config_ignore/dir/foo.js | 0 .../config_ignore/dir}/jsfmt.spec.js | 0 tests/{ => flow}/config_ignore/foo.js | 0 .../config_ignore}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../main.js | 0 .../src/__snapshots__/jsfmt.spec.js.snap | 0 .../src}/jsfmt.spec.js | 0 .../src/testmodule.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../test.js | 0 .../config_module_name_rewrite_haste/A.js | 0 .../Exists.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../config_module_name_rewrite_node/A.js | 0 .../config_module_name_rewrite_node/Exists.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../testproj/__snapshots__/jsfmt.spec.js.snap | 0 .../custom_resolve_dir/testproj/index.js | 0 .../testproj}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../custom_resolve_dir/testproj2/index.js | 0 .../testproj2}/jsfmt.spec.js | 0 .../jsfmt.spec.js | 0 .../subdir/__snapshots__/jsfmt.spec.js.snap | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../custom_resolve_dir/testproj2/index.js | 0 .../testproj2}/jsfmt.spec.js | 0 .../subdir}/jsfmt.spec.js | 0 .../subdir/sublevel.js | 0 .../toplevel.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_munging_underscores/chain.js | 0 .../commonjs_export.js | 0 .../commonjs_import.js | 0 .../config_munging_underscores}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../config_munging_underscores2/chain.js | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{date => flow/const_params}/jsfmt.spec.js | 0 tests/{ => flow}/const_params/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/constructor/constructor.js | 0 .../_d3 => flow/constructor}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../constructor_annots/constructors.js | 0 .../constructor_annots}/jsfmt.spec.js | 0 tests/{ => flow}/constructor_annots/test.js | 0 .../ignore/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/contents/ignore/dummy.js | 0 .../contents/ignore}/jsfmt.spec.js | 0 tests/{ => flow}/contents/ignore/test.js | 0 .../no_flow/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/contents/no_flow/dummy.js | 0 .../contents/no_flow}/jsfmt.spec.js | 0 tests/{ => flow}/contents/no_flow/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/core_tests/boolean.js | 0 .../ws/test => flow/core_tests}/jsfmt.spec.js | 0 tests/{ => flow}/core_tests/map.js | 0 tests/{ => flow}/core_tests/regexp.js | 0 tests/{ => flow}/core_tests/weakset.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../_d3 => flow/covariance}/jsfmt.spec.js | 0 tests/{ => flow}/covariance/test.js | 0 .../coverage/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/coverage/crash.js | 0 tests/{ => flow}/coverage/declare_module.js | 0 .../foo/bar => flow/coverage}/jsfmt.spec.js | 0 tests/{ => flow}/coverage/no_pragma.js | 0 tests/{ => flow}/coverage/non-termination.js | 0 tests/{ => flow}/cycle/A.js | 0 tests/{ => flow}/cycle/B.js | 0 .../cycle/__snapshots__/jsfmt.spec.js.snap | 0 .../cycle}/jsfmt.spec.js | 0 .../date/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/date/date.js | 0 .../ws => flow/date}/jsfmt.spec.js | 0 .../ExplicitProvidesModuleDifferentName.js | 0 .../ExplicitProvidesModuleSameName.js | 0 .../ImplicitProvidesModule.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../_d3/__snapshots__/jsfmt.spec.js.snap | 0 .../external/_d3}/jsfmt.spec.js | 0 .../external/_d3/min.js | 0 .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 0 .../foo/bar}/jsfmt.spec.js | 0 .../foo/bar/nested_test.js | 0 .../declaration_files_haste}/jsfmt.spec.js | 0 .../{ => flow}/declaration_files_haste/md5.js | 0 .../declaration_files_haste/test.js | 0 .../ws/__snapshots__/jsfmt.spec.js.snap | 0 .../declaration_files_haste/ws/index.js | 0 .../declaration_files_haste/ws}/jsfmt.spec.js | 0 .../ws/test/__snapshots__/jsfmt.spec.js.snap | 0 .../declaration_files_haste/ws/test/client.js | 0 .../ws/test}/jsfmt.spec.js | 0 .../declaration_files_incremental_haste/A.js | 0 .../ExplicitProvidesModuleDifferentName.js | 0 .../ExplicitProvidesModuleSameName.js | 0 .../ImplicitProvidesModule.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../_d3/__snapshots__/jsfmt.spec.js.snap | 0 .../external/_d3}/jsfmt.spec.js | 0 .../external/_d3/min.js | 0 .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 0 .../foo/bar}/jsfmt.spec.js | 0 .../foo/bar/nested_test.js | 0 .../jsfmt.spec.js | 0 .../md5.js | 0 .../test.js | 0 .../ws/__snapshots__/jsfmt.spec.js.snap | 0 .../ws/index.js | 0 .../ws}/jsfmt.spec.js | 0 .../ws/test/__snapshots__/jsfmt.spec.js.snap | 0 .../ws/test/client.js | 0 .../ws/test}/jsfmt.spec.js | 0 .../declaration_files_incremental_node/A.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../test_absolute.js | 0 .../test_relative.js | 0 tests/{ => flow}/declaration_files_node/A.js | 0 .../{ => flow}/declaration_files_node/CJS.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../declaration_files_node}/jsfmt.spec.js | 0 .../declaration_files_node/test_absolute.js | 0 .../declaration_files_node/test_relative.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/declare_class/declare_class.js | 0 .../1 => flow/declare_class}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../declare_class/lib}/jsfmt.spec.js | 0 tests/{ => flow}/declare_class/lib/test.js | 0 tests/{ => flow}/declare_export/B.js | 0 tests/{ => flow}/declare_export/C.js | 0 .../CommonJS_Clobbering_Class.js | 0 .../declare_export/CommonJS_Clobbering_Lit.js | 0 .../declare_export/CommonJS_Named.js | 0 .../declare_export/ES6_DefaultAndNamed.js | 0 .../ES6_Default_AnonFunction1.js | 0 .../ES6_Default_AnonFunction2.js | 0 .../declare_export/ES6_Default_NamedClass1.js | 0 .../declare_export/ES6_Default_NamedClass2.js | 0 .../ES6_Default_NamedFunction1.js | 0 .../ES6_Default_NamedFunction2.js | 0 .../declare_export/ES6_ExportAllFromMulti.js | 0 .../ES6_ExportAllFrom_Intermediary1.js | 0 .../ES6_ExportAllFrom_Intermediary2.js | 0 .../ES6_ExportAllFrom_Source1.js | 0 .../ES6_ExportAllFrom_Source2.js | 0 .../ES6_ExportFrom_Intermediary1.js | 0 .../ES6_ExportFrom_Intermediary2.js | 0 .../declare_export/ES6_ExportFrom_Source1.js | 0 .../declare_export/ES6_ExportFrom_Source2.js | 0 tests/{ => flow}/declare_export/ES6_Named1.js | 0 tests/{ => flow}/declare_export/ES6_Named2.js | 0 .../declare_export/ProvidesModuleA.js | 0 .../ProvidesModuleCJSDefault.js | 0 .../declare_export/ProvidesModuleD.js | 0 .../ProvidesModuleES6Default.js | 0 .../{ => flow}/declare_export/SideEffects.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/declare_export/es6modules.js | 0 .../declare_export}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../declare_fun}/jsfmt.spec.js | 0 tests/{ => flow}/declare_fun/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../flow-typed}/jsfmt.spec.js | 0 .../declare_module_exports/flow-typed/libs.js | 0 .../declare_module_exports}/jsfmt.spec.js | 0 .../{ => flow}/declare_module_exports/main.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../declare_type/import_declare_type.js | 0 .../declare_type}/jsfmt.spec.js | 0 .../lib/DeclareModule_TypeAlias.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../declare_type/lib/declare_type_exports.js | 0 .../declare_type/lib}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../def_site_variance}/jsfmt.spec.js | 0 tests/{ => flow}/def_site_variance/test.js | 0 .../demo/1/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/demo/1/f.js | 0 .../demo/1}/jsfmt.spec.js | 0 tests/{ => flow}/demo/2/A.js | 0 tests/{ => flow}/demo/2/B.js | 0 .../demo/2/__snapshots__/jsfmt.spec.js.snap | 0 tests/{encaps => flow/demo/2}/jsfmt.spec.js | 0 tests/{ => flow}/deps/A.js | 0 tests/{ => flow}/deps/B.js | 0 tests/{ => flow}/deps/C.js | 0 tests/{ => flow}/deps/D.js | 0 tests/{ => flow}/deps/E.js | 0 tests/{ => flow}/deps/F.js | 0 tests/{ => flow}/deps/G.js | 0 tests/{ => flow}/deps/H.js | 0 tests/{ => flow}/deps/I.js | 0 .../deps/__snapshots__/jsfmt.spec.js.snap | 0 tests/{enumerror => flow/deps}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 5 +- tests/{ => flow}/destructuring/array_rest.js | 0 tests/{ => flow}/destructuring/computed.js | 0 tests/{ => flow}/destructuring/defaults.js | 0 .../{ => flow}/destructuring/destructuring.js | 0 .../destructuring/destructuring_param.js | 3 +- tests/{ => flow}/destructuring/eager.js | 0 .../destructuring}/jsfmt.spec.js | 0 tests/{ => flow}/destructuring/poly.js | 0 tests/{ => flow}/destructuring/rec.js | 0 tests/{ => flow}/destructuring/string_lit.js | 0 tests/{ => flow}/destructuring/unannotated.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/dictionary/any.js | 0 tests/{ => flow}/dictionary/compatible.js | 0 tests/{ => flow}/dictionary/dictionary.js | 0 tests/{ => flow}/dictionary/incompatible.js | 0 tests/{ => flow}/dictionary/issue-1745.js | 0 .../dictionary}/jsfmt.spec.js | 0 tests/{ => flow}/dictionary/test.js | 0 tests/{ => flow}/dictionary/test_client.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/disjoint-union-perf/ast.js | 0 tests/{ => flow}/disjoint-union-perf/emit.js | 0 tests/{ => flow}/disjoint-union-perf/jsAst.js | 0 .../disjoint-union-perf}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../docblock_flow}/jsfmt.spec.js | 0 .../docblock_flow/license_with_flow.js | 0 .../docblock_flow/max_header_tokens.js | 0 .../docblock_flow/multiple_flows_1.js | 0 .../docblock_flow/multiple_flows_2.js | 0 .../multiple_providesModule_1.js | 0 .../multiple_providesModule_2.js | 0 .../docblock_flow/use_strict_with_flow.js | 0 tests/{ => flow}/docblock_flow/with_flow.js | 0 .../{ => flow}/docblock_flow/without_flow.js | 0 .../dom/CanvasRenderingContext2D.js | 0 tests/{ => flow}/dom/CustomEvent.js | 0 tests/{ => flow}/dom/Document.js | 0 tests/{ => flow}/dom/Element.js | 0 tests/{ => flow}/dom/HTMLCanvasElement.js | 0 tests/{ => flow}/dom/HTMLElement.js | 0 tests/{ => flow}/dom/HTMLInputElement.js | 0 tests/{ => flow}/dom/URL.js | 0 .../dom/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/dom/eventtarget.js | 0 .../dom}/jsfmt.spec.js | 0 tests/{ => flow}/dom/path2d.js | 0 tests/{ => flow}/dom/registerElement.js | 0 tests/{ => flow}/dom/traversal.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/dump-types/import.js | 0 .../dump-types}/jsfmt.spec.js | 0 tests/{ => flow}/dump-types/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../duplicate_methods}/jsfmt.spec.js | 0 tests/{ => flow}/duplicate_methods/test.js | 0 .../encaps/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/encaps/encaps.js | 0 .../encaps}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/enumerror/enumerror.js | 0 .../enumerror}/jsfmt.spec.js | 0 .../equals/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/equals/equals.js | 0 .../equals}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/error_messages/errors.js | 0 .../error_messages}/jsfmt.spec.js | 0 tests/{ => flow}/es6modules/B.js | 0 tests/{ => flow}/es6modules/C.js | 0 .../es6modules/CommonJS_Clobbering_Class.js | 0 .../es6modules/CommonJS_Clobbering_Frozen.js | 0 .../es6modules/CommonJS_Clobbering_Lit.js | 0 tests/{ => flow}/es6modules/CommonJS_Named.js | 0 .../es6modules/ES6_DefaultAndNamed.js | 0 .../es6modules/ES6_Default_AnonClass1.js | 0 .../es6modules/ES6_Default_AnonClass2.js | 0 .../es6modules/ES6_Default_AnonFunction1.js | 0 .../es6modules/ES6_Default_AnonFunction2.js | 0 .../es6modules/ES6_Default_NamedClass1.js | 0 .../es6modules/ES6_Default_NamedClass2.js | 0 .../es6modules/ES6_Default_NamedFunction1.js | 0 .../es6modules/ES6_Default_NamedFunction2.js | 0 .../es6modules/ES6_ExportAllFromMulti.js | 0 .../ES6_ExportAllFrom_Intermediary1.js | 0 .../ES6_ExportAllFrom_Intermediary2.js | 0 .../es6modules/ES6_ExportAllFrom_Source1.js | 0 .../es6modules/ES6_ExportAllFrom_Source2.js | 0 .../ES6_ExportFrom_Intermediary1.js | 0 .../ES6_ExportFrom_Intermediary2.js | 0 .../es6modules/ES6_ExportFrom_Source1.js | 0 .../es6modules/ES6_ExportFrom_Source2.js | 0 tests/{ => flow}/es6modules/ES6_Named1.js | 0 tests/{ => flow}/es6modules/ES6_Named2.js | 0 tests/{ => flow}/es6modules/ExportType.js | 0 .../{ => flow}/es6modules/ProvidesModuleA.js | 0 .../es6modules/ProvidesModuleCJSDefault.js | 0 .../{ => flow}/es6modules/ProvidesModuleD.js | 0 .../es6modules/ProvidesModuleES6Default.js | 0 tests/{ => flow}/es6modules/SideEffects.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 1466 ++++++++++++++++ tests/{ => flow}/es6modules/es6modules.js | 0 .../es6modules}/jsfmt.spec.js | 0 .../es6modules/test_imports_are_frozen.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../es_declare_module/es_declare_module.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../es_declare_module/flow-typed/declares.js | 0 .../flow-typed}/jsfmt.spec.js | 0 .../es_declare_module}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../esproposal_export_star_as.enable/dest.js | 0 .../jsfmt.spec.js | 0 .../source.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../esproposal_export_star_as.ignore/dest.js | 0 .../jsfmt.spec.js | 0 .../source.js | 0 tests/{ => flow}/export_default/P.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 27 + .../export_default}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../export_default/lib}/jsfmt.spec.js | 0 tests/{ => flow}/export_default/lib/lib.js | 0 tests/{ => flow}/export_default/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/export_type/cjs_with_types.js | 0 tests/{ => flow}/export_type/importer.js | 0 .../export_type}/jsfmt.spec.js | 0 tests/{ => flow}/export_type/types_only.js | 0 tests/{ => flow}/export_type/types_only2.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/extensions/foo.js | 0 .../extensions}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../facebook_fbt_none}/jsfmt.spec.js | 0 tests/{ => flow}/facebook_fbt_none/main.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../facebook_fbt_some/flow-typed/fbt.js | 0 .../flow-typed}/jsfmt.spec.js | 0 .../facebook_fbt_some}/jsfmt.spec.js | 0 tests/{ => flow}/facebook_fbt_some/main.js | 0 tests/{ => flow}/facebookisms/Bar.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/facebookisms/copyProperties.js | 0 tests/{ => flow}/facebookisms/invariant.js | 0 .../facebookisms}/jsfmt.spec.js | 0 tests/{ => flow}/facebookisms/lib.js | 0 tests/{ => flow}/facebookisms/mergeInto.js | 0 tests/{ => flow}/facebookisms/test.js | 0 .../fetch/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/fetch/fetch.js | 0 tests/{ => flow}/fetch/headers.js | 0 tests/{get-def2 => flow/fetch}/jsfmt.spec.js | 0 tests/{ => flow}/fetch/request.js | 0 tests/{ => flow}/fetch/response.js | 0 tests/{ => flow}/fetch/urlsearchparams.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../lib => flow/find-module}/jsfmt.spec.js | 0 tests/{ => flow}/find-module/req.js | 0 tests/{ => flow}/find-module/test.js | 0 tests/{ => flow}/fixpoint/Fun.js | 0 tests/{ => flow}/fixpoint/Ycombinator.js | 0 .../fixpoint/__snapshots__/jsfmt.spec.js.snap | 0 .../fixpoint}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../flow_ast.template_strings/foo.js | 0 .../flow_ast.template_strings}/jsfmt.spec.js | 0 .../flow/for/__snapshots__/jsfmt.spec.js.snap | 282 ++++ tests/{ => flow}/for/abnormal.js | 0 tests/{ => flow}/for/abnormal_for_in.js | 0 tests/{ => flow}/for/abnormal_for_of.js | 0 .../for}/jsfmt.spec.js | 0 .../forof/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/forof/forof.js | 0 .../{haste_cycle => flow/forof}/jsfmt.spec.js | 0 .../function/__snapshots__/jsfmt.spec.js.snap | 405 +++++ tests/{ => flow}/function/apply.js | 0 tests/{ => flow}/function/bind.js | 0 tests/{ => flow}/function/call.js | 0 tests/{ => flow}/function/function.js | 0 .../models => flow/function}/jsfmt.spec.js | 0 tests/{ => flow}/function/rest.js | 0 .../funrec/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/funrec/funrec.js | 0 .../{haste_dupe => flow/funrec}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/generators/class.js | 0 tests/{ => flow}/generators/class_failure.js | 0 tests/{ => flow}/generators/generators.js | 0 .../generators}/jsfmt.spec.js | 0 tests/{ => flow}/generators/return.js | 0 tests/{ => flow}/generators/throw.js | 0 tests/{ => flow}/generators/variance.js | 0 .../generics/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/generics/generics.js | 0 .../generics}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/geolocation/a.js | 0 .../geolocation}/jsfmt.spec.js | 0 .../get-def/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/get-def/example.js | 0 .../helpers/__snapshots__/jsfmt.spec.js.snap | 0 .../get-def/helpers/exports_default.js | 0 .../get-def/helpers/exports_named.js | 0 .../get-def/helpers}/jsfmt.spec.js | 0 tests/{ => flow}/get-def/imports.js | 0 .../foo/batman => flow/get-def}/jsfmt.spec.js | 0 tests/{ => flow}/get-def/library.js | 0 tests/{ => flow}/get-def2/Parent.js | 0 .../get-def2/__snapshots__/jsfmt.spec.js.snap | 0 .../included => flow/get-def2}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../get-def2/lib}/jsfmt.spec.js | 0 tests/{ => flow}/get-def2/lib/jsx.js | 0 tests/{ => flow}/get-def2/main.js | 0 tests/{ => flow}/get-def2/override.js | 0 tests/{ => flow}/get-def2/react.js | 0 tests/{ => flow}/get-def2/types.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/get-imports-and-importers/a.js | 0 .../{ => flow}/get-imports-and-importers/b.js | 0 .../{ => flow}/get-imports-and-importers/c.js | 0 .../get-imports-and-importers}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../getters_and_setters.js | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../getters_and_setters_enabled/class.js | 0 .../jsfmt.spec.js | 0 .../getters_and_setters_enabled/object.js | 0 .../getters_and_setters_enabled/react.js | 0 .../getters_and_setters_enabled/variance.js | 0 tests/{ => flow}/haste_cycle/API.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../tmp3 => flow/haste_cycle}/jsfmt.spec.js | 0 .../haste_cycle/models/OpenGraphAction.js | 0 .../haste_cycle/models/OpenGraphObject.js | 0 .../models/OpenGraphValueContainer.js | 0 .../models/__snapshots__/jsfmt.spec.js.snap | 0 .../haste_cycle/models}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/haste_dupe/dupe1.js | 0 tests/{ => flow}/haste_dupe/dupe2.js | 0 .../tmp1 => flow/haste_dupe}/jsfmt.spec.js | 0 tests/{ => flow}/haste_dupe/requires_dupe.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/ignore_package/foo.js | 0 .../ignore_package}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../immutable_methods}/jsfmt.spec.js | 0 tests/{ => flow}/immutable_methods/test.js | 0 .../import_type/ExportCJSDefault_Class.js | 0 .../import_type/ExportCJSNamed_Class.js | 0 .../import_type/ExportDefault_Class.js | 0 .../import_type/ExportNamed_Alias.js | 0 .../import_type/ExportNamed_Class.js | 0 .../{ => flow}/import_type/ExportsANumber.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/import_type/import_type.js | 0 tests/{ => flow}/import_type/issue-359.js | 0 .../import_type}/jsfmt.spec.js | 0 .../import_typeof/ExportCJSDefault_Class.js | 0 .../import_typeof/ExportCJSDefault_Number.js | 0 .../import_typeof/ExportCJSNamed_Class.js | 0 .../import_typeof/ExportCJSNamed_Number.js | 0 .../import_typeof/ExportDefault_Class.js | 0 .../import_typeof/ExportDefault_Number.js | 0 .../import_typeof/ExportNamed_Alias.js | 0 .../import_typeof/ExportNamed_Class.js | 0 .../import_typeof/ExportNamed_Multi.js | 0 .../import_typeof/ExportNamed_Number.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/import_typeof/import_typeof.js | 0 .../import_typeof}/jsfmt.spec.js | 0 .../batman/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/include/foo/batman/baz.js | 0 .../include/foo/batman}/jsfmt.spec.js | 0 .../included/__snapshots__/jsfmt.spec.js.snap | 0 .../include/included}/jsfmt.spec.js | 0 tests/{ => flow}/include/included/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental/a.js | 0 tests/{ => flow}/incremental/b.js | 0 tests/{ => flow}/incremental/dup_a.js | 0 .../tmp1 => flow/incremental}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_basic/a.js | 0 tests/{ => flow}/incremental_basic/b.js | 0 tests/{ => flow}/incremental_basic/c.js | 0 .../incremental_basic}/jsfmt.spec.js | 0 .../tmp1/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_basic/tmp1/b.js | 0 .../incremental_basic/tmp1}/jsfmt.spec.js | 0 .../tmp2/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_basic/tmp2/a.js | 0 .../incremental_basic/tmp2}/jsfmt.spec.js | 0 .../tmp3/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_basic/tmp3/b.js | 0 .../incremental_basic/tmp3}/jsfmt.spec.js | 0 tests/{ => flow}/incremental_cycle/A.js | 0 tests/{ => flow}/incremental_cycle/B.js | 0 tests/{ => flow}/incremental_cycle/C.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_cycle}/jsfmt.spec.js | 0 tests/{ => flow}/incremental_cycle/tmp1/B.js | 0 tests/{ => flow}/incremental_cycle/tmp1/C.js | 0 .../tmp1/__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_cycle/tmp1}/jsfmt.spec.js | 0 tests/{ => flow}/incremental_cycle/tmp2/B.js | 0 .../tmp2/__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_cycle/tmp2}/jsfmt.spec.js | 0 tests/{ => flow}/incremental_cycle/tmp3/B.js | 0 .../tmp3/__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_cycle/tmp3}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_delete/a.js | 0 tests/{ => flow}/incremental_delete/b.js | 0 tests/{ => flow}/incremental_delete/c.js | 0 tests/{ => flow}/incremental_delete/dupe1.js | 0 tests/{ => flow}/incremental_delete/dupe2.js | 0 .../incremental_delete}/jsfmt.spec.js | 0 .../incremental_delete/requires_dupe.js | 0 .../incremental_delete/requires_unchecked.js | 0 .../incremental_delete/unchecked.js | 0 .../incremental_duplicate_delete/A.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_json}/jsfmt.spec.js | 0 tests/{ => flow}/incremental_json/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_mixed_naming_cycle/a.js | 0 .../incremental_mixed_naming_cycle/b.js | 0 .../incremental_mixed_naming_cycle/c.js | 0 .../incremental_mixed_naming_cycle/d.js | 0 .../jsfmt.spec.js | 0 .../incremental_mixed_naming_cycle/root.js | 0 .../tmp1/__snapshots__/jsfmt.spec.js.snap | 0 .../tmp1}/jsfmt.spec.js | 0 .../tmp1/root.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../incremental_non_flow_move/foo.js | 0 .../incremental_non_flow_move}/jsfmt.spec.js | 0 .../incremental_non_flow_move/test.js | 0 .../dir/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/incremental_path/dir/a.js | 0 .../incremental_path/dir}/jsfmt.spec.js | 0 tests/{ => flow}/indexer/A.js | 0 .../indexer/__snapshots__/jsfmt.spec.js.snap | 0 .../{keyvalue => flow/indexer}/jsfmt.spec.js | 0 tests/{ => flow}/indexer/multiple.js | 0 .../init/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/init/hoisted.js | 0 tests/{ => flow}/init/hoisted2.js | 0 .../init}/jsfmt.spec.js | 0 tests/{ => flow}/init/let.js | 0 tests/{ => flow}/init/nullable-init.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/instanceof/instanceof.js | 0 tests/{lib => flow/instanceof}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/integration/bar.js | 0 tests/{ => flow}/integration/foo.js | 0 .../integration}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 193 +++ tests/{ => flow}/interface/import.js | 0 tests/{ => flow}/interface/indexer.js | 0 tests/{ => flow}/interface/interface.js | 4 - .../interface}/jsfmt.spec.js | 0 tests/{ => flow}/interface/test.js | 0 tests/{ => flow}/interface/test2.js | 0 tests/{ => flow}/interface/test3.js | 0 tests/{ => flow}/interface/test4.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/intersection/intersection.js | 0 .../intersection}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../intersection}/lib/jsfmt.spec.js | 0 tests/{ => flow}/intersection/lib/lib.js | 0 tests/{ => flow}/intersection/objassign.js | 0 tests/{ => flow}/intersection/pred.js | 0 tests/{ => flow}/intersection/test_fun.js | 0 tests/{ => flow}/intersection/test_obj.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/issues-11/export.js | 0 tests/{ => flow}/issues-11/import.js | 0 .../{liberr => flow/issues-11}/jsfmt.spec.js | 0 .../iter/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/iter/iter.js | 0 .../{liberr/libs => flow/iter}/jsfmt.spec.js | 0 .../iterable/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/iterable/array.js | 0 tests/{ => flow}/iterable/caching_bug.js | 0 tests/{ => flow}/iterable/iter.js | 0 tests/{ => flow}/iterable/iterator_result.js | 0 .../iterable}/jsfmt.spec.js | 0 tests/{ => flow}/iterable/map.js | 0 tests/{ => flow}/iterable/set.js | 0 tests/{ => flow}/iterable/string.js | 0 tests/{ => flow}/iterable/variance.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsx_intrinsics.builtin}/jsfmt.spec.js | 0 .../{ => flow}/jsx_intrinsics.builtin/main.js | 0 .../jsx_intrinsics.builtin/strings.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsx_intrinsics.custom}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../jsx_intrinsics.custom/lib}/jsfmt.spec.js | 0 .../jsx_intrinsics.custom/lib/jsx.js | 0 .../{ => flow}/jsx_intrinsics.custom/main.js | 0 .../jsx_intrinsics.custom/strings.js | 0 .../keys/__snapshots__/jsfmt.spec.js.snap | 0 .../{librec/lib/B => flow/keys}/jsfmt.spec.js | 0 tests/{ => flow}/keys/keys.js | 0 .../keyvalue/__snapshots__/jsfmt.spec.js.snap | 0 .../keyvalue}/jsfmt.spec.js | 0 tests/{ => flow}/keyvalue/keyvalue.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 0 .../last_duplicate_property_wins/test.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 tests/{logical => flow/lib}/jsfmt.spec.js | 0 tests/{ => flow}/lib/libtest.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../declarations}/jsfmt.spec.js | 0 .../lib_interfaces/declarations/underscore.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../libconfig}/jsfmt.spec.js | 0 tests/{ => flow}/libconfig/libA.js | 0 tests/{ => flow}/libconfig/libB.js | 0 tests/{ => flow}/libconfig/libtest.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../libdef_ignored_module}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../libdef_ignored_module/lib/foo.js | 0 .../libdef_ignored_module/lib}/jsfmt.spec.js | 0 .../{ => flow}/libdef_ignored_module/test.js | 0 .../liberr/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/liberr/a.js | 0 .../liberr}/jsfmt.spec.js | 0 .../libs/__snapshots__/jsfmt.spec.js.snap | 0 .../lib => flow/liberr/libs}/jsfmt.spec.js | 0 tests/{ => flow}/liberr/libs/type_error.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../libflow-typed/flow-typed/dino.js | 0 .../libflow-typed/flow-typed}/jsfmt.spec.js | 0 .../libflow-typed}/jsfmt.spec.js | 0 tests/{ => flow}/libflow-typed/libtest.js | 0 .../librec/__snapshots__/jsfmt.spec.js.snap | 0 .../librec}/jsfmt.spec.js | 0 .../lib/A/__snapshots__/jsfmt.spec.js.snap | 0 .../librec/lib/A}/jsfmt.spec.js | 0 tests/{ => flow}/librec/lib/A/libA.js | 0 .../lib/B/__snapshots__/jsfmt.spec.js.snap | 0 .../librec/lib/B}/jsfmt.spec.js | 0 tests/{ => flow}/librec/lib/B/libB.js | 0 tests/{ => flow}/librec/libtest.js | 0 .../literal/__snapshots__/jsfmt.spec.js.snap | 116 ++ tests/{ => flow}/literal/enum.js | 0 tests/{ => flow}/literal/enum_client.js | 0 .../literal}/jsfmt.spec.js | 0 tests/flow/literal/number.js | 23 + .../locals/__snapshots__/jsfmt.spec.js.snap | 0 .../locals}/jsfmt.spec.js | 0 tests/{ => flow}/locals/lex.js | 0 tests/{ => flow}/locals/locals.js | 0 .../logical/__snapshots__/jsfmt.spec.js.snap | 0 .../{more_path => flow/logical}/jsfmt.spec.js | 0 tests/{ => flow}/logical/logical.js | 0 .../loners/__snapshots__/jsfmt.spec.js.snap | 0 .../{more_react => flow/loners}/jsfmt.spec.js | 0 tests/{ => flow}/loners/loners.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../exports_optional_prop.js | 0 .../method_properties}/jsfmt.spec.js | 0 tests/{ => flow}/method_properties/test.js | 0 tests/{ => flow}/misc/A.js | 0 tests/{ => flow}/misc/B.js | 0 tests/{ => flow}/misc/C.js | 0 tests/{ => flow}/misc/D.js | 0 tests/{ => flow}/misc/E.js | 0 tests/{ => flow}/misc/F.js | 0 tests/{ => flow}/misc/G.js | 0 .../misc/__snapshots__/jsfmt.spec.js.snap | 0 tests/{name_prop => flow/misc}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/missing_annotation/array.js | 0 .../missing_annotation/async_return.js | 0 tests/{ => flow}/missing_annotation/infer.js | 0 .../missing_annotation}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../modified_lib}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../modified_lib/lib}/jsfmt.spec.js | 0 tests/{ => flow}/modified_lib/lib/lib.js | 0 tests/{ => flow}/modified_lib/test.js | 0 .../src/__snapshots__/jsfmt.spec.js.snap | 0 .../module_not_found_errors/src/index.js | 0 .../src}/jsfmt.spec.js | 0 tests/{ => flow}/module_redirect/A.js | 0 tests/{ => flow}/module_redirect/B.js | 0 tests/{ => flow}/module_redirect/C.js | 0 tests/{ => flow}/module_redirect/D.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../module_redirect}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../module_use_strict}/jsfmt.spec.js | 0 tests/{ => flow}/module_use_strict/test.js | 0 .../modules/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/modules/cli.js | 0 tests/{ => flow}/modules/cli2.js | 0 .../ws => flow/modules}/jsfmt.spec.js | 0 tests/{ => flow}/modules/lib.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/more_annot/client_object.js | 0 .../ws/test => flow/more_annot}/jsfmt.spec.js | 0 tests/{ => flow}/more_annot/object.js | 0 tests/{ => flow}/more_annot/proto.js | 0 tests/{ => flow}/more_annot/super.js | 0 tests/{ => flow}/more_classes/Bar.js | 0 tests/{ => flow}/more_classes/Foo.js | 0 tests/{ => flow}/more_classes/Qux.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../root => flow/more_classes}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../more_generics}/jsfmt.spec.js | 0 tests/{ => flow}/more_generics/poly.js | 0 tests/{ => flow}/more_path/Condition.js | 0 tests/{ => flow}/more_path/FlowSA.js | 0 tests/{ => flow}/more_path/Sigma.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../more_path}/jsfmt.spec.js | 0 tests/{ => flow}/more_path/test.js | 0 tests/{ => flow}/more_react/API.react.js | 0 tests/{ => flow}/more_react/App.react.js | 0 tests/{ => flow}/more_react/JSX.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 176 ++ .../more_react}/jsfmt.spec.js | 0 tests/{ => flow}/more_react/propTypes.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/more_statics/class_static.js | 0 .../more_statics}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/name_prop/class.js | 0 tests/{ => flow}/name_prop/function.js | 0 .../basic => flow/name_prop}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/namespace/client.js | 0 .../namespace}/jsfmt.spec.js | 0 tests/{ => flow}/namespace/namespace.js | 0 tests/{ => flow}/new_react/FeedUFI.react.js | 0 tests/{ => flow}/new_react/Mixin.js | 0 .../new_react/UFILikeCount.react.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 967 +++++++++++ .../{ => flow}/new_react/bad_default_props.js | 0 tests/{ => flow}/new_react/classes.js | 0 .../fakelib/__snapshots__/jsfmt.spec.js.snap | 17 + .../new_react/fakelib}/jsfmt.spec.js | 0 .../new_react/fakelib/type_aliases.js | 0 tests/{ => flow}/new_react/import-react.js | 0 .../new_react}/jsfmt.spec.js | 0 tests/{ => flow}/new_react/new_react.js | 0 tests/{ => flow}/new_react/propTypes.js | 0 tests/{ => flow}/new_react/props.js | 0 tests/{ => flow}/new_react/props2.js | 0 tests/{ => flow}/new_react/props3.js | 0 tests/{ => flow}/new_react/props4.js | 0 tests/{ => flow}/new_react/props5.js | 0 tests/{ => flow}/new_react/state.js | 0 tests/{ => flow}/new_react/state2.js | 0 tests/{ => flow}/new_react/state3.js | 0 tests/{ => flow}/new_react/state4.js | 0 tests/{ => flow}/new_react/state5.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_haste/client.js | 0 .../_d3/__snapshots__/jsfmt.spec.js.snap | 0 .../node_haste/external/_d3}/jsfmt.spec.js | 0 .../{ => flow}/node_haste/external/_d3/min.js | 0 .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_haste/foo/bar/client.js | 0 .../node_haste/foo/bar}/jsfmt.spec.js | 0 .../buffer => flow/node_haste}/jsfmt.spec.js | 0 tests/{ => flow}/node_haste/md5.js | 0 .../ws/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_haste/ws/index.js | 0 .../node_haste/ws}/jsfmt.spec.js | 0 .../ws/test/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_haste/ws/test/client.js | 0 .../node_haste/ws/test}/jsfmt.spec.js | 0 .../root/__snapshots__/jsfmt.spec.js.snap | 0 .../node_modules_with_symlinks/root/foo.js | 0 .../root}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../root/symlink_lib/index.js | 0 .../root/symlink_lib}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../symlink_lib_outside_root/index.js | 0 .../symlink_lib_outside_root}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_modules_without_json}/jsfmt.spec.js | 0 .../node_modules_without_json/test.js | 0 .../assert/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/assert/assert.js | 0 .../node_tests/assert}/jsfmt.spec.js | 0 .../basic/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/basic/bar.js | 0 tests/{ => flow}/node_tests/basic/foo.js | 0 .../node_tests/basic}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/basic_file/bar.js | 0 tests/{ => flow}/node_tests/basic_file/foo.js | 0 .../node_tests/basic_file}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/basic_node_modules/foo.js | 0 .../basic_node_modules}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../basic_node_modules_with_path/foo.js | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../bar_lib/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/basic_package/bar_lib/bar.js | 0 .../basic_package/bar_lib}/jsfmt.spec.js | 0 .../node_tests/basic_package/foo.js | 0 .../node_tests/basic_package}/jsfmt.spec.js | 0 .../buffer/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/buffer/buffer.js | 0 .../node_tests/buffer}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/child_process/exec.js | 0 .../node_tests/child_process/execFile.js | 0 .../node_tests/child_process/execSync.js | 0 .../node_tests/child_process}/jsfmt.spec.js | 0 .../node_tests/child_process/spawn.js | 0 .../crypto/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/crypto/crypto.js | 0 .../node_tests/crypto}/jsfmt.spec.js | 0 .../fs/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/node_tests/fs/fs.js | 0 .../node_tests/fs}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/json_file}/jsfmt.spec.js | 0 .../package2/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/json_file/package2/index.js | 0 .../json_file/package2}/jsfmt.spec.js | 0 tests/{ => flow}/node_tests/json_file/test.js | 0 .../os/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/os}/jsfmt.spec.js | 0 tests/{ => flow}/node_tests/os/userInfo.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/package_file/bar_lib.js | 0 .../bar_lib/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/package_file/bar_lib/bar.js | 0 .../package_file/bar_lib}/jsfmt.spec.js | 0 .../{ => flow}/node_tests/package_file/foo.js | 0 .../node_tests/package_file}/jsfmt.spec.js | 0 .../foo/__snapshots__/jsfmt.spec.js.snap | 0 .../package_file_node_modules/foo/foo.js | 0 .../foo}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/path_node_modules/foo.js | 0 .../path_node_modules}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../path_node_modules_with_short_main/foo.js | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../path_node_modules_without_main/foo.js | 0 .../jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/node_tests/path_package/foo.js | 0 .../node_tests/path_package}/jsfmt.spec.js | 0 .../stream/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/stream}/jsfmt.spec.js | 0 tests/{ => flow}/node_tests/stream/stream.js | 0 .../timers/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/timers}/jsfmt.spec.js | 0 tests/{ => flow}/node_tests/timers/timers.js | 0 .../url/__snapshots__/jsfmt.spec.js.snap | 0 .../node_tests/url}/jsfmt.spec.js | 0 tests/{ => flow}/node_tests/url/url.js | 0 .../nullable/__snapshots__/jsfmt.spec.js.snap | 0 .../nullable}/jsfmt.spec.js | 0 tests/{ => flow}/nullable/maybe.js | 0 tests/{ => flow}/nullable/nullable.js | 0 tests/{ => flow}/nullable/simple_nullable.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../number_constants}/jsfmt.spec.js | 0 .../number_constants/number_constants.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/object-method/id.js | 0 .../object-method}/jsfmt.spec.js | 0 tests/{ => flow}/object-method/subtype.js | 0 tests/{ => flow}/object-method/test.js | 0 tests/{ => flow}/object-method/test2.js | 0 tests/{ => flow}/object-method/test3.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../object_annot}/jsfmt.spec.js | 0 tests/{ => flow}/object_annot/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/object_api/a.js | 0 tests/{ => flow}/object_api/b.js | 0 tests/{ => flow}/object_api/c.js | 0 tests/{poly => flow/object_api}/jsfmt.spec.js | 0 tests/{ => flow}/object_api/object_assign.js | 0 tests/{ => flow}/object_api/object_create.js | 0 .../object_api/object_getprototypeof.js | 0 tests/{ => flow}/object_api/object_keys.js | 0 tests/{ => flow}/object_api/object_missing.js | 0 .../{ => flow}/object_api/object_prototype.js | 0 tests/{ => flow}/object_assign/A.js | 0 tests/{ => flow}/object_assign/B.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/object_assign/apply.js | 0 .../object_assign}/jsfmt.spec.js | 0 tests/{ => flow}/object_assign/non_objects.js | 0 tests/{ => flow}/object_assign/undefined.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../object_freeze}/jsfmt.spec.js | 0 .../{ => flow}/object_freeze/object_freeze.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../object_is}/jsfmt.spec.js | 0 tests/{ => flow}/object_is/object_is.js | 0 .../objects/__snapshots__/jsfmt.spec.js.snap | 155 ++ tests/{ => flow}/objects/conversion.js | 0 .../objects}/jsfmt.spec.js | 0 tests/{ => flow}/objects/objects.js | 0 tests/{ => flow}/objects/unaliased_assign.js | 0 .../objmap/__snapshots__/jsfmt.spec.js.snap | 0 .../objmap}/jsfmt.spec.js | 0 tests/{ => flow}/objmap/objmap.js | 0 .../optional/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/optional/client_optional.js | 0 tests/{ => flow}/optional/default.js | 0 tests/{ => flow}/optional/generic.js | 0 .../optional}/jsfmt.spec.js | 0 tests/{ => flow}/optional/maybe.js | 0 tests/{ => flow}/optional/nullable.js | 0 tests/{ => flow}/optional/optional.js | 0 tests/{ => flow}/optional/optional_param.js | 0 tests/{ => flow}/optional/optional_param2.js | 0 tests/{ => flow}/optional/optional_param3.js | 0 tests/{ => flow}/optional/optional_param4.js | 0 tests/{ => flow}/optional/undefined.js | 0 tests/{ => flow}/optional/undefined2.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../optional_props}/jsfmt.spec.js | 0 tests/{ => flow}/optional_props/test.js | 0 tests/{ => flow}/optional_props/test2.js | 0 tests/{ => flow}/optional_props/test3.js | 0 .../optional_props/test3_failure.js | 0 .../overload/__snapshots__/jsfmt.spec.js.snap | 0 .../{private => flow/overload}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../overload/lib}/jsfmt.spec.js | 0 tests/{ => flow}/overload/lib/lib.js | 0 tests/{ => flow}/overload/overload.js | 0 tests/{ => flow}/overload/test.js | 0 tests/{ => flow}/overload/test2.js | 0 tests/{ => flow}/overload/test3.js | 0 tests/{ => flow}/overload/union.js | 0 .../parse/__snapshots__/jsfmt.spec.js.snap | 0 .../parse}/jsfmt.spec.js | 0 tests/{ => flow}/parse/no_parse_error.js | 0 tests/{ => flow}/parse_error_haste/Client.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../parse_error_haste}/jsfmt.spec.js | 0 tests/{ => flow}/parse_error_node/Client.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../parse_error_node}/jsfmt.spec.js | 0 .../path/__snapshots__/jsfmt.spec.js.snap | 0 .../path}/jsfmt.spec.js | 0 tests/{ => flow}/path/while.js | 0 .../plsummit/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/plsummit/arrays.js | 0 tests/{ => flow}/plsummit/export_class.js | 0 tests/{ => flow}/plsummit/generics.js | 0 tests/{ => flow}/plsummit/import_class.js | 0 .../plsummit}/jsfmt.spec.js | 0 tests/{ => flow}/plsummit/locals.js | 0 tests/{ => flow}/plsummit/objects.js | 0 .../poly/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/poly/annot.js | 0 .../poly/implicit_bounded_instantiation.js | 0 tests/{ => flow}/poly/issue-1029.js | 0 tests/{rec => flow/poly}/jsfmt.spec.js | 0 tests/{ => flow}/poly/poly.js | 0 tests/{ => flow}/poly/test.js | 0 tests/{ => flow}/poly_class_export/A.js | 0 tests/{ => flow}/poly_class_export/B.js | 0 tests/{ => flow}/poly_class_export/C.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../poly_class_export}/jsfmt.spec.js | 0 .../decls/__snapshots__/jsfmt.spec.js.snap | 0 .../poly_overload/decls}/jsfmt.spec.js | 0 .../decls/typescript-deferred.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../predicates-abstract/filter-union.js | 0 .../{ => flow}/predicates-abstract/filter.js | 0 .../predicates-abstract}/jsfmt.spec.js | 0 .../{ => flow}/predicates-abstract/refine.js | 0 .../sanity-filter-union.js | 0 .../predicates-abstract/sanity-filter.js | 0 .../predicates-abstract/sanity-refine.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../predicates-declared/function-bind.js | 0 .../predicates-declared/function-union.js | 0 .../predicates-declared/is-string-decl.js | 0 .../predicates-declared}/jsfmt.spec.js | 0 .../predicates-declared/logical-or.js | 0 .../predicates-declared/object-invariant.js | 0 .../orig-string-tag-check.js | 0 .../sanity-fall-through.js | 0 .../sanity-invalid-calls.js | 0 .../sanity-is-string-bug.js | 0 .../sanity-parameter-mismatch.js | 0 .../sanity-pred-with-body.js | 0 .../predicates-declared/sanity-return-type.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../predicates-inferred}/jsfmt.spec.js | 0 .../sanity-multi-params.js | 0 .../predicates-inferred/sanity-ordering.js | 0 .../predicates-inferred/sanity-unbound-var.js | 0 .../{ => flow}/predicates-inferred/sanity.js | 0 .../simple-predicate-func-post.js | 0 .../simple-predicate-func.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/predicates-parsing/fail-0.js | 0 tests/{ => flow}/predicates-parsing/fail-1.js | 0 tests/{ => flow}/predicates-parsing/fail-2.js | 0 tests/{ => flow}/predicates-parsing/fail-3.js | 0 .../predicates-parsing}/jsfmt.spec.js | 0 tests/{ => flow}/predicates-parsing/pass.js | 0 .../private/__snapshots__/jsfmt.spec.js.snap | 0 .../tmp1c => flow/private}/jsfmt.spec.js | 0 tests/{ => flow}/private/private.js | 0 .../promises/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/promises/all.js | 0 tests/{ => flow}/promises/covariance.js | 0 .../tmp1d => flow/promises}/jsfmt.spec.js | 0 tests/{ => flow}/promises/promise.js | 0 tests/{ => flow}/promises/resolve_global.js | 0 tests/{ => flow}/promises/resolve_void.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../pure_component}/jsfmt.spec.js | 0 tests/{ => flow}/pure_component/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../tmp1f => flow/qualified}/jsfmt.spec.js | 0 tests/{ => flow}/qualified/qualified.js | 0 tests/{ => flow}/react/ArityError.react.js | 0 .../react/__snapshots__/jsfmt.spec.js.snap | 0 .../react/createElementRequiredProp_string.js | 0 .../{ => flow}/react/createElement_string.js | 0 tests/{ => flow}/react/import_react.js | 0 .../tmp1g => flow/react}/jsfmt.spec.js | 0 tests/{ => flow}/react/jsx_spread.js | 0 tests/{ => flow}/react/proptype_arrayOf.js | 0 tests/{ => flow}/react/proptype_func.js | 0 tests/{ => flow}/react/proptype_missing.js | 0 tests/{ => flow}/react/proptype_object.js | 0 tests/{ => flow}/react/proptype_objectOf.js | 0 tests/{ => flow}/react/proptype_oneOf.js | 0 tests/{ => flow}/react/proptype_oneOfType.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../react_functional}/jsfmt.spec.js | 0 tests/{ => flow}/react_functional/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../react_modules/createclass-callsite.js | 0 .../react_modules/createclass-module.js | 0 .../react_modules/es6class-types-callsite.js | 0 .../react_modules/es6class-types-module.js | 0 .../react_modules}/jsfmt.spec.js | 0 .../rec/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/rec/issue-1228.js | 0 tests/{ => flow}/rec/issue-598.js | 0 .../{recheck/tmp2b => flow/rec}/jsfmt.spec.js | 0 tests/{ => flow}/rec/test.js | 0 tests/{ => flow}/rec/test2.js | 0 tests/{ => flow}/rec/test3.js | 0 tests/{ => flow}/rec/test4.js | 0 tests/{ => flow}/rec/test5.js | 0 tests/{ => flow}/recheck-haste/A1.js | 0 tests/{ => flow}/recheck-haste/A3.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../recheck-haste}/jsfmt.spec.js | 0 tests/{ => flow}/recheck-haste/tmp1A/A2.js | 0 .../tmp1A/__snapshots__/jsfmt.spec.js.snap | 0 .../recheck-haste/tmp1A}/jsfmt.spec.js | 0 tests/{ => flow}/recheck-haste/tmp2A/A3.js | 0 .../tmp2A/__snapshots__/jsfmt.spec.js.snap | 0 .../recheck-haste/tmp2A}/jsfmt.spec.js | 0 .../recheck/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/a1.js | 0 tests/{ => flow}/recheck/a2.js | 0 tests/{ => flow}/recheck/a3.js | 0 tests/{ => flow}/recheck/b0.js | 0 tests/{ => flow}/recheck/b1.js | 0 tests/{ => flow}/recheck/b2.js | 0 tests/{ => flow}/recheck/b3.js | 0 tests/{ => flow}/recheck/c1.js | 0 tests/{ => flow}/recheck/c2.js | 0 tests/{ => flow}/recheck/c3.js | 0 tests/{ => flow}/recheck/d1.js | 0 tests/{ => flow}/recheck/d2.js | 0 tests/{ => flow}/recheck/e1.js | 0 tests/{ => flow}/recheck/e2.js | 0 tests/{ => flow}/recheck/f1.js | 0 tests/{ => flow}/recheck/f2.js | 0 tests/{ => flow}/recheck/g1.js | 0 tests/{ => flow}/recheck/g2.js | 0 tests/{ => flow}/recheck/g3.js | 0 tests/{ => flow}/recheck/h1.js | 0 tests/{ => flow}/recheck/h2.js | 0 .../tmp3e => flow/recheck}/jsfmt.spec.js | 0 .../tmp1a/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1a/a1.js | 0 .../recheck/tmp1a}/jsfmt.spec.js | 0 .../tmp1b/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1b/b1.js | 0 .../recheck/tmp1b}/jsfmt.spec.js | 0 .../tmp1c/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1c/c2.js | 0 .../recheck/tmp1c}/jsfmt.spec.js | 0 .../tmp1d/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1d/d1.js | 0 .../recheck/tmp1d}/jsfmt.spec.js | 0 .../tmp1e/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1e/e2.js | 0 .../recheck/tmp1e}/jsfmt.spec.js | 0 .../tmp1f/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1f/f1.js | 0 .../recheck/tmp1f}/jsfmt.spec.js | 0 .../tmp1g/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1g/g1.js | 0 .../recheck/tmp1g}/jsfmt.spec.js | 0 .../tmp1h/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp1h/h1.js | 0 .../recheck/tmp1h}/jsfmt.spec.js | 0 .../tmp2a/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp2a/a1.js | 0 .../recheck/tmp2a}/jsfmt.spec.js | 0 .../tmp2b/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp2b/b0.js | 0 .../recheck/tmp2b}/jsfmt.spec.js | 0 .../tmp2c/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp2c/c1.js | 0 .../recheck/tmp2c}/jsfmt.spec.js | 0 .../tmp2e/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp2e/e1.js | 0 .../recheck/tmp2e}/jsfmt.spec.js | 0 .../tmp2f/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp2f/f1.js | 0 .../recheck/tmp2f}/jsfmt.spec.js | 0 .../tmp3e/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp3e/e1.js | 0 tests/{ => flow}/recheck/tmp3e/e2.js | 0 .../recheck/tmp3e}/jsfmt.spec.js | 0 .../tmp3f/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp3f/f1.js | 0 .../recheck/tmp3f}/jsfmt.spec.js | 0 .../tmp4f/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/recheck/tmp4f/f1.js | 0 .../recheck/tmp4f}/jsfmt.spec.js | 0 .../record/__snapshots__/jsfmt.spec.js.snap | 0 .../record}/jsfmt.spec.js | 0 tests/{ => flow}/record/test.js | 0 .../refi/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/refi/bound.js | 0 tests/{ => flow}/refi/heap.js | 0 tests/{singleton => flow/refi}/jsfmt.spec.js | 0 tests/{ => flow}/refi/lex.js | 0 tests/{ => flow}/refi/local.js | 0 tests/{ => flow}/refi/null_tests.js | 0 tests/{ => flow}/refi/switch.js | 0 tests/{ => flow}/refi/typeof_tests.js | 0 tests/{ => flow}/refi/undef_tests.js | 0 tests/{ => flow}/refi/void_tests.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/refinements/assignment.js | 0 tests/{ => flow}/refinements/ast_node.js | 0 tests/{ => flow}/refinements/bool.js | 0 .../refinements/computed_string_literal.js | 0 tests/{ => flow}/refinements/cond_prop.js | 0 tests/{ => flow}/refinements/constants.js | 0 tests/{ => flow}/refinements/eq.js | 0 tests/{ => flow}/refinements/exists.js | 0 tests/{ => flow}/refinements/func_call.js | 0 .../{ => flow}/refinements/hasOwnProperty.js | 0 .../{ => flow}/refinements/heap_defassign.js | 0 .../refinements}/jsfmt.spec.js | 0 tests/{ => flow}/refinements/lib.js | 0 .../refinements/missing-property-cond.js | 0 tests/{ => flow}/refinements/mixed.js | 0 tests/{ => flow}/refinements/node1.js | 0 tests/{ => flow}/refinements/not.js | 0 tests/{ => flow}/refinements/null.js | 0 tests/{ => flow}/refinements/number.js | 0 tests/{ => flow}/refinements/property.js | 0 tests/{ => flow}/refinements/refinements.js | 0 tests/{ => flow}/refinements/string.js | 0 tests/{ => flow}/refinements/super_member.js | 0 tests/{ => flow}/refinements/switch.js | 0 tests/{ => flow}/refinements/tagged_union.js | 0 .../refinements/tagged_union_import.js | 0 tests/{ => flow}/refinements/typeof.js | 0 tests/{ => flow}/refinements/undef.js | 0 tests/{ => flow}/refinements/union.js | 0 tests/{ => flow}/refinements/void.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../reflection}/jsfmt.spec.js | 0 tests/{ => flow}/reflection/type.js | 0 .../regexp/__snapshots__/jsfmt.spec.js.snap | 0 .../lib => flow/regexp}/jsfmt.spec.js | 0 tests/{ => flow}/regexp/regexp.js | 0 .../replace/__snapshots__/jsfmt.spec.js.snap | 0 tests/{statics => flow/replace}/jsfmt.spec.js | 0 tests/{ => flow}/replace/test.js | 0 tests/{ => flow}/require/B.js | 0 tests/{ => flow}/require/C.js | 0 tests/{ => flow}/require/E.js | 0 tests/{ => flow}/require/ProvidesModuleA.js | 0 tests/{ => flow}/require/ProvidesModuleD.js | 0 .../require/__snapshots__/jsfmt.spec.js.snap | 0 tests/{strict => flow/require}/jsfmt.spec.js | 0 .../{ => flow}/require/not_builtin_require.js | 0 .../require/not_builtin_require2.js | 0 tests/{ => flow}/require/require.js | 0 tests/{ => flow}/requireLazy/A.js | 0 tests/{ => flow}/requireLazy/B.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../requireLazy}/jsfmt.spec.js | 0 tests/{ => flow}/requireLazy/requireLazy.js | 0 .../return/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/return/function_return.js | 0 .../return}/jsfmt.spec.js | 0 tests/{ => flow}/return/void.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../return_new}/jsfmt.spec.js | 0 tests/{ => flow}/return_new/test.js | 0 tests/{ => flow}/return_new/test2.js | 0 .../seal/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/seal/imp.js | 0 tests/{super => flow/seal}/jsfmt.spec.js | 0 tests/{ => flow}/seal/obj_annot.js | 0 .../sealed/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/sealed/function.js | 0 tests/{suppress => flow/sealed}/jsfmt.spec.js | 0 tests/{ => flow}/sealed/proto.js | 0 tests/{ => flow}/sealed/sealed.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../sealed_objects}/jsfmt.spec.js | 0 tests/{ => flow}/sealed_objects/test.js | 0 .../shape/__snapshots__/jsfmt.spec.js.snap | 0 .../shape}/jsfmt.spec.js | 0 tests/{ => flow}/shape/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/simple_arrays/array.js | 0 tests/{ => flow}/simple_arrays/array2.js | 0 .../simple_arrays}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/singleton/boolean.js | 0 .../{symlink => flow/singleton}/jsfmt.spec.js | 0 tests/{ => flow}/singleton/number.js | 0 tests/{ => flow}/singleton/string.js | 0 .../spread/__snapshots__/jsfmt.spec.js.snap | 0 .../spread}/jsfmt.spec.js | 0 tests/{ => flow}/spread/test.js | 0 tests/{ => flow}/spread/test2.js | 0 tests/{ => flow}/spread/test3.js | 0 tests/{ => flow}/spread/test4.js | 0 tests/{ => flow}/spread/test5.js | 0 tests/{ => flow}/spread/test6.js | 0 tests/{ => flow}/spread/test7.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../static_overload}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 .../static_overload/lib}/jsfmt.spec.js | 0 tests/{ => flow}/static_overload/lib/lib.js | 0 tests/{ => flow}/static_overload/test.js | 0 .../statics/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/statics/class_statics.js | 0 tests/{ => flow}/statics/funstatics.js | 0 .../{this_ctor => flow/statics}/jsfmt.spec.js | 0 .../strict/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/strict/annot.js | 0 tests/{ => flow}/strict/fun.js | 0 .../{this_type => flow/strict}/jsfmt.spec.js | 0 tests/{ => flow}/strict/obj.js | 0 tests/{ => flow}/strict_requires/A.js | 0 tests/{ => flow}/strict_requires/B.js | 0 tests/{ => flow}/strict_requires/C.js | 0 tests/{ => flow}/strict_requires/D.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../strict_requires}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../structural_subtyping/builtin.js | 0 .../{ => flow}/structural_subtyping/class.js | 0 .../structural_subtyping}/jsfmt.spec.js | 0 tests/{ => flow}/structural_subtyping/obj.js | 0 .../structural_subtyping/optional.js | 0 .../suggest/__snapshots__/jsfmt.spec.js.snap | 0 tests/{traces => flow/suggest}/jsfmt.spec.js | 0 tests/{ => flow}/suggest/lib.js | 0 tests/{ => flow}/suggest/suggest.js | 0 .../super/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/super/constructor.js | 0 tests/{ => flow}/super/import.js | 0 tests/{traits => flow/super}/jsfmt.spec.js | 0 tests/{ => flow}/super/super.js | 0 tests/{ => flow}/super/test.js | 0 tests/{ => flow}/suppress/A.js | 0 tests/{ => flow}/suppress/B.js | 0 tests/{ => flow}/suppress/C.js | 0 .../suppress/__snapshots__/jsfmt.spec.js.snap | 0 tests/{try => flow/suppress}/jsfmt.spec.js | 0 tests/{ => flow}/suppress/lib.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../suppress_incremental}/jsfmt.spec.js | 0 tests/{ => flow}/suppress_incremental/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../suppress_traces}/jsfmt.spec.js | 0 tests/{ => flow}/suppress_traces/traces.js | 0 .../switch/__snapshots__/jsfmt.spec.js.snap | 405 +++++ .../switch}/jsfmt.spec.js | 0 tests/{ => flow}/switch/more_switch.js | 0 tests/{ => flow}/switch/switch.js | 0 .../switch/switch_default_fallthrough.js | 0 tests/{ => flow}/switch/trailing_cases.js | 0 .../symbol/__snapshots__/jsfmt.spec.js.snap | 0 .../symbol}/jsfmt.spec.js | 0 tests/{ => flow}/symbol/symbol.js | 0 .../symlink/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/symlink/bar.js | 0 tests/{ => flow}/symlink/foo.js | 0 .../symlink}/jsfmt.spec.js | 0 tests/{ => flow}/symlink/qux.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/tagged-unions/classes.js | 0 .../tagged-unions/interfaces-neg.js | 0 .../tagged-unions/interfaces-pos.js | 0 .../tagged-unions}/jsfmt.spec.js | 0 .../tagged-unions/type-decls-neg.js | 0 .../tagged-unions/type-decls-pos.js | 0 .../taint/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/taint/adder.js | 0 tests/{ => flow}/taint/any_object.js | 0 .../{ => flow}/taint/call-object-property.js | 0 tests/{ => flow}/taint/comparator.js | 0 tests/{ => flow}/taint/function.js | 0 tests/{ => flow}/taint/globals.js | 0 .../taint}/jsfmt.spec.js | 0 tests/{ => flow}/taint/lib.js | 0 tests/{ => flow}/taint/taint1.js | 0 tests/{ => flow}/taint/taint2.js | 0 tests/{ => flow}/taint/taint3.js | 0 tests/{ => flow}/taint/taint4.js | 0 tests/{ => flow}/taint/use-types.js | 0 .../template/__snapshots__/jsfmt.spec.js.snap | 79 + .../template}/jsfmt.spec.js | 0 tests/{ => flow}/template/template.js | 0 tests/{ => flow}/this/This.js | 0 .../this/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/this/arrows.js | 0 .../this}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../this_ctor}/jsfmt.spec.js | 0 tests/{ => flow}/this_ctor/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/this_type/class_expr.js | 0 tests/{ => flow}/this_type/contra.js | 0 tests/{ => flow}/this_type/export.js | 0 tests/{ => flow}/this_type/generics.js | 0 tests/{ => flow}/this_type/import.js | 0 tests/{ => flow}/this_type/interface.js | 0 .../this_type}/jsfmt.spec.js | 0 .../lib/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/this_type/lib/decl.js | 0 .../libs => flow/this_type/lib}/jsfmt.spec.js | 0 tests/{ => flow}/this_type/lib_client.js | 0 tests/{ => flow}/this_type/self.js | 0 tests/{ => flow}/this_type/statics.js | 0 tests/{ => flow}/this_type/test.js | 0 .../throw/__snapshots__/jsfmt.spec.js.snap | 0 .../throw}/jsfmt.spec.js | 0 tests/{ => flow}/throw/test.js | 0 tests/{ => flow}/traces/Traces.js | 0 tests/{ => flow}/traces/Traces2.js | 0 .../traces/__snapshots__/jsfmt.spec.js.snap | 0 tests/{typecast => flow/traces}/jsfmt.spec.js | 0 .../traits/__snapshots__/jsfmt.spec.js.snap | 0 tests/{typeof => flow/traits}/jsfmt.spec.js | 0 tests/{ => flow}/traits/test.js | 0 tests/{ => flow}/traits/test2.js | 0 .../try/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/try/abnormals.js | 0 tests/{ => flow}/try/init.js | 0 .../try}/jsfmt.spec.js | 0 tests/{ => flow}/try/return.js | 0 tests/{ => flow}/try/test.js | 0 .../tuples/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/tuples/array.js | 0 .../tuples}/jsfmt.spec.js | 0 tests/{ => flow}/tuples/optional.js | 0 tests/{ => flow}/tuples/too-few.js | 0 tests/{ => flow}/tuples/tuples.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/type-at-pos/destructuring.js | 0 .../type-at-pos/function_expressions.js | 0 tests/{ => flow}/type-at-pos/generics.js | 0 tests/{ => flow}/type-at-pos/import.js | 0 .../type-at-pos}/jsfmt.spec.js | 0 .../type-at-pos/object_special_cases.js | 0 tests/{ => flow}/type-at-pos/optional.js | 0 tests/{ => flow}/type-at-pos/predicates.js | 0 tests/{ => flow}/type-at-pos/react.js | 0 tests/{ => flow}/type-at-pos/templates.js | 0 tests/{ => flow}/type-at-pos/test.js | 0 tests/{ => flow}/type-at-pos/trycatch.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type-destructors}/jsfmt.spec.js | 0 .../type-destructors/non_maybe_type.js | 0 .../type-destructors/property_type.js | 0 tests/{ => flow}/type-destructors/union.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type-printer}/jsfmt.spec.js | 0 .../type-printer/printBinaryExpression.js | 0 tests/{ => flow}/type-printer/types.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type_args_nonstrict}/jsfmt.spec.js | 0 tests/{ => flow}/type_args_nonstrict/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type_args_strict}/jsfmt.spec.js | 0 tests/{ => flow}/type_args_strict/test.js | 0 tests/{ => flow}/type_only_vars/A.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type_only_vars/bad_shadowing.js | 0 .../type_only_vars/good_shadowing.js | 0 .../{ => flow}/type_only_vars/import_type.js | 0 .../type_only_vars}/jsfmt.spec.js | 0 tests/{ => flow}/type_only_vars/type_alias.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../{ => flow}/type_param_defaults/classes.js | 0 .../type_param_defaults}/jsfmt.spec.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/type_param_scope/class.js | 0 .../type_param_scope/default_params.js | 0 .../type_param_scope}/jsfmt.spec.js | 0 .../type_param_scope/method_shadow.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type_param_variance}/jsfmt.spec.js | 0 .../{ => flow}/type_param_variance/promise.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../type_param_variance2}/jsfmt.spec.js | 0 .../type_param_variance2/libs/Promise.js | 0 .../libs/__snapshots__/jsfmt.spec.js.snap | 0 .../type_param_variance2/libs}/jsfmt.spec.js | 0 .../type_param_variance2/promise.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{x => flow/typeapp_perf}/jsfmt.spec.js | 0 tests/{ => flow}/typeapp_perf/test1.js | 0 tests/{ => flow}/typeapp_perf/test2.js | 0 .../typecast/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/typecast/jsfmt.spec.js | 1 + tests/{ => flow}/typecast/typecast.js | 0 .../typeof/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/typeof/jsfmt.spec.js | 1 + tests/{ => flow}/typeof/typeof.js | 0 .../unary/__snapshots__/jsfmt.spec.js.snap | 120 ++ tests/flow/unary/jsfmt.spec.js | 1 + tests/{ => flow}/unary/unary.js | 0 tests/{ => flow}/unary/update.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../unchecked_haste_module_vs_lib/buffer.js | 0 .../jsfmt.spec.js | 1 + .../unchecked_haste_module_vs_lib/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 .../jsfmt.spec.js | 1 + .../unchecked_node_module_vs_lib/test.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/undefined/issue-518.js | 0 tests/flow/undefined/jsfmt.spec.js | 1 + tests/{ => flow}/undefined/undefined.js | 0 tests/{ => flow}/undefined/undefined2.js | 0 tests/{ => flow}/unicode/UnicodeUtils.js | 0 .../unicode/__snapshots__/jsfmt.spec.js.snap | 78 + tests/flow/unicode/jsfmt.spec.js | 1 + tests/flow/unicode/keys.js | 1 + .../__snapshots__/jsfmt.spec.js.snap | 89 - .../gen_big_disjoint_union.js | 0 tests/flow/union-intersection/jsfmt.spec.js | 1 + tests/flow/union-intersection/test.js | 15 + .../union/__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/union/fields.js | 0 tests/{ => flow}/union/fields2.js | 0 tests/{ => flow}/union/issue-17.js | 0 tests/{ => flow}/union/issue-198.js | 0 tests/{ => flow}/union/issue-256.js | 0 tests/{ => flow}/union/issue-323-lib.js | 0 tests/{ => flow}/union/issue-323.js | 0 tests/{ => flow}/union/issue-324.js | 0 tests/{ => flow}/union/issue-325.js | 0 tests/{ => flow}/union/issue-326.js | 0 tests/{ => flow}/union/issue-582.js | 0 tests/{ => flow}/union/issue-963.js | 0 tests/flow/union/jsfmt.spec.js | 1 + tests/{ => flow}/union/test-lib.js | 0 tests/{ => flow}/union/test.js | 0 tests/{ => flow}/union/type-app.js | 0 tests/{ => flow}/union/union.js | 0 tests/{ => flow}/union/yuge.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/{ => flow}/union_new/issue-1349.js | 0 tests/{ => flow}/union_new/issue-1371.js | 0 .../{ => flow}/union_new/issue-1455-helper.js | 0 tests/{ => flow}/union_new/issue-1455.js | 0 tests/{ => flow}/union_new/issue-1462-i.js | 0 tests/{ => flow}/union_new/issue-1462-ii.js | 0 tests/{ => flow}/union_new/issue-1664.js | 0 tests/{ => flow}/union_new/issue-1759.js | 0 tests/{ => flow}/union_new/issue-2232.js | 0 tests/{ => flow}/union_new/issue-815.js | 0 .../{ => flow}/union_new/issue-824-helper.js | 0 tests/{ => flow}/union_new/issue-824.js | 0 tests/flow/union_new/jsfmt.spec.js | 1 + .../lib/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/union_new/lib/jsfmt.spec.js | 1 + tests/{ => flow}/union_new/lib/test23_lib.js | 0 tests/{ => flow}/union_new/lib/test25_lib.js | 0 tests/{ => flow}/union_new/lib/test32_lib.js | 0 tests/{ => flow}/union_new/test1.js | 0 tests/{ => flow}/union_new/test10.js | 0 tests/{ => flow}/union_new/test11.js | 0 tests/{ => flow}/union_new/test12.js | 0 tests/{ => flow}/union_new/test13.js | 0 tests/{ => flow}/union_new/test14.js | 0 tests/{ => flow}/union_new/test15.js | 0 tests/{ => flow}/union_new/test16.js | 0 tests/{ => flow}/union_new/test17.js | 0 tests/{ => flow}/union_new/test18.js | 0 tests/{ => flow}/union_new/test19.js | 0 tests/{ => flow}/union_new/test2.js | 0 tests/{ => flow}/union_new/test20.js | 0 tests/{ => flow}/union_new/test21.js | 0 tests/{ => flow}/union_new/test22.js | 0 tests/{ => flow}/union_new/test23.js | 0 tests/{ => flow}/union_new/test24.js | 0 tests/{ => flow}/union_new/test25.js | 0 tests/{ => flow}/union_new/test26.js | 0 tests/{ => flow}/union_new/test27.js | 0 tests/{ => flow}/union_new/test29.js | 0 tests/{ => flow}/union_new/test3.js | 0 tests/{ => flow}/union_new/test30-helper.js | 0 tests/{ => flow}/union_new/test30.js | 0 tests/{ => flow}/union_new/test31.js | 0 tests/{ => flow}/union_new/test32.js | 0 tests/{ => flow}/union_new/test4.js | 0 tests/{ => flow}/union_new/test5.js | 0 tests/{ => flow}/union_new/test6.js | 0 tests/{ => flow}/union_new/test7.js | 0 tests/{ => flow}/union_new/test8.js | 0 tests/{ => flow}/union_new/test9.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/unreachable/jsfmt.spec.js | 1 + tests/{ => flow}/unreachable/typecheck.js | 0 tests/{ => flow}/unreachable/unreachable.js | 0 .../value/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/value/jsfmt.spec.js | 1 + tests/{ => flow}/value/value.js | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/vim_emacs_errors/jsfmt.spec.js | 1 + tests/{ => flow}/vim_emacs_errors/test.js | 0 .../weakmode/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/weakmode/jsfmt.spec.js | 1 + .../weakmode/should_fail_without_weak.js | 0 .../weakmode/should_pass_with_weak.js | 0 .../while/__snapshots__/jsfmt.spec.js.snap | 73 + tests/{ => flow}/while/abnormal.js | 0 tests/flow/while/jsfmt.spec.js | 1 + tests/{ => flow}/while/test.js | 0 .../window/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/window/jsfmt.spec.js | 1 + tests/{ => flow}/window/window1.js | 0 tests/{ => flow}/window/window2.js | 0 tests/{ => flow}/x/XControllerURIBuilder.js | 0 .../x/__snapshots__/jsfmt.spec.js.snap | 0 tests/flow/x/jsfmt.spec.js | 1 + tests/for/__snapshots__/jsfmt.spec.js.snap | 283 ---- .../function/__snapshots__/jsfmt.spec.js.snap | 406 ----- .../__snapshots__/jsfmt.spec.js.snap | 196 +-- tests/interface/module.js | 3 + .../__snapshots__/jsfmt.spec.js.snap | 52 + tests/jsx-multiline-assign/jsfmt.spec.js | 1 + .../test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 117 ++ tests/jsx-significant-space/jsfmt.spec.js | 1 + .../test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 174 ++ tests/jsx-split-attrs/jsfmt.spec.js | 1 + .../test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 237 +++ tests/jsx-stateless-arrow-fn/jsfmt.spec.js | 1 + .../test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 0 tests/line/jsfmt.spec.js | 1 + tests/{line-endings => line}/windows.js | 0 .../literal/__snapshots__/jsfmt.spec.js.snap | 116 +- tests/literal/number.js | 24 - .../__snapshots__/jsfmt.spec.js.snap | 17 + tests/method-chain/jsfmt.spec.js | 1 + .../method-chain.js => method-chain/test.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 58 + tests/object-prop-break-in/jsfmt.spec.js | 1 + .../test.js} | 0 .../objects/__snapshots__/jsfmt.spec.js.snap | 156 -- .../__snapshots__/jsfmt.spec.js.snap | 10 + tests/optional-type-name/jsfmt.spec.js | 1 + .../test.js} | 0 .../prettier/__snapshots__/jsfmt.spec.js.snap | 761 --------- tests/switch/__snapshots__/jsfmt.spec.js.snap | 406 ----- .../template/__snapshots__/jsfmt.spec.js.snap | 80 - .../__snapshots__/jsfmt.spec.js.snap | 0 .../function-calls.js | 0 .../jsfmt.spec.js | 0 .../object.js | 0 tests/unary/__snapshots__/jsfmt.spec.js.snap | 121 -- .../__snapshots__/jsfmt.spec.js.snap | 0 tests/unary_expression/jsfmt.spec.js | 1 + .../urnary_expression.js | 0 .../unicode/__snapshots__/jsfmt.spec.js.snap | 72 - .../__snapshots__/jsfmt.spec.js.snap | 91 + tests/union_intersection/jsfmt.spec.js | 1 + .../test.js | 16 - tests/while/__snapshots__/jsfmt.spec.js.snap | 74 - 1851 files changed, 6617 insertions(+), 5468 deletions(-) create mode 100644 tests/arrows/block_like.js create mode 100644 tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap rename tests/{abnormal => binary-expressions}/jsfmt.spec.js (100%) rename tests/{prettier/binary-expressions.js => binary-expressions/test.js} (100%) create mode 100644 tests/directives/__snapshots__/jsfmt.spec.js.snap rename tests/{annot/any => directives}/jsfmt.spec.js (100%) rename tests/{prettier/directives.js => directives/test.js} (100%) create mode 100644 tests/exports/__snapshots__/jsfmt.spec.js.snap rename tests/{annot => exports}/jsfmt.spec.js (100%) rename tests/{prettier/exports.js => exports/test.js} (100%) rename tests/{ => flow}/abnormal/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/abnormal/break-continue.js (100%) rename tests/{annot2 => flow/abnormal}/jsfmt.spec.js (100%) rename tests/{ => flow}/abnormal/return.js (100%) rename tests/{ => flow}/annot/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/annot/annot.js (100%) rename tests/{ => flow}/annot/any/A.js (100%) rename tests/{ => flow}/annot/any/B.js (100%) rename tests/{ => flow}/annot/any/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow/annot}/any/jsfmt.spec.js (100%) rename tests/{ => flow}/annot/forward_ref.js (100%) rename tests/{ => flow}/annot/issue-530.js (100%) rename tests/{arith => flow/annot}/jsfmt.spec.js (100%) rename tests/{ => flow}/annot/leak.js (100%) rename tests/{ => flow}/annot/other.js (100%) rename tests/{ => flow}/annot/scope.js (100%) rename tests/{ => flow}/annot/test.js (100%) rename tests/{ => flow}/annot2/A.js (100%) rename tests/{ => flow}/annot2/B.js (100%) rename tests/{ => flow}/annot2/T.js (100%) rename tests/{ => flow}/annot2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{array-filter => flow/annot2}/jsfmt.spec.js (100%) rename tests/{ => flow}/any/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/any/any.js (100%) rename tests/{ => flow}/any/anyexportflowfile.js (100%) rename tests/{ => flow}/any/flowfixme.js (100%) rename tests/{ => flow}/any/flowissue.js (100%) rename tests/{arraylib => flow/any}/jsfmt.spec.js (100%) rename tests/{ => flow}/any/nonflowfile.js (100%) rename tests/{ => flow}/any/propagate.js (100%) rename tests/{ => flow}/any/reach.js (100%) rename tests/{ => flow}/arith/Arith.js (100%) rename tests/{ => flow}/arith/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/arith/exponent.js (100%) rename tests/{ => flow}/arith/generic.js (100%) rename tests/{async_iteration => flow/arith}/jsfmt.spec.js (100%) rename tests/{ => flow}/arith/mult.js (100%) rename tests/{ => flow}/arith/relational.js (100%) rename tests/{ => flow}/array-filter/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{autocomplete => flow/array-filter}/jsfmt.spec.js (100%) rename tests/{ => flow}/array-filter/test.js (100%) rename tests/{ => flow}/array-filter/test2.js (100%) create mode 100644 tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap rename tests/{auxiliary => flow/array_spread}/jsfmt.spec.js (100%) rename tests/{ => flow}/array_spread/test.js (100%) rename tests/{ => flow}/arraylib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/arraylib/array_lib.js (100%) rename tests/{auxiliary/lib => flow/arraylib}/jsfmt.spec.js (100%) rename tests/{ => flow}/arrays/Arrays.js (100%) create mode 100644 tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap rename tests/{binary => flow/arrays}/jsfmt.spec.js (100%) rename tests/{ => flow}/arrays/numeric_elem.js (100%) create mode 100644 tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/arrows/advanced_arrows.js (100%) rename tests/{ => flow}/arrows/arrows.js (93%) rename tests/{binding => flow/arrows}/jsfmt.spec.js (100%) create mode 100644 tests/flow/async/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/async/async.js (100%) rename tests/{ => flow}/async/async2.js (100%) rename tests/{ => flow}/async/async3.js (100%) rename tests/{ => flow}/async/async_base_class.js (100%) rename tests/{ => flow}/async/async_parse.js (100%) rename tests/{ => flow}/async/async_promise.js (100%) rename tests/{ => flow}/async/async_return_void.js (100%) create mode 100644 tests/flow/async/await_parse.js rename tests/{bom => flow/async}/jsfmt.spec.js (100%) rename tests/{ => flow}/async_iteration/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/async_iteration/delegate_yield.js (100%) rename tests/{ => flow}/async_iteration/generator.js (100%) rename tests/{bounded_poly => flow/async_iteration}/jsfmt.spec.js (100%) rename tests/{ => flow}/async_iteration/return.js (100%) rename tests/{ => flow}/async_iteration/throw.js (100%) rename tests/{ => flow}/autocomplete/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/autocomplete/customfun.js (100%) rename tests/{break => flow/autocomplete}/jsfmt.spec.js (100%) rename tests/{ => flow}/autocomplete/unknown.js (100%) rename tests/{ => flow}/auxiliary/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/auxiliary/client.js (100%) rename tests/{builtin_uses => flow/auxiliary}/jsfmt.spec.js (100%) rename tests/{ => flow}/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{builtins => flow/auxiliary/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/auxiliary/lib/lib.js (100%) rename tests/{ => flow}/binary/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/binary/in.js (100%) rename tests/{call_properties => flow/binary}/jsfmt.spec.js (100%) rename tests/{ => flow}/binding/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/binding/const.js (100%) rename tests/{callable => flow/binding}/jsfmt.spec.js (100%) rename tests/{ => flow}/binding/rebinding.js (100%) rename tests/{ => flow}/binding/scope.js (100%) rename tests/{ => flow}/binding/tdz.js (100%) rename tests/{ => flow}/bom/FormData.js (100%) rename tests/{ => flow}/bom/MutationObserver.js (100%) rename tests/{ => flow}/bom/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{check-contents => flow/bom}/jsfmt.spec.js (100%) rename tests/{ => flow}/bounded_poly/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{class_munging => flow/bounded_poly}/jsfmt.spec.js (100%) rename tests/{ => flow}/bounded_poly/scope.js (100%) rename tests/{ => flow}/bounded_poly/test.js (100%) rename tests/{ => flow}/break/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/break/break.js (100%) rename tests/{class_statics => flow/break}/jsfmt.spec.js (100%) rename tests/{ => flow}/builtin_uses/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{class_subtyping => flow/builtin_uses}/jsfmt.spec.js (100%) rename tests/{ => flow}/builtin_uses/test.js (100%) rename tests/{ => flow}/builtin_uses/test2.js (100%) rename tests/{ => flow}/builtins/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/builtins/array.js (100%) rename tests/{ => flow}/builtins/genericfoo.js (100%) rename tests/{class_type => flow/builtins}/jsfmt.spec.js (100%) rename tests/{ => flow}/call_properties/A.js (100%) rename tests/{ => flow}/call_properties/B.js (100%) rename tests/{ => flow}/call_properties/C.js (100%) rename tests/{ => flow}/call_properties/D.js (100%) rename tests/{ => flow}/call_properties/E.js (100%) rename tests/{ => flow}/call_properties/F.js (100%) rename tests/{ => flow}/call_properties/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{closure => flow/call_properties}/jsfmt.spec.js (100%) rename tests/{ => flow}/callable/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{commonjs => flow/callable}/jsfmt.spec.js (100%) rename tests/{ => flow}/callable/optional.js (100%) rename tests/{ => flow}/callable/primitives.js (100%) rename tests/{ => flow}/check-contents/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{conditional => flow/check-contents}/jsfmt.spec.js (100%) rename tests/{ => flow}/check-contents/not_flow.js (100%) rename tests/{ => flow}/class_munging/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_all => flow/class_munging}/jsfmt.spec.js (100%) rename tests/{ => flow}/class_munging/with_munging.js (100%) rename tests/{ => flow}/class_munging/without_munging.js (100%) rename tests/{ => flow}/class_statics/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_all_false => flow/class_statics}/jsfmt.spec.js (100%) rename tests/{ => flow}/class_statics/test.js (100%) rename tests/{ => flow}/class_subtyping/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_all_weak => flow/class_subtyping}/jsfmt.spec.js (100%) rename tests/{ => flow}/class_subtyping/test.js (100%) rename tests/{ => flow}/class_subtyping/test2.js (100%) rename tests/{ => flow}/class_subtyping/test3.js (100%) rename tests/{ => flow}/class_subtyping/test4.js (100%) rename tests/{ => flow}/class_type/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_file_extensions => flow/class_type}/jsfmt.spec.js (100%) rename tests/{ => flow}/class_type/test.js (100%) rename tests/{ => flow}/class_type/test2.js (100%) rename tests/{ => flow}/classes/A.js (100%) rename tests/{ => flow}/classes/B.js (100%) rename tests/{ => flow}/classes/C.js (100%) rename tests/{ => flow}/classes/D.js (100%) create mode 100644 tests/flow/classes/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/classes/class_shapes.js (100%) rename tests/{ => flow}/classes/expr.js (100%) rename tests/{config_ignore/dir => flow/classes}/jsfmt.spec.js (100%) rename tests/{ => flow}/classes/loc.js (100%) rename tests/{ => flow}/classes/statics.js (100%) rename tests/{ => flow}/closure/Closure.js (100%) rename tests/{ => flow}/closure/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/closure/cond_havoc.js (100%) rename tests/{ => flow}/closure/const.js (100%) rename tests/{config_ignore => flow/closure}/jsfmt.spec.js (100%) rename tests/{ => flow}/commonjs/Abs.js (100%) rename tests/{ => flow}/commonjs/Rel.js (100%) rename tests/{ => flow}/commonjs/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_name_mapper_PROJECT_ROOT-1.0 => flow/commonjs}/jsfmt.spec.js (100%) create mode 100644 tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap rename tests/{config_module_name_mapper_PROJECT_ROOT-1.0/src => flow/computed_props}/jsfmt.spec.js (100%) rename tests/{ => flow}/computed_props/test.js (100%) rename tests/{ => flow}/computed_props/test2.js (100%) rename tests/{ => flow}/computed_props/test3.js (100%) rename tests/{ => flow}/computed_props/test4.js (100%) rename tests/{ => flow}/computed_props/test5.js (100%) rename tests/{ => flow}/computed_props/test6.js (100%) rename tests/{ => flow}/computed_props/test7.js (100%) rename tests/{ => flow}/conditional/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/conditional/conditional.js (100%) rename tests/{config_module_name_mapper_filetype => flow/conditional}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_all/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_name_rewrite_haste => flow/config_all}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_all/no_at_flow.js (100%) rename tests/{ => flow}/config_all_false/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_name_rewrite_node => flow/config_all_false}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_all_false/no_at_flow.js (100%) rename tests/{ => flow}/config_all_weak/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_system_node_resolve_dirname/custom_resolve_dir/testproj => flow/config_all_weak}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_all_weak/no_at_flow.js (100%) rename tests/{ => flow}/config_file_extensions/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2 => flow/config_file_extensions}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_file_extensions/test.js (100%) rename tests/{ => flow}/config_ignore/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_ignore/dir/foo.js (100%) rename tests/{config_module_system_node_resolve_dirname => flow/config_ignore/dir}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_ignore/foo.js (100%) rename tests/{config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2 => flow/config_ignore}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_module_system_node_resolve_dirname/subdir => flow/config_module_name_mapper_PROJECT_ROOT-1.0}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_name_mapper_PROJECT_ROOT-1.0/main.js (100%) rename tests/{ => flow}/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_munging_underscores => flow/config_module_name_mapper_PROJECT_ROOT-1.0/src}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_name_mapper_PROJECT_ROOT-1.0/src/testmodule.js (100%) rename tests/{ => flow}/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{config_munging_underscores2 => flow/config_module_name_mapper_filetype}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_name_mapper_filetype/test.js (100%) rename tests/{ => flow}/config_module_name_rewrite_haste/A.js (100%) rename tests/{ => flow}/config_module_name_rewrite_haste/Exists.js (100%) rename tests/{ => flow}/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{const_params => flow/config_module_name_rewrite_haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_name_rewrite_node/A.js (100%) rename tests/{ => flow}/config_module_name_rewrite_node/Exists.js (100%) rename tests/{ => flow}/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{constructor => flow/config_module_name_rewrite_node}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/index.js (100%) rename tests/{constructor_annots => flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/index.js (100%) rename tests/{contents/ignore => flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2}/jsfmt.spec.js (100%) rename tests/{contents/no_flow => flow/config_module_system_node_resolve_dirname}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/index.js (100%) rename tests/{core_tests => flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2}/jsfmt.spec.js (100%) rename tests/{covariance => flow/config_module_system_node_resolve_dirname/subdir}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/subdir/sublevel.js (100%) rename tests/{ => flow}/config_module_system_node_resolve_dirname/toplevel.js (100%) rename tests/{ => flow}/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_munging_underscores/chain.js (100%) rename tests/{ => flow}/config_munging_underscores/commonjs_export.js (100%) rename tests/{ => flow}/config_munging_underscores/commonjs_import.js (100%) rename tests/{coverage => flow/config_munging_underscores}/jsfmt.spec.js (100%) rename tests/{ => flow}/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/config_munging_underscores2/chain.js (100%) rename tests/{cycle => flow/config_munging_underscores2}/jsfmt.spec.js (100%) rename tests/{ => flow}/const_params/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{date => flow/const_params}/jsfmt.spec.js (100%) rename tests/{ => flow}/const_params/test.js (100%) rename tests/{ => flow}/constructor/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/constructor/constructor.js (100%) rename tests/{declaration_files_haste/external/_d3 => flow/constructor}/jsfmt.spec.js (100%) rename tests/{ => flow}/constructor_annots/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/constructor_annots/constructors.js (100%) rename tests/{declaration_files_haste/foo/bar => flow/constructor_annots}/jsfmt.spec.js (100%) rename tests/{ => flow}/constructor_annots/test.js (100%) rename tests/{ => flow}/contents/ignore/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/contents/ignore/dummy.js (100%) rename tests/{declaration_files_haste => flow/contents/ignore}/jsfmt.spec.js (100%) rename tests/{ => flow}/contents/ignore/test.js (100%) rename tests/{ => flow}/contents/no_flow/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/contents/no_flow/dummy.js (100%) rename tests/{declaration_files_haste/ws => flow/contents/no_flow}/jsfmt.spec.js (100%) rename tests/{ => flow}/contents/no_flow/test.js (100%) rename tests/{ => flow}/core_tests/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/core_tests/boolean.js (100%) rename tests/{declaration_files_haste/ws/test => flow/core_tests}/jsfmt.spec.js (100%) rename tests/{ => flow}/core_tests/map.js (100%) rename tests/{ => flow}/core_tests/regexp.js (100%) rename tests/{ => flow}/core_tests/weakset.js (100%) rename tests/{ => flow}/covariance/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declaration_files_incremental_haste/external/_d3 => flow/covariance}/jsfmt.spec.js (100%) rename tests/{ => flow}/covariance/test.js (100%) rename tests/{ => flow}/coverage/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/coverage/crash.js (100%) rename tests/{ => flow}/coverage/declare_module.js (100%) rename tests/{declaration_files_incremental_haste/foo/bar => flow/coverage}/jsfmt.spec.js (100%) rename tests/{ => flow}/coverage/no_pragma.js (100%) rename tests/{ => flow}/coverage/non-termination.js (100%) rename tests/{ => flow}/cycle/A.js (100%) rename tests/{ => flow}/cycle/B.js (100%) rename tests/{ => flow}/cycle/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declaration_files_incremental_haste => flow/cycle}/jsfmt.spec.js (100%) rename tests/{ => flow}/date/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/date/date.js (100%) rename tests/{declaration_files_incremental_haste/ws => flow/date}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_haste/ExplicitProvidesModuleDifferentName.js (100%) rename tests/{ => flow}/declaration_files_haste/ExplicitProvidesModuleSameName.js (100%) rename tests/{ => flow}/declaration_files_haste/ImplicitProvidesModule.js (100%) rename tests/{ => flow}/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declaration_files_incremental_haste/ws/test => flow/declaration_files_haste/external/_d3}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_haste/external/_d3/min.js (100%) rename tests/{ => flow}/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declaration_files_incremental_node => flow/declaration_files_haste/foo/bar}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_haste/foo/bar/nested_test.js (100%) rename tests/{declaration_files_node => flow/declaration_files_haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_haste/md5.js (100%) rename tests/{ => flow}/declaration_files_haste/test.js (100%) rename tests/{ => flow}/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_haste/ws/index.js (100%) rename tests/{declare_class => flow/declaration_files_haste/ws}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_haste/ws/test/client.js (100%) rename tests/{declare_class/lib => flow/declaration_files_haste/ws/test}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/A.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ExplicitProvidesModuleDifferentName.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ExplicitProvidesModuleSameName.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ImplicitProvidesModule.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declare_export => flow/declaration_files_incremental_haste/external/_d3}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/external/_d3/min.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declare_fun => flow/declaration_files_incremental_haste/foo/bar}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/foo/bar/nested_test.js (100%) rename tests/{declare_module_exports/flow-typed => flow/declaration_files_incremental_haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/md5.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/test.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ws/index.js (100%) rename tests/{declare_module_exports => flow/declaration_files_incremental_haste/ws}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declaration_files_incremental_haste/ws/test/client.js (100%) rename tests/{declare_type => flow/declaration_files_incremental_haste/ws/test}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_node/A.js (100%) rename tests/{ => flow}/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{declare_type/lib => flow/declaration_files_incremental_node}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_incremental_node/test_absolute.js (100%) rename tests/{ => flow}/declaration_files_incremental_node/test_relative.js (100%) rename tests/{ => flow}/declaration_files_node/A.js (100%) rename tests/{ => flow}/declaration_files_node/CJS.js (100%) rename tests/{ => flow}/declaration_files_node/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{def_site_variance => flow/declaration_files_node}/jsfmt.spec.js (100%) rename tests/{ => flow}/declaration_files_node/test_absolute.js (100%) rename tests/{ => flow}/declaration_files_node/test_relative.js (100%) rename tests/{ => flow}/declare_class/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declare_class/declare_class.js (100%) rename tests/{demo/1 => flow/declare_class}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_class/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{demo/2 => flow/declare_class/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_class/lib/test.js (100%) rename tests/{ => flow}/declare_export/B.js (100%) rename tests/{ => flow}/declare_export/C.js (100%) rename tests/{ => flow}/declare_export/CommonJS_Clobbering_Class.js (100%) rename tests/{ => flow}/declare_export/CommonJS_Clobbering_Lit.js (100%) rename tests/{ => flow}/declare_export/CommonJS_Named.js (100%) rename tests/{ => flow}/declare_export/ES6_DefaultAndNamed.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_AnonFunction1.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_AnonFunction2.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_NamedClass1.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_NamedClass2.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_NamedFunction1.js (100%) rename tests/{ => flow}/declare_export/ES6_Default_NamedFunction2.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportAllFromMulti.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportAllFrom_Intermediary1.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportAllFrom_Intermediary2.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportAllFrom_Source1.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportAllFrom_Source2.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportFrom_Intermediary1.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportFrom_Intermediary2.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportFrom_Source1.js (100%) rename tests/{ => flow}/declare_export/ES6_ExportFrom_Source2.js (100%) rename tests/{ => flow}/declare_export/ES6_Named1.js (100%) rename tests/{ => flow}/declare_export/ES6_Named2.js (100%) rename tests/{ => flow}/declare_export/ProvidesModuleA.js (100%) rename tests/{ => flow}/declare_export/ProvidesModuleCJSDefault.js (100%) rename tests/{ => flow}/declare_export/ProvidesModuleD.js (100%) rename tests/{ => flow}/declare_export/ProvidesModuleES6Default.js (100%) rename tests/{ => flow}/declare_export/SideEffects.js (100%) rename tests/{ => flow}/declare_export/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declare_export/es6modules.js (100%) rename tests/{deps => flow/declare_export}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_fun/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{destructuring => flow/declare_fun}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_fun/test.js (100%) rename tests/{ => flow}/declare_module_exports/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{dictionary => flow/declare_module_exports/flow-typed}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_module_exports/flow-typed/libs.js (100%) rename tests/{disjoint-union-perf => flow/declare_module_exports}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_module_exports/main.js (100%) rename tests/{ => flow}/declare_type/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declare_type/import_declare_type.js (100%) rename tests/{docblock_flow => flow/declare_type}/jsfmt.spec.js (100%) rename tests/{ => flow}/declare_type/lib/DeclareModule_TypeAlias.js (100%) rename tests/{ => flow}/declare_type/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/declare_type/lib/declare_type_exports.js (100%) rename tests/{dom => flow/declare_type/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/def_site_variance/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{dump-types => flow/def_site_variance}/jsfmt.spec.js (100%) rename tests/{ => flow}/def_site_variance/test.js (100%) rename tests/{ => flow}/demo/1/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/demo/1/f.js (100%) rename tests/{duplicate_methods => flow/demo/1}/jsfmt.spec.js (100%) rename tests/{ => flow}/demo/2/A.js (100%) rename tests/{ => flow}/demo/2/B.js (100%) rename tests/{ => flow}/demo/2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{encaps => flow/demo/2}/jsfmt.spec.js (100%) rename tests/{ => flow}/deps/A.js (100%) rename tests/{ => flow}/deps/B.js (100%) rename tests/{ => flow}/deps/C.js (100%) rename tests/{ => flow}/deps/D.js (100%) rename tests/{ => flow}/deps/E.js (100%) rename tests/{ => flow}/deps/F.js (100%) rename tests/{ => flow}/deps/G.js (100%) rename tests/{ => flow}/deps/H.js (100%) rename tests/{ => flow}/deps/I.js (100%) rename tests/{ => flow}/deps/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{enumerror => flow/deps}/jsfmt.spec.js (100%) rename tests/{ => flow}/destructuring/__snapshots__/jsfmt.spec.js.snap (99%) rename tests/{ => flow}/destructuring/array_rest.js (100%) rename tests/{ => flow}/destructuring/computed.js (100%) rename tests/{ => flow}/destructuring/defaults.js (100%) rename tests/{ => flow}/destructuring/destructuring.js (100%) rename tests/{ => flow}/destructuring/destructuring_param.js (80%) rename tests/{ => flow}/destructuring/eager.js (100%) rename tests/{equals => flow/destructuring}/jsfmt.spec.js (100%) rename tests/{ => flow}/destructuring/poly.js (100%) rename tests/{ => flow}/destructuring/rec.js (100%) rename tests/{ => flow}/destructuring/string_lit.js (100%) rename tests/{ => flow}/destructuring/unannotated.js (100%) rename tests/{ => flow}/dictionary/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/dictionary/any.js (100%) rename tests/{ => flow}/dictionary/compatible.js (100%) rename tests/{ => flow}/dictionary/dictionary.js (100%) rename tests/{ => flow}/dictionary/incompatible.js (100%) rename tests/{ => flow}/dictionary/issue-1745.js (100%) rename tests/{error_messages => flow/dictionary}/jsfmt.spec.js (100%) rename tests/{ => flow}/dictionary/test.js (100%) rename tests/{ => flow}/dictionary/test_client.js (100%) rename tests/{ => flow}/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/disjoint-union-perf/ast.js (100%) rename tests/{ => flow}/disjoint-union-perf/emit.js (100%) rename tests/{ => flow}/disjoint-union-perf/jsAst.js (100%) rename tests/{es_declare_module/flow-typed => flow/disjoint-union-perf}/jsfmt.spec.js (100%) rename tests/{ => flow}/docblock_flow/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{es_declare_module => flow/docblock_flow}/jsfmt.spec.js (100%) rename tests/{ => flow}/docblock_flow/license_with_flow.js (100%) rename tests/{ => flow}/docblock_flow/max_header_tokens.js (100%) rename tests/{ => flow}/docblock_flow/multiple_flows_1.js (100%) rename tests/{ => flow}/docblock_flow/multiple_flows_2.js (100%) rename tests/{ => flow}/docblock_flow/multiple_providesModule_1.js (100%) rename tests/{ => flow}/docblock_flow/multiple_providesModule_2.js (100%) rename tests/{ => flow}/docblock_flow/use_strict_with_flow.js (100%) rename tests/{ => flow}/docblock_flow/with_flow.js (100%) rename tests/{ => flow}/docblock_flow/without_flow.js (100%) rename tests/{ => flow}/dom/CanvasRenderingContext2D.js (100%) rename tests/{ => flow}/dom/CustomEvent.js (100%) rename tests/{ => flow}/dom/Document.js (100%) rename tests/{ => flow}/dom/Element.js (100%) rename tests/{ => flow}/dom/HTMLCanvasElement.js (100%) rename tests/{ => flow}/dom/HTMLElement.js (100%) rename tests/{ => flow}/dom/HTMLInputElement.js (100%) rename tests/{ => flow}/dom/URL.js (100%) rename tests/{ => flow}/dom/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/dom/eventtarget.js (100%) rename tests/{esproposal_export_star_as.enable => flow/dom}/jsfmt.spec.js (100%) rename tests/{ => flow}/dom/path2d.js (100%) rename tests/{ => flow}/dom/registerElement.js (100%) rename tests/{ => flow}/dom/traversal.js (100%) rename tests/{ => flow}/dump-types/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/dump-types/import.js (100%) rename tests/{esproposal_export_star_as.ignore => flow/dump-types}/jsfmt.spec.js (100%) rename tests/{ => flow}/dump-types/test.js (100%) rename tests/{ => flow}/duplicate_methods/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{export_default/lib => flow/duplicate_methods}/jsfmt.spec.js (100%) rename tests/{ => flow}/duplicate_methods/test.js (100%) rename tests/{ => flow}/encaps/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/encaps/encaps.js (100%) rename tests/{export_type => flow/encaps}/jsfmt.spec.js (100%) rename tests/{ => flow}/enumerror/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/enumerror/enumerror.js (100%) rename tests/{extensions => flow/enumerror}/jsfmt.spec.js (100%) rename tests/{ => flow}/equals/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/equals/equals.js (100%) rename tests/{facebook_fbt_none => flow/equals}/jsfmt.spec.js (100%) rename tests/{ => flow}/error_messages/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/error_messages/errors.js (100%) rename tests/{facebook_fbt_some/flow-typed => flow/error_messages}/jsfmt.spec.js (100%) rename tests/{ => flow}/es6modules/B.js (100%) rename tests/{ => flow}/es6modules/C.js (100%) rename tests/{ => flow}/es6modules/CommonJS_Clobbering_Class.js (100%) rename tests/{ => flow}/es6modules/CommonJS_Clobbering_Frozen.js (100%) rename tests/{ => flow}/es6modules/CommonJS_Clobbering_Lit.js (100%) rename tests/{ => flow}/es6modules/CommonJS_Named.js (100%) rename tests/{ => flow}/es6modules/ES6_DefaultAndNamed.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_AnonClass1.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_AnonClass2.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_AnonFunction1.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_AnonFunction2.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_NamedClass1.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_NamedClass2.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_NamedFunction1.js (100%) rename tests/{ => flow}/es6modules/ES6_Default_NamedFunction2.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportAllFromMulti.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportAllFrom_Intermediary1.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportAllFrom_Intermediary2.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportAllFrom_Source1.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportAllFrom_Source2.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportFrom_Intermediary1.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportFrom_Intermediary2.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportFrom_Source1.js (100%) rename tests/{ => flow}/es6modules/ES6_ExportFrom_Source2.js (100%) rename tests/{ => flow}/es6modules/ES6_Named1.js (100%) rename tests/{ => flow}/es6modules/ES6_Named2.js (100%) rename tests/{ => flow}/es6modules/ExportType.js (100%) rename tests/{ => flow}/es6modules/ProvidesModuleA.js (100%) rename tests/{ => flow}/es6modules/ProvidesModuleCJSDefault.js (100%) rename tests/{ => flow}/es6modules/ProvidesModuleD.js (100%) rename tests/{ => flow}/es6modules/ProvidesModuleES6Default.js (100%) rename tests/{ => flow}/es6modules/SideEffects.js (100%) create mode 100644 tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/es6modules/es6modules.js (100%) rename tests/{facebook_fbt_some => flow/es6modules}/jsfmt.spec.js (100%) rename tests/{ => flow}/es6modules/test_imports_are_frozen.js (100%) rename tests/{ => flow}/es_declare_module/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/es_declare_module/es_declare_module.js (100%) rename tests/{ => flow}/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/es_declare_module/flow-typed/declares.js (100%) rename tests/{facebookisms => flow/es_declare_module/flow-typed}/jsfmt.spec.js (100%) rename tests/{fetch => flow/es_declare_module}/jsfmt.spec.js (100%) rename tests/{ => flow}/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/esproposal_export_star_as.enable/dest.js (100%) rename tests/{find-module => flow/esproposal_export_star_as.enable}/jsfmt.spec.js (100%) rename tests/{ => flow}/esproposal_export_star_as.enable/source.js (100%) rename tests/{ => flow}/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/esproposal_export_star_as.ignore/dest.js (100%) rename tests/{fixpoint => flow/esproposal_export_star_as.ignore}/jsfmt.spec.js (100%) rename tests/{ => flow}/esproposal_export_star_as.ignore/source.js (100%) rename tests/{ => flow}/export_default/P.js (100%) create mode 100644 tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap rename tests/{flow_ast.template_strings => flow/export_default}/jsfmt.spec.js (100%) rename tests/{ => flow}/export_default/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{forof => flow/export_default/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/export_default/lib/lib.js (100%) rename tests/{ => flow}/export_default/test.js (100%) rename tests/{ => flow}/export_type/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/export_type/cjs_with_types.js (100%) rename tests/{ => flow}/export_type/importer.js (100%) rename tests/{funrec => flow/export_type}/jsfmt.spec.js (100%) rename tests/{ => flow}/export_type/types_only.js (100%) rename tests/{ => flow}/export_type/types_only2.js (100%) rename tests/{ => flow}/extensions/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/extensions/foo.js (100%) rename tests/{generators => flow/extensions}/jsfmt.spec.js (100%) rename tests/{ => flow}/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{generics => flow/facebook_fbt_none}/jsfmt.spec.js (100%) rename tests/{ => flow}/facebook_fbt_none/main.js (100%) rename tests/{ => flow}/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/facebook_fbt_some/flow-typed/fbt.js (100%) rename tests/{geolocation => flow/facebook_fbt_some/flow-typed}/jsfmt.spec.js (100%) rename tests/{get-def/helpers => flow/facebook_fbt_some}/jsfmt.spec.js (100%) rename tests/{ => flow}/facebook_fbt_some/main.js (100%) rename tests/{ => flow}/facebookisms/Bar.js (100%) rename tests/{ => flow}/facebookisms/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/facebookisms/copyProperties.js (100%) rename tests/{ => flow}/facebookisms/invariant.js (100%) rename tests/{get-def => flow/facebookisms}/jsfmt.spec.js (100%) rename tests/{ => flow}/facebookisms/lib.js (100%) rename tests/{ => flow}/facebookisms/mergeInto.js (100%) rename tests/{ => flow}/facebookisms/test.js (100%) rename tests/{ => flow}/fetch/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/fetch/fetch.js (100%) rename tests/{ => flow}/fetch/headers.js (100%) rename tests/{get-def2 => flow/fetch}/jsfmt.spec.js (100%) rename tests/{ => flow}/fetch/request.js (100%) rename tests/{ => flow}/fetch/response.js (100%) rename tests/{ => flow}/fetch/urlsearchparams.js (100%) rename tests/{ => flow}/find-module/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{get-def2/lib => flow/find-module}/jsfmt.spec.js (100%) rename tests/{ => flow}/find-module/req.js (100%) rename tests/{ => flow}/find-module/test.js (100%) rename tests/{ => flow}/fixpoint/Fun.js (100%) rename tests/{ => flow}/fixpoint/Ycombinator.js (100%) rename tests/{ => flow}/fixpoint/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{get-imports-and-importers => flow/fixpoint}/jsfmt.spec.js (100%) rename tests/{ => flow}/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/flow_ast.template_strings/foo.js (100%) rename tests/{getters_and_setters_disabled => flow/flow_ast.template_strings}/jsfmt.spec.js (100%) create mode 100644 tests/flow/for/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/for/abnormal.js (100%) rename tests/{ => flow}/for/abnormal_for_in.js (100%) rename tests/{ => flow}/for/abnormal_for_of.js (100%) rename tests/{getters_and_setters_enabled => flow/for}/jsfmt.spec.js (100%) rename tests/{ => flow}/forof/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/forof/forof.js (100%) rename tests/{haste_cycle => flow/forof}/jsfmt.spec.js (100%) create mode 100644 tests/flow/function/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/function/apply.js (100%) rename tests/{ => flow}/function/bind.js (100%) rename tests/{ => flow}/function/call.js (100%) rename tests/{ => flow}/function/function.js (100%) rename tests/{haste_cycle/models => flow/function}/jsfmt.spec.js (100%) rename tests/{ => flow}/function/rest.js (100%) rename tests/{ => flow}/funrec/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/funrec/funrec.js (100%) rename tests/{haste_dupe => flow/funrec}/jsfmt.spec.js (100%) rename tests/{ => flow}/generators/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/generators/class.js (100%) rename tests/{ => flow}/generators/class_failure.js (100%) rename tests/{ => flow}/generators/generators.js (100%) rename tests/{ignore_package => flow/generators}/jsfmt.spec.js (100%) rename tests/{ => flow}/generators/return.js (100%) rename tests/{ => flow}/generators/throw.js (100%) rename tests/{ => flow}/generators/variance.js (100%) rename tests/{ => flow}/generics/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/generics/generics.js (100%) rename tests/{immutable_methods => flow/generics}/jsfmt.spec.js (100%) rename tests/{ => flow}/geolocation/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/geolocation/a.js (100%) rename tests/{import_type => flow/geolocation}/jsfmt.spec.js (100%) rename tests/{ => flow}/get-def/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/get-def/example.js (100%) rename tests/{ => flow}/get-def/helpers/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/get-def/helpers/exports_default.js (100%) rename tests/{ => flow}/get-def/helpers/exports_named.js (100%) rename tests/{import_typeof => flow/get-def/helpers}/jsfmt.spec.js (100%) rename tests/{ => flow}/get-def/imports.js (100%) rename tests/{include/foo/batman => flow/get-def}/jsfmt.spec.js (100%) rename tests/{ => flow}/get-def/library.js (100%) rename tests/{ => flow}/get-def2/Parent.js (100%) rename tests/{ => flow}/get-def2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{include/included => flow/get-def2}/jsfmt.spec.js (100%) rename tests/{ => flow}/get-def2/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{incremental => flow/get-def2/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/get-def2/lib/jsx.js (100%) rename tests/{ => flow}/get-def2/main.js (100%) rename tests/{ => flow}/get-def2/override.js (100%) rename tests/{ => flow}/get-def2/react.js (100%) rename tests/{ => flow}/get-def2/types.js (100%) rename tests/{ => flow}/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/get-imports-and-importers/a.js (100%) rename tests/{ => flow}/get-imports-and-importers/b.js (100%) rename tests/{ => flow}/get-imports-and-importers/c.js (100%) rename tests/{incremental_basic => flow/get-imports-and-importers}/jsfmt.spec.js (100%) rename tests/{ => flow}/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/getters_and_setters_disabled/getters_and_setters.js (100%) rename tests/{incremental_basic/tmp1 => flow/getters_and_setters_disabled}/jsfmt.spec.js (100%) rename tests/{ => flow}/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/getters_and_setters_enabled/class.js (100%) rename tests/{incremental_basic/tmp2 => flow/getters_and_setters_enabled}/jsfmt.spec.js (100%) rename tests/{ => flow}/getters_and_setters_enabled/object.js (100%) rename tests/{ => flow}/getters_and_setters_enabled/react.js (100%) rename tests/{ => flow}/getters_and_setters_enabled/variance.js (100%) rename tests/{ => flow}/haste_cycle/API.js (100%) rename tests/{ => flow}/haste_cycle/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{incremental_basic/tmp3 => flow/haste_cycle}/jsfmt.spec.js (100%) rename tests/{ => flow}/haste_cycle/models/OpenGraphAction.js (100%) rename tests/{ => flow}/haste_cycle/models/OpenGraphObject.js (100%) rename tests/{ => flow}/haste_cycle/models/OpenGraphValueContainer.js (100%) rename tests/{ => flow}/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{incremental_cycle => flow/haste_cycle/models}/jsfmt.spec.js (100%) rename tests/{ => flow}/haste_dupe/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/haste_dupe/dupe1.js (100%) rename tests/{ => flow}/haste_dupe/dupe2.js (100%) rename tests/{incremental_cycle/tmp1 => flow/haste_dupe}/jsfmt.spec.js (100%) rename tests/{ => flow}/haste_dupe/requires_dupe.js (100%) rename tests/{ => flow}/ignore_package/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/ignore_package/foo.js (100%) rename tests/{incremental_cycle/tmp2 => flow/ignore_package}/jsfmt.spec.js (100%) rename tests/{ => flow}/immutable_methods/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{incremental_cycle/tmp3 => flow/immutable_methods}/jsfmt.spec.js (100%) rename tests/{ => flow}/immutable_methods/test.js (100%) rename tests/{ => flow}/import_type/ExportCJSDefault_Class.js (100%) rename tests/{ => flow}/import_type/ExportCJSNamed_Class.js (100%) rename tests/{ => flow}/import_type/ExportDefault_Class.js (100%) rename tests/{ => flow}/import_type/ExportNamed_Alias.js (100%) rename tests/{ => flow}/import_type/ExportNamed_Class.js (100%) rename tests/{ => flow}/import_type/ExportsANumber.js (100%) rename tests/{ => flow}/import_type/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/import_type/import_type.js (100%) rename tests/{ => flow}/import_type/issue-359.js (100%) rename tests/{incremental_delete => flow/import_type}/jsfmt.spec.js (100%) rename tests/{ => flow}/import_typeof/ExportCJSDefault_Class.js (100%) rename tests/{ => flow}/import_typeof/ExportCJSDefault_Number.js (100%) rename tests/{ => flow}/import_typeof/ExportCJSNamed_Class.js (100%) rename tests/{ => flow}/import_typeof/ExportCJSNamed_Number.js (100%) rename tests/{ => flow}/import_typeof/ExportDefault_Class.js (100%) rename tests/{ => flow}/import_typeof/ExportDefault_Number.js (100%) rename tests/{ => flow}/import_typeof/ExportNamed_Alias.js (100%) rename tests/{ => flow}/import_typeof/ExportNamed_Class.js (100%) rename tests/{ => flow}/import_typeof/ExportNamed_Multi.js (100%) rename tests/{ => flow}/import_typeof/ExportNamed_Number.js (100%) rename tests/{ => flow}/import_typeof/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/import_typeof/import_typeof.js (100%) rename tests/{incremental_duplicate_delete => flow/import_typeof}/jsfmt.spec.js (100%) rename tests/{ => flow}/include/foo/batman/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/include/foo/batman/baz.js (100%) rename tests/{incremental_json => flow/include/foo/batman}/jsfmt.spec.js (100%) rename tests/{ => flow}/include/included/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{incremental_mixed_naming_cycle => flow/include/included}/jsfmt.spec.js (100%) rename tests/{ => flow}/include/included/test.js (100%) rename tests/{ => flow}/incremental/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental/a.js (100%) rename tests/{ => flow}/incremental/b.js (100%) rename tests/{ => flow}/incremental/dup_a.js (100%) rename tests/{incremental_mixed_naming_cycle/tmp1 => flow/incremental}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_basic/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_basic/a.js (100%) rename tests/{ => flow}/incremental_basic/b.js (100%) rename tests/{ => flow}/incremental_basic/c.js (100%) rename tests/{incremental_non_flow_move => flow/incremental_basic}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_basic/tmp1/b.js (100%) rename tests/{incremental_path/dir => flow/incremental_basic/tmp1}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_basic/tmp2/a.js (100%) rename tests/{indexer => flow/incremental_basic/tmp2}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_basic/tmp3/b.js (100%) rename tests/{init => flow/incremental_basic/tmp3}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_cycle/A.js (100%) rename tests/{ => flow}/incremental_cycle/B.js (100%) rename tests/{ => flow}/incremental_cycle/C.js (100%) rename tests/{ => flow}/incremental_cycle/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{instanceof => flow/incremental_cycle}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_cycle/tmp1/B.js (100%) rename tests/{ => flow}/incremental_cycle/tmp1/C.js (100%) rename tests/{ => flow}/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{integration => flow/incremental_cycle/tmp1}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_cycle/tmp2/B.js (100%) rename tests/{ => flow}/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{intersection => flow/incremental_cycle/tmp2}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_cycle/tmp3/B.js (100%) rename tests/{ => flow}/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{intersection/lib => flow/incremental_cycle/tmp3}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_delete/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_delete/a.js (100%) rename tests/{ => flow}/incremental_delete/b.js (100%) rename tests/{ => flow}/incremental_delete/c.js (100%) rename tests/{ => flow}/incremental_delete/dupe1.js (100%) rename tests/{ => flow}/incremental_delete/dupe2.js (100%) rename tests/{issues-11 => flow/incremental_delete}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_delete/requires_dupe.js (100%) rename tests/{ => flow}/incremental_delete/requires_unchecked.js (100%) rename tests/{ => flow}/incremental_delete/unchecked.js (100%) rename tests/{ => flow}/incremental_duplicate_delete/A.js (100%) rename tests/{ => flow}/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{iter => flow/incremental_duplicate_delete}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_json/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{iterable => flow/incremental_json}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_json/test.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/a.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/b.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/c.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/d.js (100%) rename tests/{jsx_intrinsics.builtin => flow/incremental_mixed_naming_cycle}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/root.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{jsx_intrinsics.custom => flow/incremental_mixed_naming_cycle/tmp1}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_mixed_naming_cycle/tmp1/root.js (100%) rename tests/{ => flow}/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_non_flow_move/foo.js (100%) rename tests/{jsx_intrinsics.custom/lib => flow/incremental_non_flow_move}/jsfmt.spec.js (100%) rename tests/{ => flow}/incremental_non_flow_move/test.js (100%) rename tests/{ => flow}/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/incremental_path/dir/a.js (100%) rename tests/{keys => flow/incremental_path/dir}/jsfmt.spec.js (100%) rename tests/{ => flow}/indexer/A.js (100%) rename tests/{ => flow}/indexer/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{keyvalue => flow/indexer}/jsfmt.spec.js (100%) rename tests/{ => flow}/indexer/multiple.js (100%) rename tests/{ => flow}/init/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/init/hoisted.js (100%) rename tests/{ => flow}/init/hoisted2.js (100%) rename tests/{last_duplicate_property_wins => flow/init}/jsfmt.spec.js (100%) rename tests/{ => flow}/init/let.js (100%) rename tests/{ => flow}/init/nullable-init.js (100%) rename tests/{ => flow}/instanceof/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/instanceof/instanceof.js (100%) rename tests/{lib => flow/instanceof}/jsfmt.spec.js (100%) rename tests/{ => flow}/integration/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/integration/bar.js (100%) rename tests/{ => flow}/integration/foo.js (100%) rename tests/{lib_interfaces/declarations => flow/integration}/jsfmt.spec.js (100%) create mode 100644 tests/flow/interface/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/interface/import.js (100%) rename tests/{ => flow}/interface/indexer.js (100%) rename tests/{ => flow}/interface/interface.js (80%) rename tests/{libconfig => flow/interface}/jsfmt.spec.js (100%) rename tests/{ => flow}/interface/test.js (100%) rename tests/{ => flow}/interface/test2.js (100%) rename tests/{ => flow}/interface/test3.js (100%) rename tests/{ => flow}/interface/test4.js (100%) rename tests/{ => flow}/intersection/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/intersection/intersection.js (100%) rename tests/{libdef_ignored_module => flow/intersection}/jsfmt.spec.js (100%) rename tests/{ => flow}/intersection/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{libdef_ignored_module => flow/intersection}/lib/jsfmt.spec.js (100%) rename tests/{ => flow}/intersection/lib/lib.js (100%) rename tests/{ => flow}/intersection/objassign.js (100%) rename tests/{ => flow}/intersection/pred.js (100%) rename tests/{ => flow}/intersection/test_fun.js (100%) rename tests/{ => flow}/intersection/test_obj.js (100%) rename tests/{ => flow}/issues-11/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/issues-11/export.js (100%) rename tests/{ => flow}/issues-11/import.js (100%) rename tests/{liberr => flow/issues-11}/jsfmt.spec.js (100%) rename tests/{ => flow}/iter/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/iter/iter.js (100%) rename tests/{liberr/libs => flow/iter}/jsfmt.spec.js (100%) rename tests/{ => flow}/iterable/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/iterable/array.js (100%) rename tests/{ => flow}/iterable/caching_bug.js (100%) rename tests/{ => flow}/iterable/iter.js (100%) rename tests/{ => flow}/iterable/iterator_result.js (100%) rename tests/{libflow-typed/flow-typed => flow/iterable}/jsfmt.spec.js (100%) rename tests/{ => flow}/iterable/map.js (100%) rename tests/{ => flow}/iterable/set.js (100%) rename tests/{ => flow}/iterable/string.js (100%) rename tests/{ => flow}/iterable/variance.js (100%) rename tests/{ => flow}/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{libflow-typed => flow/jsx_intrinsics.builtin}/jsfmt.spec.js (100%) rename tests/{ => flow}/jsx_intrinsics.builtin/main.js (100%) rename tests/{ => flow}/jsx_intrinsics.builtin/strings.js (100%) rename tests/{ => flow}/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{librec => flow/jsx_intrinsics.custom}/jsfmt.spec.js (100%) rename tests/{ => flow}/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{librec/lib/A => flow/jsx_intrinsics.custom/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/jsx_intrinsics.custom/lib/jsx.js (100%) rename tests/{ => flow}/jsx_intrinsics.custom/main.js (100%) rename tests/{ => flow}/jsx_intrinsics.custom/strings.js (100%) rename tests/{ => flow}/keys/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{librec/lib/B => flow/keys}/jsfmt.spec.js (100%) rename tests/{ => flow}/keys/keys.js (100%) rename tests/{ => flow}/keyvalue/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{line-endings => flow/keyvalue}/jsfmt.spec.js (100%) rename tests/{ => flow}/keyvalue/keyvalue.js (100%) rename tests/{ => flow}/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{locals => flow/last_duplicate_property_wins}/jsfmt.spec.js (100%) rename tests/{ => flow}/last_duplicate_property_wins/test.js (100%) rename tests/{ => flow}/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{logical => flow/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/lib/libtest.js (100%) rename tests/{ => flow}/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{loners => flow/lib_interfaces/declarations}/jsfmt.spec.js (100%) rename tests/{ => flow}/lib_interfaces/declarations/underscore.js (100%) rename tests/{ => flow}/libconfig/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{method_properties => flow/libconfig}/jsfmt.spec.js (100%) rename tests/{ => flow}/libconfig/libA.js (100%) rename tests/{ => flow}/libconfig/libB.js (100%) rename tests/{ => flow}/libconfig/libtest.js (100%) rename tests/{ => flow}/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{misc => flow/libdef_ignored_module}/jsfmt.spec.js (100%) rename tests/{ => flow}/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/libdef_ignored_module/lib/foo.js (100%) rename tests/{missing_annotation => flow/libdef_ignored_module/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/libdef_ignored_module/test.js (100%) rename tests/{ => flow}/liberr/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/liberr/a.js (100%) rename tests/{modified_lib => flow/liberr}/jsfmt.spec.js (100%) rename tests/{ => flow}/liberr/libs/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{modified_lib/lib => flow/liberr/libs}/jsfmt.spec.js (100%) rename tests/{ => flow}/liberr/libs/type_error.js (100%) rename tests/{ => flow}/libflow-typed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/libflow-typed/flow-typed/dino.js (100%) rename tests/{module_not_found_errors/src => flow/libflow-typed/flow-typed}/jsfmt.spec.js (100%) rename tests/{module_redirect => flow/libflow-typed}/jsfmt.spec.js (100%) rename tests/{ => flow}/libflow-typed/libtest.js (100%) rename tests/{ => flow}/librec/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{module_use_strict => flow/librec}/jsfmt.spec.js (100%) rename tests/{ => flow}/librec/lib/A/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{modules => flow/librec/lib/A}/jsfmt.spec.js (100%) rename tests/{ => flow}/librec/lib/A/libA.js (100%) rename tests/{ => flow}/librec/lib/B/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{more_annot => flow/librec/lib/B}/jsfmt.spec.js (100%) rename tests/{ => flow}/librec/lib/B/libB.js (100%) rename tests/{ => flow}/librec/libtest.js (100%) create mode 100644 tests/flow/literal/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/literal/enum.js (100%) rename tests/{ => flow}/literal/enum_client.js (100%) rename tests/{more_classes => flow/literal}/jsfmt.spec.js (100%) create mode 100644 tests/flow/literal/number.js rename tests/{ => flow}/locals/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{more_generics => flow/locals}/jsfmt.spec.js (100%) rename tests/{ => flow}/locals/lex.js (100%) rename tests/{ => flow}/locals/locals.js (100%) rename tests/{ => flow}/logical/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{more_path => flow/logical}/jsfmt.spec.js (100%) rename tests/{ => flow}/logical/logical.js (100%) rename tests/{ => flow}/loners/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{more_react => flow/loners}/jsfmt.spec.js (100%) rename tests/{ => flow}/loners/loners.js (100%) rename tests/{ => flow}/method_properties/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/method_properties/exports_optional_prop.js (100%) rename tests/{more_statics => flow/method_properties}/jsfmt.spec.js (100%) rename tests/{ => flow}/method_properties/test.js (100%) rename tests/{ => flow}/misc/A.js (100%) rename tests/{ => flow}/misc/B.js (100%) rename tests/{ => flow}/misc/C.js (100%) rename tests/{ => flow}/misc/D.js (100%) rename tests/{ => flow}/misc/E.js (100%) rename tests/{ => flow}/misc/F.js (100%) rename tests/{ => flow}/misc/G.js (100%) rename tests/{ => flow}/misc/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{name_prop => flow/misc}/jsfmt.spec.js (100%) rename tests/{ => flow}/missing_annotation/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/missing_annotation/array.js (100%) rename tests/{ => flow}/missing_annotation/async_return.js (100%) rename tests/{ => flow}/missing_annotation/infer.js (100%) rename tests/{namespace => flow/missing_annotation}/jsfmt.spec.js (100%) rename tests/{ => flow}/modified_lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{new_react/fakelib => flow/modified_lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{new_react => flow/modified_lib/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/modified_lib/lib/lib.js (100%) rename tests/{ => flow}/modified_lib/test.js (100%) rename tests/{ => flow}/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/module_not_found_errors/src/index.js (100%) rename tests/{node_haste/external/_d3 => flow/module_not_found_errors/src}/jsfmt.spec.js (100%) rename tests/{ => flow}/module_redirect/A.js (100%) rename tests/{ => flow}/module_redirect/B.js (100%) rename tests/{ => flow}/module_redirect/C.js (100%) rename tests/{ => flow}/module_redirect/D.js (100%) rename tests/{ => flow}/module_redirect/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_haste/foo/bar => flow/module_redirect}/jsfmt.spec.js (100%) rename tests/{ => flow}/module_use_strict/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_haste => flow/module_use_strict}/jsfmt.spec.js (100%) rename tests/{ => flow}/module_use_strict/test.js (100%) rename tests/{ => flow}/modules/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/modules/cli.js (100%) rename tests/{ => flow}/modules/cli2.js (100%) rename tests/{node_haste/ws => flow/modules}/jsfmt.spec.js (100%) rename tests/{ => flow}/modules/lib.js (100%) rename tests/{ => flow}/more_annot/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/more_annot/client_object.js (100%) rename tests/{node_haste/ws/test => flow/more_annot}/jsfmt.spec.js (100%) rename tests/{ => flow}/more_annot/object.js (100%) rename tests/{ => flow}/more_annot/proto.js (100%) rename tests/{ => flow}/more_annot/super.js (100%) rename tests/{ => flow}/more_classes/Bar.js (100%) rename tests/{ => flow}/more_classes/Foo.js (100%) rename tests/{ => flow}/more_classes/Qux.js (100%) rename tests/{ => flow}/more_classes/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_modules_with_symlinks/root => flow/more_classes}/jsfmt.spec.js (100%) rename tests/{ => flow}/more_generics/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_modules_with_symlinks/root/symlink_lib => flow/more_generics}/jsfmt.spec.js (100%) rename tests/{ => flow}/more_generics/poly.js (100%) rename tests/{ => flow}/more_path/Condition.js (100%) rename tests/{ => flow}/more_path/FlowSA.js (100%) rename tests/{ => flow}/more_path/Sigma.js (100%) rename tests/{ => flow}/more_path/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_modules_with_symlinks/symlink_lib_outside_root => flow/more_path}/jsfmt.spec.js (100%) rename tests/{ => flow}/more_path/test.js (100%) rename tests/{ => flow}/more_react/API.react.js (100%) rename tests/{ => flow}/more_react/App.react.js (100%) rename tests/{ => flow}/more_react/JSX.js (100%) create mode 100644 tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap rename tests/{node_modules_without_json => flow/more_react}/jsfmt.spec.js (100%) rename tests/{ => flow}/more_react/propTypes.js (100%) rename tests/{ => flow}/more_statics/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/more_statics/class_static.js (100%) rename tests/{node_tests/assert => flow/more_statics}/jsfmt.spec.js (100%) rename tests/{ => flow}/name_prop/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/name_prop/class.js (100%) rename tests/{ => flow}/name_prop/function.js (100%) rename tests/{node_tests/basic => flow/name_prop}/jsfmt.spec.js (100%) rename tests/{ => flow}/namespace/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/namespace/client.js (100%) rename tests/{node_tests/basic_file => flow/namespace}/jsfmt.spec.js (100%) rename tests/{ => flow}/namespace/namespace.js (100%) rename tests/{ => flow}/new_react/FeedUFI.react.js (100%) rename tests/{ => flow}/new_react/Mixin.js (100%) rename tests/{ => flow}/new_react/UFILikeCount.react.js (100%) create mode 100644 tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/new_react/bad_default_props.js (100%) rename tests/{ => flow}/new_react/classes.js (100%) create mode 100644 tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap rename tests/{node_tests/basic_node_modules => flow/new_react/fakelib}/jsfmt.spec.js (100%) rename tests/{ => flow}/new_react/fakelib/type_aliases.js (100%) rename tests/{ => flow}/new_react/import-react.js (100%) rename tests/{node_tests/basic_node_modules_with_path => flow/new_react}/jsfmt.spec.js (100%) rename tests/{ => flow}/new_react/new_react.js (100%) rename tests/{ => flow}/new_react/propTypes.js (100%) rename tests/{ => flow}/new_react/props.js (100%) rename tests/{ => flow}/new_react/props2.js (100%) rename tests/{ => flow}/new_react/props3.js (100%) rename tests/{ => flow}/new_react/props4.js (100%) rename tests/{ => flow}/new_react/props5.js (100%) rename tests/{ => flow}/new_react/state.js (100%) rename tests/{ => flow}/new_react/state2.js (100%) rename tests/{ => flow}/new_react/state3.js (100%) rename tests/{ => flow}/new_react/state4.js (100%) rename tests/{ => flow}/new_react/state5.js (100%) rename tests/{ => flow}/node_haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_haste/client.js (100%) rename tests/{ => flow}/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_tests/basic_package/bar_lib => flow/node_haste/external/_d3}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_haste/external/_d3/min.js (100%) rename tests/{ => flow}/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_haste/foo/bar/client.js (100%) rename tests/{node_tests/basic_package => flow/node_haste/foo/bar}/jsfmt.spec.js (100%) rename tests/{node_tests/buffer => flow/node_haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_haste/md5.js (100%) rename tests/{ => flow}/node_haste/ws/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_haste/ws/index.js (100%) rename tests/{node_tests/child_process => flow/node_haste/ws}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_haste/ws/test/client.js (100%) rename tests/{node_tests/crypto => flow/node_haste/ws/test}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_modules_with_symlinks/root/foo.js (100%) rename tests/{node_tests/fs => flow/node_modules_with_symlinks/root}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_modules_with_symlinks/root/symlink_lib/index.js (100%) rename tests/{node_tests/json_file => flow/node_modules_with_symlinks/root/symlink_lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_modules_with_symlinks/symlink_lib_outside_root/index.js (100%) rename tests/{node_tests/json_file/package2 => flow/node_modules_with_symlinks/symlink_lib_outside_root}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{node_tests/os => flow/node_modules_without_json}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_modules_without_json/test.js (100%) rename tests/{ => flow}/node_tests/assert/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/assert/assert.js (100%) rename tests/{node_tests/package_file/bar_lib => flow/node_tests/assert}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic/bar.js (100%) rename tests/{ => flow}/node_tests/basic/foo.js (100%) rename tests/{node_tests/package_file => flow/node_tests/basic}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic_file/bar.js (100%) rename tests/{ => flow}/node_tests/basic_file/foo.js (100%) rename tests/{node_tests/package_file_node_modules/foo => flow/node_tests/basic_file}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic_node_modules/foo.js (100%) rename tests/{node_tests/path_node_modules => flow/node_tests/basic_node_modules}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic_node_modules_with_path/foo.js (100%) rename tests/{node_tests/path_node_modules_with_short_main => flow/node_tests/basic_node_modules_with_path}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/basic_package/bar_lib/bar.js (100%) rename tests/{node_tests/path_node_modules_without_main => flow/node_tests/basic_package/bar_lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/basic_package/foo.js (100%) rename tests/{node_tests/path_package => flow/node_tests/basic_package}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/buffer/buffer.js (100%) rename tests/{node_tests/stream => flow/node_tests/buffer}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/child_process/exec.js (100%) rename tests/{ => flow}/node_tests/child_process/execFile.js (100%) rename tests/{ => flow}/node_tests/child_process/execSync.js (100%) rename tests/{node_tests/timers => flow/node_tests/child_process}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/child_process/spawn.js (100%) rename tests/{ => flow}/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/crypto/crypto.js (100%) rename tests/{node_tests/url => flow/node_tests/crypto}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/fs/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/fs/fs.js (100%) rename tests/{nullable => flow/node_tests/fs}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{number_constants => flow/node_tests/json_file}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/json_file/package2/index.js (100%) rename tests/{object-method => flow/node_tests/json_file/package2}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/json_file/test.js (100%) rename tests/{ => flow}/node_tests/os/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{object_annot => flow/node_tests/os}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/os/userInfo.js (100%) rename tests/{ => flow}/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/package_file/bar_lib.js (100%) rename tests/{ => flow}/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/package_file/bar_lib/bar.js (100%) rename tests/{object_api => flow/node_tests/package_file/bar_lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/package_file/foo.js (100%) rename tests/{object_assign => flow/node_tests/package_file}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/package_file_node_modules/foo/foo.js (100%) rename tests/{object_freeze => flow/node_tests/package_file_node_modules/foo}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/path_node_modules/foo.js (100%) rename tests/{object_is => flow/node_tests/path_node_modules}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/path_node_modules_with_short_main/foo.js (100%) rename tests/{objmap => flow/node_tests/path_node_modules_with_short_main}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/path_node_modules_without_main/foo.js (100%) rename tests/{optional => flow/node_tests/path_node_modules_without_main}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/node_tests/path_package/foo.js (100%) rename tests/{optional_props => flow/node_tests/path_package}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/stream/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{overload => flow/node_tests/stream}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/stream/stream.js (100%) rename tests/{ => flow}/node_tests/timers/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{overload/lib => flow/node_tests/timers}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/timers/timers.js (100%) rename tests/{ => flow}/node_tests/url/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{parse => flow/node_tests/url}/jsfmt.spec.js (100%) rename tests/{ => flow}/node_tests/url/url.js (100%) rename tests/{ => flow}/nullable/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{parse_error_haste => flow/nullable}/jsfmt.spec.js (100%) rename tests/{ => flow}/nullable/maybe.js (100%) rename tests/{ => flow}/nullable/nullable.js (100%) rename tests/{ => flow}/nullable/simple_nullable.js (100%) rename tests/{ => flow}/number_constants/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{parse_error_node => flow/number_constants}/jsfmt.spec.js (100%) rename tests/{ => flow}/number_constants/number_constants.js (100%) rename tests/{ => flow}/object-method/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/object-method/id.js (100%) rename tests/{path => flow/object-method}/jsfmt.spec.js (100%) rename tests/{ => flow}/object-method/subtype.js (100%) rename tests/{ => flow}/object-method/test.js (100%) rename tests/{ => flow}/object-method/test2.js (100%) rename tests/{ => flow}/object-method/test3.js (100%) rename tests/{ => flow}/object_annot/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{plsummit => flow/object_annot}/jsfmt.spec.js (100%) rename tests/{ => flow}/object_annot/test.js (100%) rename tests/{ => flow}/object_api/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/object_api/a.js (100%) rename tests/{ => flow}/object_api/b.js (100%) rename tests/{ => flow}/object_api/c.js (100%) rename tests/{poly => flow/object_api}/jsfmt.spec.js (100%) rename tests/{ => flow}/object_api/object_assign.js (100%) rename tests/{ => flow}/object_api/object_create.js (100%) rename tests/{ => flow}/object_api/object_getprototypeof.js (100%) rename tests/{ => flow}/object_api/object_keys.js (100%) rename tests/{ => flow}/object_api/object_missing.js (100%) rename tests/{ => flow}/object_api/object_prototype.js (100%) rename tests/{ => flow}/object_assign/A.js (100%) rename tests/{ => flow}/object_assign/B.js (100%) rename tests/{ => flow}/object_assign/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/object_assign/apply.js (100%) rename tests/{poly_class_export => flow/object_assign}/jsfmt.spec.js (100%) rename tests/{ => flow}/object_assign/non_objects.js (100%) rename tests/{ => flow}/object_assign/undefined.js (100%) rename tests/{ => flow}/object_freeze/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{poly_overload/decls => flow/object_freeze}/jsfmt.spec.js (100%) rename tests/{ => flow}/object_freeze/object_freeze.js (100%) rename tests/{ => flow}/object_is/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{predicates-abstract => flow/object_is}/jsfmt.spec.js (100%) rename tests/{ => flow}/object_is/object_is.js (100%) create mode 100644 tests/flow/objects/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/objects/conversion.js (100%) rename tests/{predicates-declared => flow/objects}/jsfmt.spec.js (100%) rename tests/{ => flow}/objects/objects.js (100%) rename tests/{ => flow}/objects/unaliased_assign.js (100%) rename tests/{ => flow}/objmap/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{predicates-inferred => flow/objmap}/jsfmt.spec.js (100%) rename tests/{ => flow}/objmap/objmap.js (100%) rename tests/{ => flow}/optional/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/optional/client_optional.js (100%) rename tests/{ => flow}/optional/default.js (100%) rename tests/{ => flow}/optional/generic.js (100%) rename tests/{predicates-parsing => flow/optional}/jsfmt.spec.js (100%) rename tests/{ => flow}/optional/maybe.js (100%) rename tests/{ => flow}/optional/nullable.js (100%) rename tests/{ => flow}/optional/optional.js (100%) rename tests/{ => flow}/optional/optional_param.js (100%) rename tests/{ => flow}/optional/optional_param2.js (100%) rename tests/{ => flow}/optional/optional_param3.js (100%) rename tests/{ => flow}/optional/optional_param4.js (100%) rename tests/{ => flow}/optional/undefined.js (100%) rename tests/{ => flow}/optional/undefined2.js (100%) rename tests/{ => flow}/optional_props/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{prettier => flow/optional_props}/jsfmt.spec.js (100%) rename tests/{ => flow}/optional_props/test.js (100%) rename tests/{ => flow}/optional_props/test2.js (100%) rename tests/{ => flow}/optional_props/test3.js (100%) rename tests/{ => flow}/optional_props/test3_failure.js (100%) rename tests/{ => flow}/overload/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{private => flow/overload}/jsfmt.spec.js (100%) rename tests/{ => flow}/overload/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{promises => flow/overload/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/overload/lib/lib.js (100%) rename tests/{ => flow}/overload/overload.js (100%) rename tests/{ => flow}/overload/test.js (100%) rename tests/{ => flow}/overload/test2.js (100%) rename tests/{ => flow}/overload/test3.js (100%) rename tests/{ => flow}/overload/union.js (100%) rename tests/{ => flow}/parse/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{pure_component => flow/parse}/jsfmt.spec.js (100%) rename tests/{ => flow}/parse/no_parse_error.js (100%) rename tests/{ => flow}/parse_error_haste/Client.js (100%) rename tests/{ => flow}/parse_error_haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{qualified => flow/parse_error_haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/parse_error_node/Client.js (100%) rename tests/{ => flow}/parse_error_node/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{react => flow/parse_error_node}/jsfmt.spec.js (100%) rename tests/{ => flow}/path/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{react_functional => flow/path}/jsfmt.spec.js (100%) rename tests/{ => flow}/path/while.js (100%) rename tests/{ => flow}/plsummit/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/plsummit/arrays.js (100%) rename tests/{ => flow}/plsummit/export_class.js (100%) rename tests/{ => flow}/plsummit/generics.js (100%) rename tests/{ => flow}/plsummit/import_class.js (100%) rename tests/{react_modules => flow/plsummit}/jsfmt.spec.js (100%) rename tests/{ => flow}/plsummit/locals.js (100%) rename tests/{ => flow}/plsummit/objects.js (100%) rename tests/{ => flow}/poly/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/poly/annot.js (100%) rename tests/{ => flow}/poly/implicit_bounded_instantiation.js (100%) rename tests/{ => flow}/poly/issue-1029.js (100%) rename tests/{rec => flow/poly}/jsfmt.spec.js (100%) rename tests/{ => flow}/poly/poly.js (100%) rename tests/{ => flow}/poly/test.js (100%) rename tests/{ => flow}/poly_class_export/A.js (100%) rename tests/{ => flow}/poly_class_export/B.js (100%) rename tests/{ => flow}/poly_class_export/C.js (100%) rename tests/{ => flow}/poly_class_export/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck-haste => flow/poly_class_export}/jsfmt.spec.js (100%) rename tests/{ => flow}/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck-haste/tmp1A => flow/poly_overload/decls}/jsfmt.spec.js (100%) rename tests/{ => flow}/poly_overload/decls/typescript-deferred.js (100%) rename tests/{ => flow}/predicates-abstract/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/predicates-abstract/filter-union.js (100%) rename tests/{ => flow}/predicates-abstract/filter.js (100%) rename tests/{recheck-haste/tmp2A => flow/predicates-abstract}/jsfmt.spec.js (100%) rename tests/{ => flow}/predicates-abstract/refine.js (100%) rename tests/{ => flow}/predicates-abstract/sanity-filter-union.js (100%) rename tests/{ => flow}/predicates-abstract/sanity-filter.js (100%) rename tests/{ => flow}/predicates-abstract/sanity-refine.js (100%) rename tests/{ => flow}/predicates-declared/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/predicates-declared/function-bind.js (100%) rename tests/{ => flow}/predicates-declared/function-union.js (100%) rename tests/{ => flow}/predicates-declared/is-string-decl.js (100%) rename tests/{recheck => flow/predicates-declared}/jsfmt.spec.js (100%) rename tests/{ => flow}/predicates-declared/logical-or.js (100%) rename tests/{ => flow}/predicates-declared/object-invariant.js (100%) rename tests/{ => flow}/predicates-declared/orig-string-tag-check.js (100%) rename tests/{ => flow}/predicates-declared/sanity-fall-through.js (100%) rename tests/{ => flow}/predicates-declared/sanity-invalid-calls.js (100%) rename tests/{ => flow}/predicates-declared/sanity-is-string-bug.js (100%) rename tests/{ => flow}/predicates-declared/sanity-parameter-mismatch.js (100%) rename tests/{ => flow}/predicates-declared/sanity-pred-with-body.js (100%) rename tests/{ => flow}/predicates-declared/sanity-return-type.js (100%) rename tests/{ => flow}/predicates-inferred/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp1a => flow/predicates-inferred}/jsfmt.spec.js (100%) rename tests/{ => flow}/predicates-inferred/sanity-multi-params.js (100%) rename tests/{ => flow}/predicates-inferred/sanity-ordering.js (100%) rename tests/{ => flow}/predicates-inferred/sanity-unbound-var.js (100%) rename tests/{ => flow}/predicates-inferred/sanity.js (100%) rename tests/{ => flow}/predicates-inferred/simple-predicate-func-post.js (100%) rename tests/{ => flow}/predicates-inferred/simple-predicate-func.js (100%) rename tests/{ => flow}/predicates-parsing/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/predicates-parsing/fail-0.js (100%) rename tests/{ => flow}/predicates-parsing/fail-1.js (100%) rename tests/{ => flow}/predicates-parsing/fail-2.js (100%) rename tests/{ => flow}/predicates-parsing/fail-3.js (100%) rename tests/{recheck/tmp1b => flow/predicates-parsing}/jsfmt.spec.js (100%) rename tests/{ => flow}/predicates-parsing/pass.js (100%) rename tests/{ => flow}/private/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp1c => flow/private}/jsfmt.spec.js (100%) rename tests/{ => flow}/private/private.js (100%) rename tests/{ => flow}/promises/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/promises/all.js (100%) rename tests/{ => flow}/promises/covariance.js (100%) rename tests/{recheck/tmp1d => flow/promises}/jsfmt.spec.js (100%) rename tests/{ => flow}/promises/promise.js (100%) rename tests/{ => flow}/promises/resolve_global.js (100%) rename tests/{ => flow}/promises/resolve_void.js (100%) rename tests/{ => flow}/pure_component/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp1e => flow/pure_component}/jsfmt.spec.js (100%) rename tests/{ => flow}/pure_component/test.js (100%) rename tests/{ => flow}/qualified/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp1f => flow/qualified}/jsfmt.spec.js (100%) rename tests/{ => flow}/qualified/qualified.js (100%) rename tests/{ => flow}/react/ArityError.react.js (100%) rename tests/{ => flow}/react/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/react/createElementRequiredProp_string.js (100%) rename tests/{ => flow}/react/createElement_string.js (100%) rename tests/{ => flow}/react/import_react.js (100%) rename tests/{recheck/tmp1g => flow/react}/jsfmt.spec.js (100%) rename tests/{ => flow}/react/jsx_spread.js (100%) rename tests/{ => flow}/react/proptype_arrayOf.js (100%) rename tests/{ => flow}/react/proptype_func.js (100%) rename tests/{ => flow}/react/proptype_missing.js (100%) rename tests/{ => flow}/react/proptype_object.js (100%) rename tests/{ => flow}/react/proptype_objectOf.js (100%) rename tests/{ => flow}/react/proptype_oneOf.js (100%) rename tests/{ => flow}/react/proptype_oneOfType.js (100%) rename tests/{ => flow}/react_functional/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp1h => flow/react_functional}/jsfmt.spec.js (100%) rename tests/{ => flow}/react_functional/test.js (100%) rename tests/{ => flow}/react_modules/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/react_modules/createclass-callsite.js (100%) rename tests/{ => flow}/react_modules/createclass-module.js (100%) rename tests/{ => flow}/react_modules/es6class-types-callsite.js (100%) rename tests/{ => flow}/react_modules/es6class-types-module.js (100%) rename tests/{recheck/tmp2a => flow/react_modules}/jsfmt.spec.js (100%) rename tests/{ => flow}/rec/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/rec/issue-1228.js (100%) rename tests/{ => flow}/rec/issue-598.js (100%) rename tests/{recheck/tmp2b => flow/rec}/jsfmt.spec.js (100%) rename tests/{ => flow}/rec/test.js (100%) rename tests/{ => flow}/rec/test2.js (100%) rename tests/{ => flow}/rec/test3.js (100%) rename tests/{ => flow}/rec/test4.js (100%) rename tests/{ => flow}/rec/test5.js (100%) rename tests/{ => flow}/recheck-haste/A1.js (100%) rename tests/{ => flow}/recheck-haste/A3.js (100%) rename tests/{ => flow}/recheck-haste/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp2c => flow/recheck-haste}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck-haste/tmp1A/A2.js (100%) rename tests/{ => flow}/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp2e => flow/recheck-haste/tmp1A}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck-haste/tmp2A/A3.js (100%) rename tests/{ => flow}/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{recheck/tmp2f => flow/recheck-haste/tmp2A}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/a1.js (100%) rename tests/{ => flow}/recheck/a2.js (100%) rename tests/{ => flow}/recheck/a3.js (100%) rename tests/{ => flow}/recheck/b0.js (100%) rename tests/{ => flow}/recheck/b1.js (100%) rename tests/{ => flow}/recheck/b2.js (100%) rename tests/{ => flow}/recheck/b3.js (100%) rename tests/{ => flow}/recheck/c1.js (100%) rename tests/{ => flow}/recheck/c2.js (100%) rename tests/{ => flow}/recheck/c3.js (100%) rename tests/{ => flow}/recheck/d1.js (100%) rename tests/{ => flow}/recheck/d2.js (100%) rename tests/{ => flow}/recheck/e1.js (100%) rename tests/{ => flow}/recheck/e2.js (100%) rename tests/{ => flow}/recheck/f1.js (100%) rename tests/{ => flow}/recheck/f2.js (100%) rename tests/{ => flow}/recheck/g1.js (100%) rename tests/{ => flow}/recheck/g2.js (100%) rename tests/{ => flow}/recheck/g3.js (100%) rename tests/{ => flow}/recheck/h1.js (100%) rename tests/{ => flow}/recheck/h2.js (100%) rename tests/{recheck/tmp3e => flow/recheck}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1a/a1.js (100%) rename tests/{recheck/tmp3f => flow/recheck/tmp1a}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1b/b1.js (100%) rename tests/{recheck/tmp4f => flow/recheck/tmp1b}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1c/c2.js (100%) rename tests/{record => flow/recheck/tmp1c}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1d/d1.js (100%) rename tests/{refi => flow/recheck/tmp1d}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1e/e2.js (100%) rename tests/{refinements => flow/recheck/tmp1e}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1f/f1.js (100%) rename tests/{reflection => flow/recheck/tmp1f}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1g/g1.js (100%) rename tests/{regexp => flow/recheck/tmp1g}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp1h/h1.js (100%) rename tests/{replace => flow/recheck/tmp1h}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp2a/a1.js (100%) rename tests/{require => flow/recheck/tmp2a}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp2b/b0.js (100%) rename tests/{requireLazy => flow/recheck/tmp2b}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp2c/c1.js (100%) rename tests/{return => flow/recheck/tmp2c}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp2e/e1.js (100%) rename tests/{return_new => flow/recheck/tmp2e}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp2f/f1.js (100%) rename tests/{seal => flow/recheck/tmp2f}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp3e/e1.js (100%) rename tests/{ => flow}/recheck/tmp3e/e2.js (100%) rename tests/{sealed => flow/recheck/tmp3e}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp3f/f1.js (100%) rename tests/{sealed_objects => flow/recheck/tmp3f}/jsfmt.spec.js (100%) rename tests/{ => flow}/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/recheck/tmp4f/f1.js (100%) rename tests/{shape => flow/recheck/tmp4f}/jsfmt.spec.js (100%) rename tests/{ => flow}/record/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{simple_arrays => flow/record}/jsfmt.spec.js (100%) rename tests/{ => flow}/record/test.js (100%) rename tests/{ => flow}/refi/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/refi/bound.js (100%) rename tests/{ => flow}/refi/heap.js (100%) rename tests/{singleton => flow/refi}/jsfmt.spec.js (100%) rename tests/{ => flow}/refi/lex.js (100%) rename tests/{ => flow}/refi/local.js (100%) rename tests/{ => flow}/refi/null_tests.js (100%) rename tests/{ => flow}/refi/switch.js (100%) rename tests/{ => flow}/refi/typeof_tests.js (100%) rename tests/{ => flow}/refi/undef_tests.js (100%) rename tests/{ => flow}/refi/void_tests.js (100%) rename tests/{ => flow}/refinements/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/refinements/assignment.js (100%) rename tests/{ => flow}/refinements/ast_node.js (100%) rename tests/{ => flow}/refinements/bool.js (100%) rename tests/{ => flow}/refinements/computed_string_literal.js (100%) rename tests/{ => flow}/refinements/cond_prop.js (100%) rename tests/{ => flow}/refinements/constants.js (100%) rename tests/{ => flow}/refinements/eq.js (100%) rename tests/{ => flow}/refinements/exists.js (100%) rename tests/{ => flow}/refinements/func_call.js (100%) rename tests/{ => flow}/refinements/hasOwnProperty.js (100%) rename tests/{ => flow}/refinements/heap_defassign.js (100%) rename tests/{spread => flow/refinements}/jsfmt.spec.js (100%) rename tests/{ => flow}/refinements/lib.js (100%) rename tests/{ => flow}/refinements/missing-property-cond.js (100%) rename tests/{ => flow}/refinements/mixed.js (100%) rename tests/{ => flow}/refinements/node1.js (100%) rename tests/{ => flow}/refinements/not.js (100%) rename tests/{ => flow}/refinements/null.js (100%) rename tests/{ => flow}/refinements/number.js (100%) rename tests/{ => flow}/refinements/property.js (100%) rename tests/{ => flow}/refinements/refinements.js (100%) rename tests/{ => flow}/refinements/string.js (100%) rename tests/{ => flow}/refinements/super_member.js (100%) rename tests/{ => flow}/refinements/switch.js (100%) rename tests/{ => flow}/refinements/tagged_union.js (100%) rename tests/{ => flow}/refinements/tagged_union_import.js (100%) rename tests/{ => flow}/refinements/typeof.js (100%) rename tests/{ => flow}/refinements/undef.js (100%) rename tests/{ => flow}/refinements/union.js (100%) rename tests/{ => flow}/refinements/void.js (100%) rename tests/{ => flow}/reflection/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{static_overload => flow/reflection}/jsfmt.spec.js (100%) rename tests/{ => flow}/reflection/type.js (100%) rename tests/{ => flow}/regexp/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{static_overload/lib => flow/regexp}/jsfmt.spec.js (100%) rename tests/{ => flow}/regexp/regexp.js (100%) rename tests/{ => flow}/replace/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{statics => flow/replace}/jsfmt.spec.js (100%) rename tests/{ => flow}/replace/test.js (100%) rename tests/{ => flow}/require/B.js (100%) rename tests/{ => flow}/require/C.js (100%) rename tests/{ => flow}/require/E.js (100%) rename tests/{ => flow}/require/ProvidesModuleA.js (100%) rename tests/{ => flow}/require/ProvidesModuleD.js (100%) rename tests/{ => flow}/require/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{strict => flow/require}/jsfmt.spec.js (100%) rename tests/{ => flow}/require/not_builtin_require.js (100%) rename tests/{ => flow}/require/not_builtin_require2.js (100%) rename tests/{ => flow}/require/require.js (100%) rename tests/{ => flow}/requireLazy/A.js (100%) rename tests/{ => flow}/requireLazy/B.js (100%) rename tests/{ => flow}/requireLazy/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{strict_requires => flow/requireLazy}/jsfmt.spec.js (100%) rename tests/{ => flow}/requireLazy/requireLazy.js (100%) rename tests/{ => flow}/return/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/return/function_return.js (100%) rename tests/{structural_subtyping => flow/return}/jsfmt.spec.js (100%) rename tests/{ => flow}/return/void.js (100%) rename tests/{ => flow}/return_new/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{suggest => flow/return_new}/jsfmt.spec.js (100%) rename tests/{ => flow}/return_new/test.js (100%) rename tests/{ => flow}/return_new/test2.js (100%) rename tests/{ => flow}/seal/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/seal/imp.js (100%) rename tests/{super => flow/seal}/jsfmt.spec.js (100%) rename tests/{ => flow}/seal/obj_annot.js (100%) rename tests/{ => flow}/sealed/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/sealed/function.js (100%) rename tests/{suppress => flow/sealed}/jsfmt.spec.js (100%) rename tests/{ => flow}/sealed/proto.js (100%) rename tests/{ => flow}/sealed/sealed.js (100%) rename tests/{ => flow}/sealed_objects/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{suppress_incremental => flow/sealed_objects}/jsfmt.spec.js (100%) rename tests/{ => flow}/sealed_objects/test.js (100%) rename tests/{ => flow}/shape/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{suppress_traces => flow/shape}/jsfmt.spec.js (100%) rename tests/{ => flow}/shape/test.js (100%) rename tests/{ => flow}/simple_arrays/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/simple_arrays/array.js (100%) rename tests/{ => flow}/simple_arrays/array2.js (100%) rename tests/{symbol => flow/simple_arrays}/jsfmt.spec.js (100%) rename tests/{ => flow}/singleton/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/singleton/boolean.js (100%) rename tests/{symlink => flow/singleton}/jsfmt.spec.js (100%) rename tests/{ => flow}/singleton/number.js (100%) rename tests/{ => flow}/singleton/string.js (100%) rename tests/{ => flow}/spread/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{tagged-unions => flow/spread}/jsfmt.spec.js (100%) rename tests/{ => flow}/spread/test.js (100%) rename tests/{ => flow}/spread/test2.js (100%) rename tests/{ => flow}/spread/test3.js (100%) rename tests/{ => flow}/spread/test4.js (100%) rename tests/{ => flow}/spread/test5.js (100%) rename tests/{ => flow}/spread/test6.js (100%) rename tests/{ => flow}/spread/test7.js (100%) rename tests/{ => flow}/static_overload/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{taint => flow/static_overload}/jsfmt.spec.js (100%) rename tests/{ => flow}/static_overload/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{this => flow/static_overload/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/static_overload/lib/lib.js (100%) rename tests/{ => flow}/static_overload/test.js (100%) rename tests/{ => flow}/statics/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/statics/class_statics.js (100%) rename tests/{ => flow}/statics/funstatics.js (100%) rename tests/{this_ctor => flow/statics}/jsfmt.spec.js (100%) rename tests/{ => flow}/strict/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/strict/annot.js (100%) rename tests/{ => flow}/strict/fun.js (100%) rename tests/{this_type => flow/strict}/jsfmt.spec.js (100%) rename tests/{ => flow}/strict/obj.js (100%) rename tests/{ => flow}/strict_requires/A.js (100%) rename tests/{ => flow}/strict_requires/B.js (100%) rename tests/{ => flow}/strict_requires/C.js (100%) rename tests/{ => flow}/strict_requires/D.js (100%) rename tests/{ => flow}/strict_requires/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{this_type/lib => flow/strict_requires}/jsfmt.spec.js (100%) rename tests/{ => flow}/structural_subtyping/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/structural_subtyping/builtin.js (100%) rename tests/{ => flow}/structural_subtyping/class.js (100%) rename tests/{throw => flow/structural_subtyping}/jsfmt.spec.js (100%) rename tests/{ => flow}/structural_subtyping/obj.js (100%) rename tests/{ => flow}/structural_subtyping/optional.js (100%) rename tests/{ => flow}/suggest/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{traces => flow/suggest}/jsfmt.spec.js (100%) rename tests/{ => flow}/suggest/lib.js (100%) rename tests/{ => flow}/suggest/suggest.js (100%) rename tests/{ => flow}/super/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/super/constructor.js (100%) rename tests/{ => flow}/super/import.js (100%) rename tests/{traits => flow/super}/jsfmt.spec.js (100%) rename tests/{ => flow}/super/super.js (100%) rename tests/{ => flow}/super/test.js (100%) rename tests/{ => flow}/suppress/A.js (100%) rename tests/{ => flow}/suppress/B.js (100%) rename tests/{ => flow}/suppress/C.js (100%) rename tests/{ => flow}/suppress/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{try => flow/suppress}/jsfmt.spec.js (100%) rename tests/{ => flow}/suppress/lib.js (100%) rename tests/{ => flow}/suppress_incremental/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{tuples => flow/suppress_incremental}/jsfmt.spec.js (100%) rename tests/{ => flow}/suppress_incremental/test.js (100%) rename tests/{ => flow}/suppress_traces/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{type-at-pos => flow/suppress_traces}/jsfmt.spec.js (100%) rename tests/{ => flow}/suppress_traces/traces.js (100%) create mode 100644 tests/flow/switch/__snapshots__/jsfmt.spec.js.snap rename tests/{type-destructors => flow/switch}/jsfmt.spec.js (100%) rename tests/{ => flow}/switch/more_switch.js (100%) rename tests/{ => flow}/switch/switch.js (100%) rename tests/{ => flow}/switch/switch_default_fallthrough.js (100%) rename tests/{ => flow}/switch/trailing_cases.js (100%) rename tests/{ => flow}/symbol/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{type-printer => flow/symbol}/jsfmt.spec.js (100%) rename tests/{ => flow}/symbol/symbol.js (100%) rename tests/{ => flow}/symlink/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/symlink/bar.js (100%) rename tests/{ => flow}/symlink/foo.js (100%) rename tests/{type_args_nonstrict => flow/symlink}/jsfmt.spec.js (100%) rename tests/{ => flow}/symlink/qux.js (100%) rename tests/{ => flow}/tagged-unions/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/tagged-unions/classes.js (100%) rename tests/{ => flow}/tagged-unions/interfaces-neg.js (100%) rename tests/{ => flow}/tagged-unions/interfaces-pos.js (100%) rename tests/{type_args_strict => flow/tagged-unions}/jsfmt.spec.js (100%) rename tests/{ => flow}/tagged-unions/type-decls-neg.js (100%) rename tests/{ => flow}/tagged-unions/type-decls-pos.js (100%) rename tests/{ => flow}/taint/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/taint/adder.js (100%) rename tests/{ => flow}/taint/any_object.js (100%) rename tests/{ => flow}/taint/call-object-property.js (100%) rename tests/{ => flow}/taint/comparator.js (100%) rename tests/{ => flow}/taint/function.js (100%) rename tests/{ => flow}/taint/globals.js (100%) rename tests/{type_only_vars => flow/taint}/jsfmt.spec.js (100%) rename tests/{ => flow}/taint/lib.js (100%) rename tests/{ => flow}/taint/taint1.js (100%) rename tests/{ => flow}/taint/taint2.js (100%) rename tests/{ => flow}/taint/taint3.js (100%) rename tests/{ => flow}/taint/taint4.js (100%) rename tests/{ => flow}/taint/use-types.js (100%) create mode 100644 tests/flow/template/__snapshots__/jsfmt.spec.js.snap rename tests/{type_param_defaults => flow/template}/jsfmt.spec.js (100%) rename tests/{ => flow}/template/template.js (100%) rename tests/{ => flow}/this/This.js (100%) rename tests/{ => flow}/this/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/this/arrows.js (100%) rename tests/{type_param_scope => flow/this}/jsfmt.spec.js (100%) rename tests/{ => flow}/this_ctor/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{type_param_variance => flow/this_ctor}/jsfmt.spec.js (100%) rename tests/{ => flow}/this_ctor/test.js (100%) rename tests/{ => flow}/this_type/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/this_type/class_expr.js (100%) rename tests/{ => flow}/this_type/contra.js (100%) rename tests/{ => flow}/this_type/export.js (100%) rename tests/{ => flow}/this_type/generics.js (100%) rename tests/{ => flow}/this_type/import.js (100%) rename tests/{ => flow}/this_type/interface.js (100%) rename tests/{type_param_variance2 => flow/this_type}/jsfmt.spec.js (100%) rename tests/{ => flow}/this_type/lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/this_type/lib/decl.js (100%) rename tests/{type_param_variance2/libs => flow/this_type/lib}/jsfmt.spec.js (100%) rename tests/{ => flow}/this_type/lib_client.js (100%) rename tests/{ => flow}/this_type/self.js (100%) rename tests/{ => flow}/this_type/statics.js (100%) rename tests/{ => flow}/this_type/test.js (100%) rename tests/{ => flow}/throw/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{typeapp_perf => flow/throw}/jsfmt.spec.js (100%) rename tests/{ => flow}/throw/test.js (100%) rename tests/{ => flow}/traces/Traces.js (100%) rename tests/{ => flow}/traces/Traces2.js (100%) rename tests/{ => flow}/traces/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{typecast => flow/traces}/jsfmt.spec.js (100%) rename tests/{ => flow}/traits/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{typeof => flow/traits}/jsfmt.spec.js (100%) rename tests/{ => flow}/traits/test.js (100%) rename tests/{ => flow}/traits/test2.js (100%) rename tests/{ => flow}/try/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/try/abnormals.js (100%) rename tests/{ => flow}/try/init.js (100%) rename tests/{unchecked_haste_module_vs_lib => flow/try}/jsfmt.spec.js (100%) rename tests/{ => flow}/try/return.js (100%) rename tests/{ => flow}/try/test.js (100%) rename tests/{ => flow}/tuples/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/tuples/array.js (100%) rename tests/{unchecked_node_module_vs_lib => flow/tuples}/jsfmt.spec.js (100%) rename tests/{ => flow}/tuples/optional.js (100%) rename tests/{ => flow}/tuples/too-few.js (100%) rename tests/{ => flow}/tuples/tuples.js (100%) rename tests/{ => flow}/type-at-pos/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/type-at-pos/destructuring.js (100%) rename tests/{ => flow}/type-at-pos/function_expressions.js (100%) rename tests/{ => flow}/type-at-pos/generics.js (100%) rename tests/{ => flow}/type-at-pos/import.js (100%) rename tests/{undefined => flow/type-at-pos}/jsfmt.spec.js (100%) rename tests/{ => flow}/type-at-pos/object_special_cases.js (100%) rename tests/{ => flow}/type-at-pos/optional.js (100%) rename tests/{ => flow}/type-at-pos/predicates.js (100%) rename tests/{ => flow}/type-at-pos/react.js (100%) rename tests/{ => flow}/type-at-pos/templates.js (100%) rename tests/{ => flow}/type-at-pos/test.js (100%) rename tests/{ => flow}/type-at-pos/trycatch.js (100%) rename tests/{ => flow}/type-destructors/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{union-intersection => flow/type-destructors}/jsfmt.spec.js (100%) rename tests/{ => flow}/type-destructors/non_maybe_type.js (100%) rename tests/{ => flow}/type-destructors/property_type.js (100%) rename tests/{ => flow}/type-destructors/union.js (100%) rename tests/{ => flow}/type-printer/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{union => flow/type-printer}/jsfmt.spec.js (100%) rename tests/{ => flow}/type-printer/printBinaryExpression.js (100%) rename tests/{ => flow}/type-printer/types.js (100%) rename tests/{ => flow}/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{union_new => flow/type_args_nonstrict}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_args_nonstrict/test.js (100%) rename tests/{ => flow}/type_args_strict/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{union_new/lib => flow/type_args_strict}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_args_strict/test.js (100%) rename tests/{ => flow}/type_only_vars/A.js (100%) rename tests/{ => flow}/type_only_vars/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/type_only_vars/bad_shadowing.js (100%) rename tests/{ => flow}/type_only_vars/good_shadowing.js (100%) rename tests/{ => flow}/type_only_vars/import_type.js (100%) rename tests/{unreachable => flow/type_only_vars}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_only_vars/type_alias.js (100%) rename tests/{ => flow}/type_param_defaults/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/type_param_defaults/classes.js (100%) rename tests/{urnary_expression => flow/type_param_defaults}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_param_scope/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/type_param_scope/class.js (100%) rename tests/{ => flow}/type_param_scope/default_params.js (100%) rename tests/{value => flow/type_param_scope}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_param_scope/method_shadow.js (100%) rename tests/{ => flow}/type_param_variance/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{vim_emacs_errors => flow/type_param_variance}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_param_variance/promise.js (100%) rename tests/{ => flow}/type_param_variance2/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{weakmode => flow/type_param_variance2}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_param_variance2/libs/Promise.js (100%) rename tests/{ => flow}/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{window => flow/type_param_variance2/libs}/jsfmt.spec.js (100%) rename tests/{ => flow}/type_param_variance2/promise.js (100%) rename tests/{ => flow}/typeapp_perf/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{x => flow/typeapp_perf}/jsfmt.spec.js (100%) rename tests/{ => flow}/typeapp_perf/test1.js (100%) rename tests/{ => flow}/typeapp_perf/test2.js (100%) rename tests/{ => flow}/typecast/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/typecast/jsfmt.spec.js rename tests/{ => flow}/typecast/typecast.js (100%) rename tests/{ => flow}/typeof/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/typeof/jsfmt.spec.js rename tests/{ => flow}/typeof/typeof.js (100%) create mode 100644 tests/flow/unary/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/flow/unary/jsfmt.spec.js rename tests/{ => flow}/unary/unary.js (100%) rename tests/{ => flow}/unary/update.js (100%) rename tests/{ => flow}/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/unchecked_haste_module_vs_lib/buffer.js (100%) create mode 100644 tests/flow/unchecked_haste_module_vs_lib/jsfmt.spec.js rename tests/{ => flow}/unchecked_haste_module_vs_lib/test.js (100%) rename tests/{ => flow}/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/unchecked_node_module_vs_lib/jsfmt.spec.js rename tests/{ => flow}/unchecked_node_module_vs_lib/test.js (100%) rename tests/{ => flow}/undefined/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/undefined/issue-518.js (100%) create mode 100644 tests/flow/undefined/jsfmt.spec.js rename tests/{ => flow}/undefined/undefined.js (100%) rename tests/{ => flow}/undefined/undefined2.js (100%) rename tests/{ => flow}/unicode/UnicodeUtils.js (100%) create mode 100644 tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/flow/unicode/jsfmt.spec.js create mode 100644 tests/flow/unicode/keys.js rename tests/{ => flow}/union-intersection/__snapshots__/jsfmt.spec.js.snap (97%) rename tests/{ => flow}/union-intersection/gen_big_disjoint_union.js (100%) create mode 100644 tests/flow/union-intersection/jsfmt.spec.js create mode 100644 tests/flow/union-intersection/test.js rename tests/{ => flow}/union/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/union/fields.js (100%) rename tests/{ => flow}/union/fields2.js (100%) rename tests/{ => flow}/union/issue-17.js (100%) rename tests/{ => flow}/union/issue-198.js (100%) rename tests/{ => flow}/union/issue-256.js (100%) rename tests/{ => flow}/union/issue-323-lib.js (100%) rename tests/{ => flow}/union/issue-323.js (100%) rename tests/{ => flow}/union/issue-324.js (100%) rename tests/{ => flow}/union/issue-325.js (100%) rename tests/{ => flow}/union/issue-326.js (100%) rename tests/{ => flow}/union/issue-582.js (100%) rename tests/{ => flow}/union/issue-963.js (100%) create mode 100644 tests/flow/union/jsfmt.spec.js rename tests/{ => flow}/union/test-lib.js (100%) rename tests/{ => flow}/union/test.js (100%) rename tests/{ => flow}/union/type-app.js (100%) rename tests/{ => flow}/union/union.js (100%) rename tests/{ => flow}/union/yuge.js (100%) rename tests/{ => flow}/union_new/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{ => flow}/union_new/issue-1349.js (100%) rename tests/{ => flow}/union_new/issue-1371.js (100%) rename tests/{ => flow}/union_new/issue-1455-helper.js (100%) rename tests/{ => flow}/union_new/issue-1455.js (100%) rename tests/{ => flow}/union_new/issue-1462-i.js (100%) rename tests/{ => flow}/union_new/issue-1462-ii.js (100%) rename tests/{ => flow}/union_new/issue-1664.js (100%) rename tests/{ => flow}/union_new/issue-1759.js (100%) rename tests/{ => flow}/union_new/issue-2232.js (100%) rename tests/{ => flow}/union_new/issue-815.js (100%) rename tests/{ => flow}/union_new/issue-824-helper.js (100%) rename tests/{ => flow}/union_new/issue-824.js (100%) create mode 100644 tests/flow/union_new/jsfmt.spec.js rename tests/{ => flow}/union_new/lib/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/union_new/lib/jsfmt.spec.js rename tests/{ => flow}/union_new/lib/test23_lib.js (100%) rename tests/{ => flow}/union_new/lib/test25_lib.js (100%) rename tests/{ => flow}/union_new/lib/test32_lib.js (100%) rename tests/{ => flow}/union_new/test1.js (100%) rename tests/{ => flow}/union_new/test10.js (100%) rename tests/{ => flow}/union_new/test11.js (100%) rename tests/{ => flow}/union_new/test12.js (100%) rename tests/{ => flow}/union_new/test13.js (100%) rename tests/{ => flow}/union_new/test14.js (100%) rename tests/{ => flow}/union_new/test15.js (100%) rename tests/{ => flow}/union_new/test16.js (100%) rename tests/{ => flow}/union_new/test17.js (100%) rename tests/{ => flow}/union_new/test18.js (100%) rename tests/{ => flow}/union_new/test19.js (100%) rename tests/{ => flow}/union_new/test2.js (100%) rename tests/{ => flow}/union_new/test20.js (100%) rename tests/{ => flow}/union_new/test21.js (100%) rename tests/{ => flow}/union_new/test22.js (100%) rename tests/{ => flow}/union_new/test23.js (100%) rename tests/{ => flow}/union_new/test24.js (100%) rename tests/{ => flow}/union_new/test25.js (100%) rename tests/{ => flow}/union_new/test26.js (100%) rename tests/{ => flow}/union_new/test27.js (100%) rename tests/{ => flow}/union_new/test29.js (100%) rename tests/{ => flow}/union_new/test3.js (100%) rename tests/{ => flow}/union_new/test30-helper.js (100%) rename tests/{ => flow}/union_new/test30.js (100%) rename tests/{ => flow}/union_new/test31.js (100%) rename tests/{ => flow}/union_new/test32.js (100%) rename tests/{ => flow}/union_new/test4.js (100%) rename tests/{ => flow}/union_new/test5.js (100%) rename tests/{ => flow}/union_new/test6.js (100%) rename tests/{ => flow}/union_new/test7.js (100%) rename tests/{ => flow}/union_new/test8.js (100%) rename tests/{ => flow}/union_new/test9.js (100%) rename tests/{ => flow}/unreachable/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/unreachable/jsfmt.spec.js rename tests/{ => flow}/unreachable/typecheck.js (100%) rename tests/{ => flow}/unreachable/unreachable.js (100%) rename tests/{ => flow}/value/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/value/jsfmt.spec.js rename tests/{ => flow}/value/value.js (100%) rename tests/{ => flow}/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/vim_emacs_errors/jsfmt.spec.js rename tests/{ => flow}/vim_emacs_errors/test.js (100%) rename tests/{ => flow}/weakmode/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/weakmode/jsfmt.spec.js rename tests/{ => flow}/weakmode/should_fail_without_weak.js (100%) rename tests/{ => flow}/weakmode/should_pass_with_weak.js (100%) create mode 100644 tests/flow/while/__snapshots__/jsfmt.spec.js.snap rename tests/{ => flow}/while/abnormal.js (100%) create mode 100644 tests/flow/while/jsfmt.spec.js rename tests/{ => flow}/while/test.js (100%) rename tests/{ => flow}/window/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/window/jsfmt.spec.js rename tests/{ => flow}/window/window1.js (100%) rename tests/{ => flow}/window/window2.js (100%) rename tests/{ => flow}/x/XControllerURIBuilder.js (100%) rename tests/{ => flow}/x/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/flow/x/jsfmt.spec.js create mode 100644 tests/interface/module.js create mode 100644 tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/jsx-multiline-assign/jsfmt.spec.js rename tests/{prettier/jsx-multiline-assign.js => jsx-multiline-assign/test.js} (100%) create mode 100644 tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/jsx-significant-space/jsfmt.spec.js rename tests/{prettier/jsx-significant-space.js => jsx-significant-space/test.js} (100%) create mode 100644 tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/jsx-split-attrs/jsfmt.spec.js rename tests/{prettier/jsx-split-attrs.js => jsx-split-attrs/test.js} (100%) create mode 100644 tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/jsx-stateless-arrow-fn/jsfmt.spec.js rename tests/{prettier/jsx-stateless-arrow-fn.js => jsx-stateless-arrow-fn/test.js} (100%) rename tests/{line-endings => line}/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/line/jsfmt.spec.js rename tests/{line-endings => line}/windows.js (100%) create mode 100644 tests/method-chain/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/method-chain/jsfmt.spec.js rename tests/{prettier/method-chain.js => method-chain/test.js} (100%) create mode 100644 tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/object-prop-break-in/jsfmt.spec.js rename tests/{prettier/object-prop-break-in.js => object-prop-break-in/test.js} (100%) create mode 100644 tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/optional-type-name/jsfmt.spec.js rename tests/{prettier/optional-type-name.js => optional-type-name/test.js} (100%) delete mode 100644 tests/prettier/__snapshots__/jsfmt.spec.js.snap rename tests/{trailingComma => trailing_comma}/__snapshots__/jsfmt.spec.js.snap (100%) rename tests/{trailingComma => trailing_comma}/function-calls.js (100%) rename tests/{trailingComma => trailing_comma}/jsfmt.spec.js (100%) rename tests/{trailingComma => trailing_comma}/object.js (100%) rename tests/{urnary_expression => unary_expression}/__snapshots__/jsfmt.spec.js.snap (100%) create mode 100644 tests/unary_expression/jsfmt.spec.js rename tests/{urnary_expression => unary_expression}/urnary_expression.js (100%) create mode 100644 tests/union_intersection/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/union_intersection/jsfmt.spec.js rename tests/{union-intersection => union_intersection}/test.js (73%) diff --git a/tests/array_spread/__snapshots__/jsfmt.spec.js.snap b/tests/array_spread/__snapshots__/jsfmt.spec.js.snap index 730b63ef..e455b2c8 100644 --- a/tests/array_spread/__snapshots__/jsfmt.spec.js.snap +++ b/tests/array_spread/__snapshots__/jsfmt.spec.js.snap @@ -6,54 +6,3 @@ exports[`test multiple.js 1`] = ` [...a, ...b]; " `; - -exports[`test multiple.js 2`] = ` -"[...a, ...b,]; -[...a, ...b]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -[...a, ...b]; -[...a, ...b]; -" -`; - -exports[`test test.js 1`] = ` -"var A = [1,2,3]; -var B = [...A]; -var C = [1,2,3]; -B.sort((a, b) => a - b); -C.sort((a, b) => a - b); - -var x: Array = [\'1\', \'2\']; -var y: Array = [\'3\', ...x]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = [1, 2, 3]; -var B = [...A]; -var C = [1, 2, 3]; -B.sort((a, b) => a - b); -C.sort((a, b) => a - b); - -var x: Array = [\"1\", \"2\"]; -var y: Array = [\"3\", ...x]; -" -`; - -exports[`test test.js 2`] = ` -"var A = [1,2,3]; -var B = [...A]; -var C = [1,2,3]; -B.sort((a, b) => a - b); -C.sort((a, b) => a - b); - -var x: Array = [\'1\', \'2\']; -var y: Array = [\'3\', ...x]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = [1, 2, 3]; -var B = [...A]; -var C = [1, 2, 3]; -B.sort((a, b) => a - b); -C.sort((a, b) => a - b); - -var x: Array = [\"1\", \"2\"]; -var y: Array = [\"3\", ...x]; -" -`; diff --git a/tests/array_spread/jsfmt.spec.js b/tests/array_spread/jsfmt.spec.js index d5ec770a..989047bc 100644 --- a/tests/array_spread/jsfmt.spec.js +++ b/tests/array_spread/jsfmt.spec.js @@ -1,2 +1 @@ run_spec(__dirname); -run_spec(__dirname, {parser: 'babylon'}); diff --git a/tests/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/arrays/__snapshots__/jsfmt.spec.js.snap index 2333ac78..91133532 100644 --- a/tests/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/arrays/__snapshots__/jsfmt.spec.js.snap @@ -1,85 +1,3 @@ -exports[`test Arrays.js 1`] = ` -" -/* @providesModule Arrays */ - -function foo(x:string) { } - -var a = []; -a[0] = 1; -a[1] = \"...\"; - -foo(a[1]); -var y; -a.forEach(x => y=x); - -// for literals, composite element type is union of individuals -// note: test both tuple and non-tuple inferred literals -var alittle: Array = [0, 1, 2, 3, null]; -var abig: Array = [0, 1, 2, 3, 4, 5, 6, 8, null]; - -var abig2: Array<{x:number; y:number}> = [ - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0}, - {x:0, y:0, a:true}, - {x:0, y:0, b:\"hey\"}, - {x:0, y:0, c:1}, - {x:0, y:0, c:\"hey\"} -]; - -module.exports = \"arrays\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @providesModule Arrays */ - -function foo(x: string) {} - -var a = []; -a[0] = 1; -a[1] = \"...\"; - -foo(a[1]); -var y; -a.forEach(x => y = x); - -// for literals, composite element type is union of individuals -// note: test both tuple and non-tuple inferred literals -var alittle: Array = [0, 1, 2, 3, null]; -var abig: Array = [0, 1, 2, 3, 4, 5, 6, 8, null]; - -var abig2: Array<{ x: number, y: number }> = [ - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0 }, - { x: 0, y: 0, a: true }, - { x: 0, y: 0, b: \"hey\" }, - { x: 0, y: 0, c: 1 }, - { x: 0, y: 0, c: \"hey\" } -]; - -module.exports = \"arrays\"; -" -`; - exports[`test last.js 1`] = ` "[,]; [,,]; @@ -92,22 +10,3 @@ exports[`test last.js 1`] = ` [, , 1, 1]; " `; - -exports[`test numeric_elem.js 1`] = ` -"var arr = []; -var day = new Date; - -// Date instances are numeric (see Flow_js.numeric) and thus can index into -// arrays. -arr[day] = 0; -(arr[day]: string); // error: number ~> string -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var arr = []; -var day = new Date(); - -// Date instances are numeric (see Flow_js.numeric) and thus can index into -// arrays. -arr[day] = 0; -(arr[day]: string); // error: number ~> string -" -`; diff --git a/tests/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/arrows/__snapshots__/jsfmt.spec.js.snap index eb94c091..b5a44469 100644 --- a/tests/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/arrows/__snapshots__/jsfmt.spec.js.snap @@ -1,31 +1,3 @@ -exports[`test advanced_arrows.js 1`] = ` -"/** - * @flow - */ - -var add = (x: number, y: number): number => x + y; - -var bad = (x: number): string => x; // Error! - -var ident = (x: T): T => x; -(ident(1): number); -(ident(\"hi\"): number); // Error -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @flow - */ - -var add = (x: number, y: number): number => x + y; - -var bad = (x: number): string => x; - -// Error! -var ident = (x: T): T => x; -(ident(1): number); -(ident(\"hi\"): number); // Error -" -`; - exports[`test arrow_function_expression.js 1`] = ` "(a => {}).length typeof (() => {}); @@ -46,31 +18,9 @@ if ((() => {}) ? 1 : 0) { " `; -exports[`test arrows.js 1`] = ` -"function selectBestEffortImageForWidth( - maxWidth: number, - images: Array -): Image { - var maxPixelWidth = maxWidth; - //images = images.sort(function (a, b) { return a.width - b.width }); - images = images.sort((a, b) => (a.width - b.width) + \"\"); - return images.find(image => image.width >= maxPixelWidth) || - images[images.length - 1]; -} - -a = () => ({} = this); +exports[`test block_like.js 1`] = ` +"a = () => ({} = this); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function selectBestEffortImageForWidth( - maxWidth: number, - images: Array -): Image { - var maxPixelWidth = maxWidth; - //images = images.sort(function (a, b) { return a.width - b.width }); - images = images.sort((a, b) => a.width - b.width + \"\"); - return images.find(image => image.width >= maxPixelWidth) || - images[images.length - 1]; -} - a = () => ({} = this); " `; diff --git a/tests/arrows/block_like.js b/tests/arrows/block_like.js new file mode 100644 index 00000000..a40f5326 --- /dev/null +++ b/tests/arrows/block_like.js @@ -0,0 +1 @@ +a = () => ({} = this); diff --git a/tests/async/__snapshots__/jsfmt.spec.js.snap b/tests/async/__snapshots__/jsfmt.spec.js.snap index c8911dc5..208c7fca 100644 --- a/tests/async/__snapshots__/jsfmt.spec.js.snap +++ b/tests/async/__snapshots__/jsfmt.spec.js.snap @@ -1,528 +1,10 @@ -exports[`test async.js 1`] = ` -"// @flow - -// \"For async functions, a Promise is returned, -// and the type of return expressions must be T.\" -// - -async function f0(): Promise { - return 1; -} - -async function f1(): Promise { - return 1; // error, number != bool -} - -// await: (p: Promise | T) => T -// - -async function f2(p: Promise): Promise { - var x: number = await p; - var y: number = await 1; - return x + y; -} - -async function f3(p: Promise): Promise { - return await p; -} - -// TODO: this is one of those bad generic errors, currently: -// \"inconsistent use of library definitions\" with two core.js locs -async function f4(p: Promise): Promise { - return await p; // error, number != bool -} - -// async arrow functions -// - -var f5: () => Promise = async () => await 1; - -// async methods -// - -class C { - async m() { return 1; } - async mt(a: T): Promise { return a; } - static async m(a): void { await a; } // error, void != Promise - static async mt(a: T): Promise { return a; } -} - -// async function props - -var obj = { f: async () => await 1 }; -var objf : () => Promise = obj.f; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -// \"For async functions, a Promise is returned, -// and the type of return expressions must be T.\" -// - -async function f0(): Promise { - return 1; -} - -async function f1(): Promise { - return 1; // error, number != bool -} - -// await: (p: Promise | T) => T -// -async function f2(p: Promise): Promise { - var x: number = await p; - var y: number = await 1; - return x + y; -} - -async function f3(p: Promise): Promise { - return await p; -} - -// TODO: this is one of those bad generic errors, currently: -// \"inconsistent use of library definitions\" with two core.js locs -async function f4(p: Promise): Promise { - return await p; // error, number != bool -} - -// async arrow functions -// -var f5: () => Promise = async () => await 1; - -// async methods -// -class C { - async m() { - return 1; - } - async mt(a: T): Promise { - return a; - } - static async m(a): void { - await a; - } - // error, void != Promise - static async mt(a: T): Promise { - return a; - } -} - -// async function props -var obj = { f: async () => await 1 }; -var objf: () => Promise = obj.f; -" -`; - -exports[`test async_base_class.js 1`] = ` -"// This is kind of weird, but it should parse. This works in babel without the -// parens around (await promise). From the es6 and async/await specs I (nmote) -// am not clear on whether it should. In any case it\'s a strange corner case -// that is probably not important to support. -class C {}; - -var P: Promise> = new Promise(function (resolve, reject) { - resolve(C); -}); - -async function foo() { - class Bar extends (await P) { } - return Bar; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// This is kind of weird, but it should parse. This works in babel without the -// parens around (await promise). From the es6 and async/await specs I (nmote) -// am not clear on whether it should. In any case it\'s a strange corner case -// that is probably not important to support. -class C {} - -var P: Promise> = new Promise(function(resolve, reject) { - resolve(C); -}); - -async function foo() { - class Bar extends (await P) {} - return Bar; -} -" -`; - -exports[`test async_parse.js 1`] = ` -"async function f() {} -async function ft(a: T) {} - -class C { - async m() {} - async mt(a: T) {} - static async m(a) {} - static async mt(a: T) {} -} - -var e = async function () {}; -var et = async function (a: T) {}; - -var n = new async function() {}; - -var o = { async m() {} }; -var ot = { async m(a: T) {} }; -var oz = { async async() {} }; - -var x = { async : 5 }; -console.log(x.async); - -var async = 3; -var y = { async }; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -async function f() {} -async function ft(a: T) {} - -class C { - async m() {} - async mt(a: T) {} - static async m(a) {} - static async mt(a: T) {} -} - -var e = async function() {}; -var et = async function(a: T) {}; - -var n = new (async function() {})(); - -var o = { async m() {} }; -var ot = { async m(a: T) {} }; -var oz = { async async() {} }; - -var x = { async: 5 }; -console.log(x.async); - -var async = 3; -var y = { async }; -" -`; - -exports[`test async_promise.js 1`] = ` -"async function f(): Promise { - return Promise.resolve(1); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -async function f(): Promise { - return Promise.resolve(1); -} -" -`; - -exports[`test async_return_void.js 1`] = ` -"// @flow - -async function foo1(): Promise { - return; -} - -async function foo2(): Promise { - return undefined; -} - -async function foo3(): Promise { - function bar() { } - return bar(); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -async function foo1(): Promise { - return; -} - -async function foo2(): Promise { - return undefined; -} - -async function foo3(): Promise { - function bar() {} - return bar(); -} -" -`; - -exports[`test async2.js 1`] = ` -"// @flow - -// misc basic - -function test1() { - async function foo() { - return 42; - } - - async function bar() { - var a = await foo(); - var b: number = a; // valid - var c: string = a; // Error: number ~> string - } -} - -// -// void returns: -// - -// inference should produce return type Promise -// in the absence of an explicit return -// - -function test2() { - async function voidoid1() { - console.log(\"HEY\"); - } - - var voidoid2: () => Promise = voidoid1; // ok - - var voidoid3: () => void = voidoid1; // error, void != Promise -} - -// annotated return type of Promise should work -// - -function test3() { - async function voidoid4(): Promise { // ok - console.log(\"HEY\"); - } -} - -// other annotated return types should fail -// (note: misannotated return types with explicit -// return statements are covered in async.js) -// - -function test4() { - async function voidoid5(): void { // error, void != Promise - console.log(\"HEY\"); - } -} - -function test5() { - async function voidoid6() - : Promise { // error, number != void - console.log(\"HEY\"); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -// misc basic - -function test1() { - async function foo() { - return 42; - } - - async function bar() { - var a = await foo(); - var b: number = a; - // valid - var c: string = a; // Error: number ~> string - } -} - -// -// void returns: -// -// inference should produce return type Promise -// in the absence of an explicit return -// -function test2() { - async function voidoid1() { - console.log(\"HEY\"); - } - - var voidoid2: () => Promise = voidoid1; - - // ok - var voidoid3: () => void = voidoid1; // error, void != Promise -} - -// annotated return type of Promise should work -// -function test3() { - async function voidoid4(): Promise { - // ok - console.log(\"HEY\"); - } -} - -// other annotated return types should fail -// (note: misannotated return types with explicit -// return statements are covered in async.js) -// -function test4() { - async function voidoid5(): void { - // error, void != Promise - console.log(\"HEY\"); - } -} - -function test5() { - async function voidoid6(): Promise { - // error, number != void - console.log(\"HEY\"); - } -} -" -`; - -exports[`test async3.js 1`] = ` -"// @flow - -/** - * test nested-promise unwrapping. - * Note: currently we don\'t do this properly in the underlying - * type of the Promise class, which causes spurious errors to - * be raised here. Once that\'s fixed, the errors here will go - * away. - */ - -async function foo() { - return 42; -} - -async function bar() { - return foo(); -} - -async function baz() { - - // a should now be typed as number, but is in fact - // Promise until nested-promise unwrap is fixed - var a = await bar(); - - // TODO this is valid code, but currently gives Promise ~> number error - // due to lack of transitive Promise unwrap. - var b: number = a; - - // should be number ~> string error, but currently gives - // Promise ~> string error for the same reason - var c: string = a; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -/** - * test nested-promise unwrapping. - * Note: currently we don\'t do this properly in the underlying - * type of the Promise class, which causes spurious errors to - * be raised here. Once that\'s fixed, the errors here will go - * away. - */ - -async function foo() { - return 42; -} - -async function bar() { - return foo(); -} - -async function baz() { - // a should now be typed as number, but is in fact - // Promise until nested-promise unwrap is fixed - var a = await bar(); - - // TODO this is valid code, but currently gives Promise ~> number error - // due to lack of transitive Promise unwrap. - var b: number = a; - - // should be number ~> string error, but currently gives - // Promise ~> string error for the same reason - var c: string = a; -} -" -`; - exports[`test await_parse.js 1`] = ` -"async function f() { await 1; } -async function ft(a: T) { await 1; } - -class C { - async m() { await 1; } - async mt(a: T) { await 1; } - static async m(a) { await 1; } - static async mt(a: T) { await 1; } -} - -var e = async function () { await 1; }; -var et = async function (a: T) { await 1; }; - -var n = new async function() { await 1; }; - -var o = { async m() { await 1; } }; -var ot = { async m(a: T) { await 1; } }; -var oz = { async async(async) { await async; } }; - -var x = { await : 5 }; -console.log(x.await); - -var await = 3; -var y = { await }; - -async function f() { (await f()).length } +"async function f() { (await f()).length } async function g() { invariant( (await driver.navigator.getUrl()).substr(-7) ); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -async function f() { - await 1; -} -async function ft(a: T) { - await 1; -} - -class C { - async m() { - await 1; - } - async mt(a: T) { - await 1; - } - static async m(a) { - await 1; - } - static async mt(a: T) { - await 1; - } -} - -var e = async function() { - await 1; -}; -var et = async function(a: T) { - await 1; -}; - -var n = new (async function() { - await 1; -})(); - -var o = { - async m() { - await 1; - } -}; -var ot = { - async m(a: T) { - await 1; - } -}; -var oz = { - async async(async) { - await async; - } -}; - -var x = { await: 5 }; -console.log(x.await); - -var await = 3; -var y = { await }; - +}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ async function f() { (await f()).length; } diff --git a/tests/async/await_parse.js b/tests/async/await_parse.js index 042e679b..96ebb82e 100644 --- a/tests/async/await_parse.js +++ b/tests/async/await_parse.js @@ -1,31 +1,6 @@ -async function f() { await 1; } -async function ft(a: T) { await 1; } - -class C { - async m() { await 1; } - async mt(a: T) { await 1; } - static async m(a) { await 1; } - static async mt(a: T) { await 1; } -} - -var e = async function () { await 1; }; -var et = async function (a: T) { await 1; }; - -var n = new async function() { await 1; }; - -var o = { async m() { await 1; } }; -var ot = { async m(a: T) { await 1; } }; -var oz = { async async(async) { await async; } }; - -var x = { await : 5 }; -console.log(x.await); - -var await = 3; -var y = { await }; - async function f() { (await f()).length } async function g() { invariant( (await driver.navigator.getUrl()).substr(-7) ); -} +} \ No newline at end of file diff --git a/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..fd646320 --- /dev/null +++ b/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,61 @@ +exports[`test test.js 1`] = ` +"// It should always break the highest precedence operators first, and +// break them all at the same time. + +const x = longVariable + longVariable + longVariable; +const x = longVariable + longVariable + longVariable + longVariable - longVariable + longVariable; +const x = longVariable + longVariable * longVariable + longVariable - longVariable + longVariable; +const x = longVariable + longVariable * longVariable * longVariable / longVariable + longVariable; + +const x = longVariable && longVariable && longVariable && longVariable && longVariable && longVariable; +const x = longVariable && longVariable || longVariable && longVariable || longVariable && longVariable; + +const x = longVariable * longint && longVariable >> 0 && longVariable + longVariable; + +const x = longVariable > longint && longVariable === 0 + longVariable * longVariable; + +foo(obj.property * new Class() && obj instanceof Class && longVariable ? number + 5 : false); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// It should always break the highest precedence operators first, and +// break them all at the same time. + +const x = longVariable + longVariable + longVariable; +const x = longVariable + + longVariable + + longVariable + + longVariable - + longVariable + + longVariable; +const x = longVariable + + longVariable * longVariable + + longVariable - + longVariable + + longVariable; +const x = longVariable + + longVariable * longVariable * longVariable / longVariable + + longVariable; + +const x = longVariable && + longVariable && + longVariable && + longVariable && + longVariable && + longVariable; +const x = longVariable && longVariable || + longVariable && longVariable || + longVariable && longVariable; + +const x = longVariable * longint && + longVariable >> 0 && + longVariable + longVariable; + +const x = longVariable > longint && + longVariable === 0 + longVariable * longVariable; + +foo( + obj.property * new Class() && obj instanceof Class && longVariable + ? number + 5 + : false +); +" +`; diff --git a/tests/abnormal/jsfmt.spec.js b/tests/binary-expressions/jsfmt.spec.js similarity index 100% rename from tests/abnormal/jsfmt.spec.js rename to tests/binary-expressions/jsfmt.spec.js diff --git a/tests/prettier/binary-expressions.js b/tests/binary-expressions/test.js similarity index 100% rename from tests/prettier/binary-expressions.js rename to tests/binary-expressions/test.js diff --git a/tests/classes/__snapshots__/jsfmt.spec.js.snap b/tests/classes/__snapshots__/jsfmt.spec.js.snap index dd2d5ba7..b2bd35aa 100644 --- a/tests/classes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/classes/__snapshots__/jsfmt.spec.js.snap @@ -1,77 +1,3 @@ -exports[`test A.js 1`] = ` -"class A { - foo(x:number):void { } -} - -module.exports = A; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class A { - foo(x: number): void {} -} - -module.exports = A; -" -`; - -exports[`test B.js 1`] = ` -"var A = require(\'./A\'); - -class B extends A { } - -let b = new B(); -(b.foo: number); // error, number !~> function - -module.exports = B; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = require(\"./A\"); - -class B extends A {} - -let b = new B(); -(b.foo: number); - -// error, number !~> function -module.exports = B; -" -`; - -exports[`test C.js 1`] = ` -"var B = require(\'./B\'); - -class C extends B { - foo(x:string):void { } -} - -let c = new C(); -(c.foo: number); // error, number !~> function - -module.exports = C; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var B = require(\"./B\"); - -class C extends B { - foo(x: string): void {} -} - -let c = new C(); -(c.foo: number); - -// error, number !~> function -module.exports = C; -" -`; - -exports[`test D.js 1`] = ` -"class D { } -class E { } -new E().x -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class D {} -class E {} -new E().x; -" -`; - exports[`test binary.js 1`] = ` "(class {}) + 1; (class a {}) + 1; @@ -92,176 +18,6 @@ exports[`test call.js 1`] = ` " `; -exports[`test class_shapes.js 1`] = ` -"/* @flow */ - -type Foo = { - a: string; // exists in TestClass - b: string; // doesn\'t exist - c?: ?string; // exists in TestClass, optional - d?: number; // doesn\'t exist -} - -class TestClass { - a: string; - c: ?string; -} - -var x = new TestClass(); - -x.a; // ok -x.b; // error, TestClass has no b -x.c; // ok -x.d; // error, TestClass has no d - -var y : Foo = x; -y.b; // error, doesn\'t exist in TestClass -y.d; // ok, it\'s optional - -class Test2Superclass { - a: number; // conflicts with cast to Foo - c: ?number; // conflicts with cast to Foo -} -class Test2Class extends Test2Superclass { - b: number; // conflicts with cast to Foo -} - -var z = new Test2Class(); -var w : Foo = z; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -type Foo = { - a: string, - // exists in TestClass - b: string, - // doesn\'t exist - c?: ?string, - // exists in TestClass, optional - d?: number /* doesn\'t exist*/ -}; - -class TestClass { - a: string; - c: ?string; -} - -var x = new TestClass(); - -x.a; -// ok -x.b; -// error, TestClass has no b -x.c; -// ok -x.d; - -// error, TestClass has no d -var y: Foo = x; -y.b; -// error, doesn\'t exist in TestClass -y.d; - -// ok, it\'s optional -class Test2Superclass { - a: number; - // conflicts with cast to Foo - c: ?number; // conflicts with cast to Foo -} -class Test2Class extends Test2Superclass { - b: number; // conflicts with cast to Foo -} - -var z = new Test2Class(); -var w: Foo = z; -" -`; - -exports[`test expr.js 1`] = ` -"var Bar = class Foo { - static factory(): Foo { // OK: Foo is a type in this scope - return new Foo() // OK: Foo is a runtime binding in this scope - } -}; - -var bar1: Bar = new Bar() // OK -var bar2: Bar = Bar.factory() // OK - -// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an -// unexpected failure in the above code. - -var B = class Baz { } -var b = new Baz(); // error: Baz is not a runtime binding in this scope - -var C = class Qux { } -var c: Qux = new C(); // error: Qux is not a type in this scope - -// OK: anon classes create no binding, but can be bound manually -var Anon = class { } -var anon: Anon = new Anon(); - -class Alias { } -var _Alias = class Alias { - static factory(): Alias { - return new Alias(); - } -} -var alias1: Alias = new _Alias(); // error: bad pun -var alias2: Alias = _Alias.factory(); // error: bad pun -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var Bar = class Foo { - static factory(): Foo { - // OK: Foo is a type in this scope - return new Foo(); // OK: Foo is a runtime binding in this scope - } -}; - -var bar1: Bar = new Bar(); -// OK -var bar2: Bar = Bar.factory(); - -// OK -// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an -// unexpected failure in the above code. -var B = class Baz {}; -var b = new Baz(); - -// error: Baz is not a runtime binding in this scope -var C = class Qux {}; -var c: Qux = new C(); - -// error: Qux is not a type in this scope -// OK: anon classes create no binding, but can be bound manually -var Anon = class {}; -var anon: Anon = new Anon(); - -class Alias {} -var _Alias = class Alias { - static factory(): Alias { - return new Alias(); - } -}; -var alias1: Alias = new _Alias(); -// error: bad pun -var alias2: Alias = _Alias.factory(); // error: bad pun -" -`; - -exports[`test loc.js 1`] = ` -"/* @flow */ - -type Foo = number - -class Foo {} // error, shadows type Foo -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -type Foo = number; - -class Foo {} // error, shadows type Foo -" -`; - exports[`test member.js 1`] = ` "(class {})[1]; (class {}).a; @@ -271,39 +27,6 @@ exports[`test member.js 1`] = ` " `; -exports[`test statics.js 1`] = ` -"/* @flow */ - -class C { - static p: string; -} -C.p = \"hi\"; - -// Class static fields are compatible with object types -(C: {p:string}); // ok -(C: {p:number}); // errors, string ~> number & vice versa (unify) - -declare var o: {p:number}; -(o: Class); // error, object type incompatible with class type -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -class C { - static p: string; -} -C.p = \"hi\"; - -// Class static fields are compatible with object types -(C: { p: string }); -// ok -(C: { p: number }); - -// errors, string ~> number & vice versa (unify) -declare var o: { p: number }; -(o: Class); // error, object type incompatible with class type -" -`; - exports[`test ternary.js 1`] = ` "if (1) (class {}) ? 1 : 2; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/computed_props/__snapshots__/jsfmt.spec.js.snap b/tests/computed_props/__snapshots__/jsfmt.spec.js.snap index c163553c..371fdcdd 100644 --- a/tests/computed_props/__snapshots__/jsfmt.spec.js.snap +++ b/tests/computed_props/__snapshots__/jsfmt.spec.js.snap @@ -8,143 +8,3 @@ class c { } " `; - -exports[`test test.js 1`] = ` -"var ColorId = { - RED: \'R\', - GREEN: \'G\', - BLUE: \'B\', -}; - -var ColorNumber = { - RED: \'ff0000\', - GREEN: \'00ff00\', - BLUE: \'0000ff\', -}; - -var ColorIdToNumber = { - [ColorId.RED]: ColorNumber.RED, - [ColorId.GREEN]: ColorNumber.GREEN, - [ColorId.BLUE]: ColorNumber.BLUE, -}; - -(ColorIdToNumber[ColorId.RED]: \'ffffff\'); // oops - -ColorIdToNumber.XXX; // oops - -module.exports = { ColorId, ColorNumber }; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var ColorId = { RED: \"R\", GREEN: \"G\", BLUE: \"B\" }; - -var ColorNumber = { RED: \"ff0000\", GREEN: \"00ff00\", BLUE: \"0000ff\" }; - -var ColorIdToNumber = { - [ColorId.RED]: ColorNumber.RED, - [ColorId.GREEN]: ColorNumber.GREEN, - [ColorId.BLUE]: ColorNumber.BLUE -}; - -(ColorIdToNumber[ColorId.RED]: \"ffffff\"); - -// oops -ColorIdToNumber.XXX; - -// oops -module.exports = { ColorId, ColorNumber }; -" -`; - -exports[`test test2.js 1`] = ` -"var { ColorId, ColorNumber } = require(\'./test\'); -var ColorIdToNumber = { - [ColorId.RED]: ColorNumber.RED, - [ColorId.GREEN]: ColorNumber.GREEN, - [ColorId.BLUE]: ColorNumber.BLUE, -}; - -(ColorIdToNumber[ColorId.GREEN]: \'ffffff\'); // oops - -module.exports = ColorIdToNumber; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { ColorId, ColorNumber } = require(\"./test\"); -var ColorIdToNumber = { - [ColorId.RED]: ColorNumber.RED, - [ColorId.GREEN]: ColorNumber.GREEN, - [ColorId.BLUE]: ColorNumber.BLUE -}; - -(ColorIdToNumber[ColorId.GREEN]: \"ffffff\"); - -// oops -module.exports = ColorIdToNumber; -" -`; - -exports[`test test3.js 1`] = ` -"var { ColorId } = require(\'./test\'); -var ColorIdToNumber = require(\'./test2\'); - -(ColorIdToNumber[ColorId.BLUE]: \'ffffff\'); // oops -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { ColorId } = require(\"./test\"); -var ColorIdToNumber = require(\"./test2\"); - -(ColorIdToNumber[ColorId.BLUE]: \"ffffff\"); // oops -" -`; - -exports[`test test4.js 1`] = ` -"module.exports = \'hello\'; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"hello\"; -" -`; - -exports[`test test5.js 1`] = ` -"var hello = require(\'./test4\'); -var dummy = require(\'./test\'); -module.exports = { - ...dummy, - [hello]: \'world\', - ...dummy, -}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var hello = require(\"./test4\"); -var dummy = require(\"./test\"); -module.exports = { ...dummy, [hello]: \"world\", ...dummy }; -" -`; - -exports[`test test6.js 1`] = ` -"var o = require(\'./test5\'); -(o.hello: \'nothing\'); // oops -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./test5\"); -(o.hello: \"nothing\"); // oops -" -`; - -exports[`test test7.js 1`] = ` -"var obj = {x: 0, m() { return this.x }} -var x: string = obj[\'m\'](); // error, number ~> string - -var arr = [function() { return this.length }]; -var y: string = arr[0](); // error: number ~> string -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var obj = { - x: 0, - m() { - return this.x; - } -}; -var x: string = obj[\"m\"](); - -// error, number ~> string -var arr = [ - function() { - return this.length; - } -]; -var y: string = arr[0](); // error: number ~> string -" -`; diff --git a/tests/directives/__snapshots__/jsfmt.spec.js.snap b/tests/directives/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..f680d053 --- /dev/null +++ b/tests/directives/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,14 @@ +exports[`test test.js 1`] = ` +"\"use strict\"; + +function fn() { + \"use strict\"; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\"use strict\"; + +function fn() { + \"use strict\"; +} +" +`; diff --git a/tests/annot/any/jsfmt.spec.js b/tests/directives/jsfmt.spec.js similarity index 100% rename from tests/annot/any/jsfmt.spec.js rename to tests/directives/jsfmt.spec.js diff --git a/tests/prettier/directives.js b/tests/directives/test.js similarity index 100% rename from tests/prettier/directives.js rename to tests/directives/test.js diff --git a/tests/es6modules/__snapshots__/jsfmt.spec.js.snap b/tests/es6modules/__snapshots__/jsfmt.spec.js.snap index 984f707b..794a45e4 100644 --- a/tests/es6modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/es6modules/__snapshots__/jsfmt.spec.js.snap @@ -1,1352 +1,3 @@ -exports[`test B.js 1`] = ` -"/* @flow */ - -exports.numberValue = 42; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -exports.numberValue = 42; -" -`; - -exports[`test C.js 1`] = ` -"/* @flow */ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" -`; - -exports[`test CommonJS_Clobbering_Class.js 1`] = ` -"/** - * @providesModule CommonJS_Clobbering_Class - * @flow - */ - -class Base { - static baseProp: number; -} - -class Test extends Base { - static childProp: number; - - static staticNumber1():number { return 1; } - static staticNumber2():number { return 2; } - static staticNumber3():number { return 3; } - - instNumber1():number { return 1; } - instNumber2():number { return 2; } -}; - -module.exports = Test; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule CommonJS_Clobbering_Class - * @flow - */ - -class Base { - static baseProp: number; -} - -class Test extends Base { - static childProp: number; - - static staticNumber1(): number { - return 1; - } - static staticNumber2(): number { - return 2; - } - static staticNumber3(): number { - return 3; - } - - instNumber1(): number { - return 1; - } - instNumber2(): number { - return 2; - } -} - -module.exports = Test; -" -`; - -exports[`test CommonJS_Clobbering_Frozen.js 1`] = ` -"/** - * @providesModule CommonJS_Clobbering_Frozen - * @flow - */ - -module.exports = Object.freeze({ - numberValue1: 1, -}); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule CommonJS_Clobbering_Frozen - * @flow - */ - -module.exports = Object.freeze({ numberValue1: 1 }); -" -`; - -exports[`test CommonJS_Clobbering_Lit.js 1`] = ` -"/** - * @providesModule CommonJS_Clobbering_Lit - * @flow - */ - -module.exports = { - numberValue1: 1, - numberValue2: 2, - numberValue3: 3, - numberValue4: 4, - numberValue5: 5 -}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule CommonJS_Clobbering_Lit - * @flow - */ - -module.exports = { - numberValue1: 1, - numberValue2: 2, - numberValue3: 3, - numberValue4: 4, - numberValue5: 5 -}; -" -`; - -exports[`test CommonJS_Named.js 1`] = ` -"/** - * @providesModule CommonJS_Named - * @flow - */ - -exports.numberValue1 = 1; -exports.numberValue2 = 2; -exports.numberValue3 = 3; -exports.numberValue4 = 4; -exports.numberValue5 = 5; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule CommonJS_Named - * @flow - */ - -exports.numberValue1 = 1; -exports.numberValue2 = 2; -exports.numberValue3 = 3; -exports.numberValue4 = 4; -exports.numberValue5 = 5; -" -`; - -exports[`test ES6_Default_AnonClass1.js 1`] = ` -"/** - * @providesModule ES6_Default_AnonClass1 - * @flow - */ - -export default class { givesANum(): number { return 42; }}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_AnonClass1 - * @flow - */ - -export default class { - givesANum(): number { - return 42; - } -} -" -`; - -exports[`test ES6_Default_AnonClass2.js 1`] = ` -"/** - * @providesModule ES6_Default_AnonClass2 - * @flow - */ - -export default class { givesANum(): number { return 42; }}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_AnonClass2 - * @flow - */ - -export default class { - givesANum(): number { - return 42; - } -} -" -`; - -exports[`test ES6_Default_AnonFunction1.js 1`] = ` -"/** - * @providesModule ES6_Default_AnonFunction1 - * @flow - */ - -export default function():number { return 42; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_AnonFunction1 - * @flow - */ - -export default function(): number { - return 42; -} -" -`; - -exports[`test ES6_Default_AnonFunction2.js 1`] = ` -"/** - * @providesModule ES6_Default_AnonFunction2 - * @flow - */ - -export default function():number { return 42; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_AnonFunction2 - * @flow - */ - -export default function(): number { - return 42; -} -" -`; - -exports[`test ES6_Default_NamedClass1.js 1`] = ` -"/** - * @providesModule ES6_Default_NamedClass1 - * @flow - */ - -export default class Foo { givesANum(): number { return 42; }}; - -// Regression test for https://github.com/facebook/flow/issues/511 -// -// Default-exported class should also be available in local scope -new Foo(); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_NamedClass1 - * @flow - */ - -export default class Foo { - givesANum(): number { - return 42; - } -} - -// Regression test for https://github.com/facebook/flow/issues/511 -// -// Default-exported class should also be available in local scope -new Foo(); -" -`; - -exports[`test ES6_Default_NamedClass2.js 1`] = ` -"/** - * @providesModule ES6_Default_NamedClass2 - * @flow - */ - -export default class Foo { givesANum(): number { return 42; }}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_NamedClass2 - * @flow - */ - -export default class Foo { - givesANum(): number { - return 42; - } -} -" -`; - -exports[`test ES6_Default_NamedFunction1.js 1`] = ` -"/** - * @providesModule ES6_Default_NamedFunction1 - * @flow - */ - -export default function foo():number { return 42; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_NamedFunction1 - * @flow - */ - -export default function foo(): number { - return 42; -} -" -`; - -exports[`test ES6_Default_NamedFunction2.js 1`] = ` -"/** - * @providesModule ES6_Default_NamedFunction2 - * @flow - */ - -export default function foo():number { return 42; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Default_NamedFunction2 - * @flow - */ - -export default function foo(): number { - return 42; -} -" -`; - -exports[`test ES6_DefaultAndNamed.js 1`] = ` -"/* @flow */ - -export default 42; -export var str = \'asdf\'; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -export default 42; -export var str = \"asdf\"; -" -`; - -exports[`test ES6_ExportAllFrom_Intermediary1.js 1`] = ` -"/** - * @providesModule ES6_ExportAllFrom_Intermediary1 - * @flow - */ - -export * from \"ES6_ExportAllFrom_Source1\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportAllFrom_Intermediary1 - * @flow - */ - -export * from \"ES6_ExportAllFrom_Source1\"; -" -`; - -exports[`test ES6_ExportAllFrom_Intermediary2.js 1`] = ` -"/** - * @providesModule ES6_ExportAllFrom_Intermediary2 - * @flow - */ - -export * from \"ES6_ExportAllFrom_Source2\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportAllFrom_Intermediary2 - * @flow - */ - -export * from \"ES6_ExportAllFrom_Source2\"; -" -`; - -exports[`test ES6_ExportAllFrom_Source1.js 1`] = ` -"/** - * @providesModule ES6_ExportAllFrom_Source1 - * @flow - */ - -export var numberValue1 = 1; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportAllFrom_Source1 - * @flow - */ - -export var numberValue1 = 1; -" -`; - -exports[`test ES6_ExportAllFrom_Source2.js 1`] = ` -"/** - * @providesModule ES6_ExportAllFrom_Source2 - * @flow - */ - -export var numberValue2 = 1; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportAllFrom_Source2 - * @flow - */ - -export var numberValue2 = 1; -" -`; - -exports[`test ES6_ExportAllFromMulti.js 1`] = ` -"// @flow - -export * from \"./ES6_ExportAllFrom_Source1\"; -export * from \"./ES6_ExportAllFrom_Source2\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -export * from \"./ES6_ExportAllFrom_Source1\"; -export * from \"./ES6_ExportAllFrom_Source2\"; -" -`; - -exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` -"/** - * @providesModule ES6_ExportFrom_Intermediary1 - * @flow - */ - -export { - numberValue1, - numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportFrom_Intermediary1 - * @flow - */ - -export { - numberValue1, - numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; -" -`; - -exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` -"/** - * @providesModule ES6_ExportFrom_Intermediary2 - * @flow - */ - -export { - numberValue1, - numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportFrom_Intermediary2 - * @flow - */ - -export { - numberValue1, - numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; -" -`; - -exports[`test ES6_ExportFrom_Source1.js 1`] = ` -"/** - * @providesModule ES6_ExportFrom_Source1 - * @flow - */ - -export var numberValue1 = 1, numberValue2 = 2; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportFrom_Source1 - * @flow - */ - -export var numberValue1 = 1, numberValue2 = 2; -" -`; - -exports[`test ES6_ExportFrom_Source2.js 1`] = ` -"/** - * @providesModule ES6_ExportFrom_Source2 - * @flow - */ - -export var numberValue1 = 1, numberValue2 = 2; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_ExportFrom_Source2 - * @flow - */ - -export var numberValue1 = 1, numberValue2 = 2; -" -`; - -exports[`test ES6_Named1.js 1`] = ` -"/** - * @providesModule ES6_Named1 - * @flow - */ - -var specifierNumber1 = 1; -var specifierNumber2 = 2; -var specifierNumber3 = 3; -var groupedSpecifierNumber1 = 1; -var groupedSpecifierNumber2 = 2; - -export {specifierNumber1}; -export {specifierNumber2 as specifierNumber2Renamed}; -export {specifierNumber3}; -export {groupedSpecifierNumber1, groupedSpecifierNumber2}; - -export function givesANumber(): number { return 42; }; -export class NumberGenerator { givesANumber(): number { return 42; }}; - -export var varDeclNumber1 = 1, varDeclNumber2 = 2; -export var {destructuredObjNumber} = {destructuredObjNumber: 1}; -export var [destructuredArrNumber] = [1] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Named1 - * @flow - */ - -var specifierNumber1 = 1; -var specifierNumber2 = 2; -var specifierNumber3 = 3; -var groupedSpecifierNumber1 = 1; -var groupedSpecifierNumber2 = 2; - -export { specifierNumber1 }; -export { specifierNumber2 as specifierNumber2Renamed }; -export { specifierNumber3 }; -export { groupedSpecifierNumber1, groupedSpecifierNumber2 }; - -export function givesANumber(): number { - return 42; -} -export class NumberGenerator { - givesANumber(): number { - return 42; - } -} - -export var varDeclNumber1 = 1, varDeclNumber2 = 2; -export var { destructuredObjNumber } = { destructuredObjNumber: 1 }; -export var [destructuredArrNumber] = [1]; -" -`; - -exports[`test ES6_Named2.js 1`] = ` -"/** - * @providesModule ES6_Named2 - * @flow - */ - -var specifierNumber4 = 1; -var specifierNumber5 = 2; -var groupedSpecifierNumber3 = 1; -var groupedSpecifierNumber4 = 2; - -export {specifierNumber4}; -export {specifierNumber5 as specifierNumber5Renamed}; -export {groupedSpecifierNumber3, groupedSpecifierNumber4}; - -export function givesANumber2(): number { return 42; }; -export class NumberGenerator2 { givesANumber(): number { return 42; }}; - -export var varDeclNumber3 = 1, varDeclNumber4 = 2; -export var {destructuredObjNumber2} = {destructuredObjNumber2: 1}; -export var [destructuredArrNumber2] = [1] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule ES6_Named2 - * @flow - */ - -var specifierNumber4 = 1; -var specifierNumber5 = 2; -var groupedSpecifierNumber3 = 1; -var groupedSpecifierNumber4 = 2; - -export { specifierNumber4 }; -export { specifierNumber5 as specifierNumber5Renamed }; -export { groupedSpecifierNumber3, groupedSpecifierNumber4 }; - -export function givesANumber2(): number { - return 42; -} -export class NumberGenerator2 { - givesANumber(): number { - return 42; - } -} - -export var varDeclNumber3 = 1, varDeclNumber4 = 2; -export var { destructuredObjNumber2 } = { destructuredObjNumber2: 1 }; -export var [destructuredArrNumber2] = [1]; -" -`; - -exports[`test ExportType.js 1`] = ` -"// @flow - -export type typeAlias = number; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -export type typeAlias = number; -" -`; - -exports[`test ProvidesModuleA.js 1`] = ` -"/** - * @providesModule A - * @flow - */ - -exports.numberValue1 = 42; -exports.numberValue2 = 42; -exports.numberValue3 = 42; -exports.numberValue4 = 42; -exports.stringValue = \"str\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule A - * @flow - */ - -exports.numberValue1 = 42; -exports.numberValue2 = 42; -exports.numberValue3 = 42; -exports.numberValue4 = 42; -exports.stringValue = \"str\"; -" -`; - -exports[`test ProvidesModuleCJSDefault.js 1`] = ` -"/** - * @providesModule CJSDefault - * @flow - */ - -module.exports = { - numberValue: 42 -}; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @providesModule CJSDefault - * @flow - */ - -module.exports = { numberValue: 42 }; -" -`; - -exports[`test ProvidesModuleD.js 1`] = ` -"/** - * @providesModule D - * @flow - */ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" -`; - -exports[`test ProvidesModuleES6Default.js 1`] = ` -"/** - * @providesModule ES6Default - * @flow - */ - -/* -export default { - numberValue: 42, -}; -*/ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" -`; - -exports[`test SideEffects.js 1`] = ` -"/* @flow */ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" -`; - -exports[`test es6modules.js 1`] = ` -"/* @flow */ - -// ===================== // -// == Path Resolution == // -// ===================== // - -// @providesModule -import * as DefaultA from \"A\"; -var a1: number = DefaultA.numberValue1; -var a2: string = DefaultA.numberValue1; // Error: number ~> string - -// File path -import * as DefaultB from \"./B\"; -var b1: number = DefaultB.numberValue; -var b2: string = DefaultB.numberValue; // Error: number ~> string - -// C.js exists, but not as a providesModule -import DefaultC from \"C\"; // Error: No such module - -// @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; // Error: No such module - -// ================================================ // -// == CommonJS Clobbering Literal Exports -> ES6 == // -// ================================================ // - -import {doesntExist1} from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding - -import {numberValue1} from \"CommonJS_Clobbering_Lit\"; -var c1: number = numberValue1; -var c2: string = numberValue1; // Error: number ~> string - -import {numberValue2 as numVal1} from \"CommonJS_Clobbering_Lit\"; -var d1: number = numVal1; -var d2: string = numVal1; // Error: number ~> string - -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; -var e1: number = CJS_Clobb_Lit.numberValue3; -var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string -CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property - -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; -var f1: number = CJS_Clobb_Lit_NS.numberValue4; -var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj -var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string -var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string - -// ============================================== // -// == CommonJS Clobbering Class Exports -> ES6 == // -// ============================================== // - -import {doesntExist2} from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding - -// The following import should error because class statics are not turned into -// named exports for now. This avoids complexities with polymorphic static -// members (where the polymophism is defined on the class itself rather than the -// method). -import {staticNumber1, baseProp, childProp} from \"CommonJS_Clobbering_Class\"; // Error - -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class(); -new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property -var h1: number = CJS_Clobb_Class.staticNumber2(); -var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string -var h3: number = new CJS_Clobb_Class().instNumber1(); -var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string - -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable -var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object -var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); -var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string - -// =================================== // -// == CommonJS Named Exports -> ES6 == // -// =================================== // - -import {doesntExist3} from \"CommonJS_Named\"; // Error: Not an exported binding - -import {numberValue2} from \"CommonJS_Named\"; -var j1: number = numberValue2; -var j2: string = numberValue2; // Error: number ~> string - -import {numberValue3 as numVal3} from \"CommonJS_Named\"; -var k1: number = numVal3; -var k2: string = numVal3; // Error: number ~> string - -import * as CJS_Named from \"CommonJS_Named\"; -var l1: number = CJS_Named.numberValue1; -var l2: string = CJS_Named.numberValue1; // Error: number ~> string -CJS_Named.doesntExist; // Error: doesntExist isn\'t a property - -import * as CJS_Named_NS from \"CommonJS_Named\"; -var m1: number = CJS_Named_NS.numberValue4; -var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export -var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string - -////////////////////////////// -// == ES6 Default -> ES6 == // -////////////////////////////// - -import {doesntExist4} from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding - -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; -var n1: number = ES6_Def_AnonFunc1(); -var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string - -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; -var o1: number = ES6_Def_NamedFunc1(); -var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string - -import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; -var p1: number = new ES6_Def_AnonClass1().givesANum(); -var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string - -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; -var q1: number = new ES6_Def_NamedClass1().givesANum(); -var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string - -//////////////////////////// -// == ES6 Named -> ES6 == // -//////////////////////////// - -import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding - -import {specifierNumber1 as specifierNumber1_1} from \"ES6_Named1\"; -var r1: number = specifierNumber1_1; -var r2: string = specifierNumber1_1; // Error: number ~> string - -import {specifierNumber2Renamed} from \"ES6_Named1\"; -var s1: number = specifierNumber2Renamed; -var s2: string = specifierNumber2Renamed; // Error: number ~> string - -import {specifierNumber3 as specifierNumber3Renamed} from \"ES6_Named1\"; -var t1: number = specifierNumber3Renamed; -var t2: string = specifierNumber3Renamed; // Error: number ~> string - -import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \"ES6_Named1\"; -var u1: number = groupedSpecifierNumber1; -var u2: number = groupedSpecifierNumber2; -var u3: string = groupedSpecifierNumber1; // Error: number ~> string -var u4: string = groupedSpecifierNumber2; // Error: number ~> string - -import {givesANumber} from \"ES6_Named1\"; -var v1: number = givesANumber(); -var v2: string = givesANumber(); // Error: number ~> string - -import {NumberGenerator} from \"ES6_Named1\"; -var w1: number = new NumberGenerator().givesANumber(); -var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string - -import {varDeclNumber1, varDeclNumber2} from \"ES6_Named1\"; -var x1: number = varDeclNumber1; -var x2: number = varDeclNumber2; -var x3: string = varDeclNumber1; // Error: number ~> string -var x4: string = varDeclNumber2; // Error: number ~> string - -import {destructuredObjNumber} from \"ES6_Named1\"; -var y1: number = destructuredObjNumber; -var y2: string = destructuredObjNumber; // Error: number ~> string - -import {destructuredArrNumber} from \"ES6_Named1\"; -var z1: number = destructuredArrNumber; -var z2: string = destructuredArrNumber; // Error: number ~> string - -import {numberValue1 as numberValue4} from \"ES6_ExportFrom_Intermediary1\"; -var aa1: number = numberValue4; -var aa2: string = numberValue4; // Error: number ~> string - -import {numberValue2_renamed} from \"ES6_ExportFrom_Intermediary1\"; -var ab1: number = numberValue2_renamed; -var ab2: string = numberValue2_renamed; // Error: number ~> string - -import {numberValue1 as numberValue5} from \"ES6_ExportAllFrom_Intermediary1\"; -var ac1: number = numberValue5; -var ac2: string = numberValue5; // Error: number ~> string - -/////////////////////////////////// -// == ES6 Default -> CommonJS == // -/////////////////////////////////// - -require(\'ES6_Default_AnonFunction2\').doesntExist; // Error: \'doesntExist\' isn\'t an export - -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; -var ad1: number = ES6_Def_AnonFunc2(); -var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string - -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; -var ae1: number = ES6_Def_NamedFunc2(); -var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string - -var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; -var af1: number = new ES6_Def_AnonClass2().givesANum(); -var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string - -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; -var ag1: number = new ES6_Def_NamedClass2().givesANum(); -var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string - -///////////////////////////////// -// == ES6 Named -> CommonJS == // -///////////////////////////////// - -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; -var ah1: number = specifierNumber4; -var ah2: string = specifierNumber4; // Error: number ~> string - -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; -var ai1: number = specifierNumber5Renamed; -var ai2: string = specifierNumber5Renamed; // Error: number ~> string - -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; -var aj1: number = groupedSpecifierNumber3; -var aj2: number = groupedSpecifierNumber4; -var aj3: string = groupedSpecifierNumber3; // Error: number ~> string -var aj4: string = groupedSpecifierNumber4; // Error: number ~> string - -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; -var ak1: number = givesANumber2(); -var ak2: string = givesANumber2(); // Error: number ~> string - -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; -var al1: number = new NumberGenerator2().givesANumber(); -var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string - -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; -var am1: number = varDeclNumber3; -var am2: number = varDeclNumber4; -var am3: string = varDeclNumber3; // Error: number ~> string -var am4: string = varDeclNumber4; // Error: number ~> string - -var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; -var an1: number = destructuredObjNumber2; -var an2: string = destructuredObjNumber2; // Error: number ~> string - -var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; -var ao1: number = destructuredArrNumber2; -var ao2: string = destructuredArrNumber2; // Error: number ~> string - -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; -var ap1: number = numberValue6; -var ap2: string = numberValue6; // Error: number ~> string - -var numberValue2_renamed2 = require(\"ES6_ExportFrom_Intermediary2\").numberValue2_renamed2; -var aq1: number = numberValue2_renamed2; -var aq2: string = numberValue2_renamed2; // Error: number ~> string - -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; -var ar1: number = numberValue7; -var ar2: string = numberValue7; // Error: number ~> string - -//////////////////////////////////////////////////////// -// == ES6 Default+Named -> ES6 import Default+Named== // -//////////////////////////////////////////////////////// - -import defaultNum, {str as namedStr} from \"./ES6_DefaultAndNamed\"; - -var as1: number = defaultNum; -var as2: string = defaultNum; // Error: number ~> string - -var as3: string = namedStr; -var as4: number = namedStr; // Error: string ~> number - -//////////////////////////////////////// -// == Side-effect only ES6 imports == // -//////////////////////////////////////// - -import \"./SideEffects\"; - -////////////////////////////////////////////// -// == Suggest export name on likely typo == // -////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? -import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? - -/////////////////////////////////////////////////// -// == Multi \`export *\` should combine exports == // -/////////////////////////////////////////////////// -import { - numberValue1 as numberValue8, - numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; - -var at1: number = numberValue8; -var at2: string = numberValue8; // Error: number ~> string - -var at3: number = numberValue9; -var at4: string = numberValue9; // Error: number ~> string - -///////////////////////////////////////////////////////////// -// == Vanilla \`import\` cannot import a type-only export == // -///////////////////////////////////////////////////////////// -import {typeAlias} from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -// ===================== // -// == Path Resolution == // -// ===================== // - -// @providesModule -import * as DefaultA from \"A\"; -var a1: number = DefaultA.numberValue1; -var a2: string = DefaultA.numberValue1; - -// Error: number ~> string -// File path -import * as DefaultB from \"./B\"; -var b1: number = DefaultB.numberValue; -var b2: string = DefaultB.numberValue; - -// Error: number ~> string -// C.js exists, but not as a providesModule -import DefaultC from \"C\"; - -// Error: No such module -// @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; - -// Error: No such module -// ================================================ // -// == CommonJS Clobbering Literal Exports -> ES6 == // -// ================================================ // -import { doesntExist1 } from \"CommonJS_Clobbering_Lit\"; - -// Error: Not an exported binding -import { numberValue1 } from \"CommonJS_Clobbering_Lit\"; -var c1: number = numberValue1; -var c2: string = numberValue1; - -// Error: number ~> string -import { numberValue2 as numVal1 } from \"CommonJS_Clobbering_Lit\"; -var d1: number = numVal1; -var d2: string = numVal1; - -// Error: number ~> string -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; -var e1: number = CJS_Clobb_Lit.numberValue3; -var e2: string = CJS_Clobb_Lit.numberValue3; -// Error: number ~> string -CJS_Clobb_Lit.doesntExist; - -// Error: doesntExist isn\'t a property -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; -var f1: number = CJS_Clobb_Lit_NS.numberValue4; -var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; -// Error: No \'default\' property on the exported obj -var f3: string = CJS_Clobb_Lit_NS.numberValue4; -// Error: number ~> string -var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; - -// Error: number ~> string -// ============================================== // -// == CommonJS Clobbering Class Exports -> ES6 == // -// ============================================== // -import { doesntExist2 } from \"CommonJS_Clobbering_Class\"; - -// Error: Not an exported binding -// The following import should error because class statics are not turned into -// named exports for now. This avoids complexities with polymorphic static -// members (where the polymophism is defined on the class itself rather than the -// method). -import { staticNumber1, baseProp, childProp } from \"CommonJS_Clobbering_Class\"; - -// Error -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class(); -new CJS_Clobb_Class().doesntExist; -// Error: Class has no \`doesntExist\` property -var h1: number = CJS_Clobb_Class.staticNumber2(); -var h2: string = CJS_Clobb_Class.staticNumber2(); -// Error: number ~> string -var h3: number = new CJS_Clobb_Class().instNumber1(); -var h4: string = new CJS_Clobb_Class().instNumber1(); - -// Error: number ~> string -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); -// Error: Namespace object isn\'t constructable -var i1: number = CJS_Clobb_Class_NS.staticNumber3(); -// Error: Class statics not copied to Namespace object -var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); -var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); - -// Error: number ~> string -// =================================== // -// == CommonJS Named Exports -> ES6 == // -// =================================== // -import { doesntExist3 } from \"CommonJS_Named\"; - -// Error: Not an exported binding -import { numberValue2 } from \"CommonJS_Named\"; -var j1: number = numberValue2; -var j2: string = numberValue2; - -// Error: number ~> string -import { numberValue3 as numVal3 } from \"CommonJS_Named\"; -var k1: number = numVal3; -var k2: string = numVal3; - -// Error: number ~> string -import * as CJS_Named from \"CommonJS_Named\"; -var l1: number = CJS_Named.numberValue1; -var l2: string = CJS_Named.numberValue1; -// Error: number ~> string -CJS_Named.doesntExist; - -// Error: doesntExist isn\'t a property -import * as CJS_Named_NS from \"CommonJS_Named\"; -var m1: number = CJS_Named_NS.numberValue4; -var m2: string = CJS_Named_NS.default.numberValue4; -// Error: CommonJS_Named has no default export -var m3: string = CJS_Named_NS.numberValue4; - -// Error: number ~> string -////////////////////////////// -// == ES6 Default -> ES6 == // -////////////////////////////// -import { doesntExist4 } from \"ES6_Default_AnonFunction1\"; - -// Error: Not an exported binding -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; -var n1: number = ES6_Def_AnonFunc1(); -var n2: string = ES6_Def_AnonFunc1(); - -// Error: number ~> string -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; -var o1: number = ES6_Def_NamedFunc1(); -var o2: string = ES6_Def_NamedFunc1(); - -// Error: number ~> string -import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; -var p1: number = new ES6_Def_AnonClass1().givesANum(); -var p2: string = new ES6_Def_AnonClass1().givesANum(); - -// Error: number ~> string -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; -var q1: number = new ES6_Def_NamedClass1().givesANum(); -var q2: string = new ES6_Def_NamedClass1().givesANum(); - -// Error: number ~> string -//////////////////////////// -// == ES6 Named -> ES6 == // -//////////////////////////// -import doesntExist5 from \"ES6_Named1\"; - -// Error: Not an exported binding -import { specifierNumber1 as specifierNumber1_1 } from \"ES6_Named1\"; -var r1: number = specifierNumber1_1; -var r2: string = specifierNumber1_1; - -// Error: number ~> string -import { specifierNumber2Renamed } from \"ES6_Named1\"; -var s1: number = specifierNumber2Renamed; -var s2: string = specifierNumber2Renamed; - -// Error: number ~> string -import { specifierNumber3 as specifierNumber3Renamed } from \"ES6_Named1\"; -var t1: number = specifierNumber3Renamed; -var t2: string = specifierNumber3Renamed; - -// Error: number ~> string -import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \"ES6_Named1\"; -var u1: number = groupedSpecifierNumber1; -var u2: number = groupedSpecifierNumber2; -var u3: string = groupedSpecifierNumber1; -// Error: number ~> string -var u4: string = groupedSpecifierNumber2; - -// Error: number ~> string -import { givesANumber } from \"ES6_Named1\"; -var v1: number = givesANumber(); -var v2: string = givesANumber(); - -// Error: number ~> string -import { NumberGenerator } from \"ES6_Named1\"; -var w1: number = new NumberGenerator().givesANumber(); -var w2: string = new NumberGenerator().givesANumber(); - -// Error: number ~> string -import { varDeclNumber1, varDeclNumber2 } from \"ES6_Named1\"; -var x1: number = varDeclNumber1; -var x2: number = varDeclNumber2; -var x3: string = varDeclNumber1; -// Error: number ~> string -var x4: string = varDeclNumber2; - -// Error: number ~> string -import { destructuredObjNumber } from \"ES6_Named1\"; -var y1: number = destructuredObjNumber; -var y2: string = destructuredObjNumber; - -// Error: number ~> string -import { destructuredArrNumber } from \"ES6_Named1\"; -var z1: number = destructuredArrNumber; -var z2: string = destructuredArrNumber; - -// Error: number ~> string -import { numberValue1 as numberValue4 } from \"ES6_ExportFrom_Intermediary1\"; -var aa1: number = numberValue4; -var aa2: string = numberValue4; - -// Error: number ~> string -import { numberValue2_renamed } from \"ES6_ExportFrom_Intermediary1\"; -var ab1: number = numberValue2_renamed; -var ab2: string = numberValue2_renamed; - -// Error: number ~> string -import { numberValue1 as numberValue5 } from \"ES6_ExportAllFrom_Intermediary1\"; -var ac1: number = numberValue5; -var ac2: string = numberValue5; - -// Error: number ~> string -/////////////////////////////////// -// == ES6 Default -> CommonJS == // -/////////////////////////////////// -require(\"ES6_Default_AnonFunction2\").doesntExist; - -// Error: \'doesntExist\' isn\'t an export -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; -var ad1: number = ES6_Def_AnonFunc2(); -var ad2: string = ES6_Def_AnonFunc2(); - -// Error: number ~> string -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; -var ae1: number = ES6_Def_NamedFunc2(); -var ae2: string = ES6_Def_NamedFunc2(); - -// Error: number ~> string -var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; -var af1: number = new ES6_Def_AnonClass2().givesANum(); -var af2: string = new ES6_Def_AnonClass2().givesANum(); - -// Error: number ~> string -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; -var ag1: number = new ES6_Def_NamedClass2().givesANum(); -var ag2: string = new ES6_Def_NamedClass2().givesANum(); - -// Error: number ~> string -///////////////////////////////// -// == ES6 Named -> CommonJS == // -///////////////////////////////// -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; -var ah1: number = specifierNumber4; -var ah2: string = specifierNumber4; - -// Error: number ~> string -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; -var ai1: number = specifierNumber5Renamed; -var ai2: string = specifierNumber5Renamed; - -// Error: number ~> string -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; -var aj1: number = groupedSpecifierNumber3; -var aj2: number = groupedSpecifierNumber4; -var aj3: string = groupedSpecifierNumber3; -// Error: number ~> string -var aj4: string = groupedSpecifierNumber4; - -// Error: number ~> string -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; -var ak1: number = givesANumber2(); -var ak2: string = givesANumber2(); - -// Error: number ~> string -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; -var al1: number = new NumberGenerator2().givesANumber(); -var al2: string = new NumberGenerator2().givesANumber(); - -// Error: number ~> string -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; -var am1: number = varDeclNumber3; -var am2: number = varDeclNumber4; -var am3: string = varDeclNumber3; -// Error: number ~> string -var am4: string = varDeclNumber4; - -// Error: number ~> string -var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; -var an1: number = destructuredObjNumber2; -var an2: string = destructuredObjNumber2; - -// Error: number ~> string -var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; -var ao1: number = destructuredArrNumber2; -var ao2: string = destructuredArrNumber2; - -// Error: number ~> string -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; -var ap1: number = numberValue6; -var ap2: string = numberValue6; - -// Error: number ~> string -var numberValue2_renamed2 = require( - \"ES6_ExportFrom_Intermediary2\" -).numberValue2_renamed2; -var aq1: number = numberValue2_renamed2; -var aq2: string = numberValue2_renamed2; - -// Error: number ~> string -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; -var ar1: number = numberValue7; -var ar2: string = numberValue7; - -// Error: number ~> string -//////////////////////////////////////////////////////// -// == ES6 Default+Named -> ES6 import Default+Named== // -//////////////////////////////////////////////////////// -import defaultNum, { str as namedStr } from \"./ES6_DefaultAndNamed\"; - -var as1: number = defaultNum; -var as2: string = defaultNum; - -// Error: number ~> string -var as3: string = namedStr; -var as4: number = namedStr; - -// Error: string ~> number -//////////////////////////////////////// -// == Side-effect only ES6 imports == // -//////////////////////////////////////// -import \"./SideEffects\"; - -////////////////////////////////////////////// -// == Suggest export name on likely typo == // -////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; -// Error: Did you mean \`import {specifierNumber1} from ...\`? -import { specifierNumber } from \"ES6_Named1\"; - -// Error: Did you mean \`specifierNumber1\`? -/////////////////////////////////////////////////// -// == Multi \`export *\` should combine exports == // -/////////////////////////////////////////////////// -import { - numberValue1 as numberValue8, - numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; - -var at1: number = numberValue8; -var at2: string = numberValue8; - -// Error: number ~> string -var at3: number = numberValue9; -var at4: string = numberValue9; - -// Error: number ~> string -///////////////////////////////////////////////////////////// -// == Vanilla \`import\` cannot import a type-only export == // -///////////////////////////////////////////////////////////// -import { - typeAlias -} from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! -" -`; - exports[`test export_default_arrow_expression.js 1`] = ` "export default () => {}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1409,121 +60,3 @@ exports[`test export_default_new_expression.js 1`] = ` export default new Foo(); " `; - -exports[`test test_imports_are_frozen.js 1`] = ` -"/* @flow */ - -// -// Imports -// - -// CommonJS module -import * as DefaultA from \"A\"; -DefaultA.numberValue1 = 123; // Error: DefaultA is frozen - -// ES6 module -import * as ES6_Named1 from \"ES6_Named1\"; -ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen - -// CommonJS module that clobbers module.exports -import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; -CommonJS_Star.numberValue1 = 123; // Error: frozen -CommonJS_Star.default.numberValue1 = 123; // ok - -import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; -CommonJS_Clobbering_Lit.numberValue1 = 123; // ok - -// CommonJS module that clobbers module.exports with a frozen object -import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; -CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen -CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen - -import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; -CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen - - -// -// Requires -// - -function testRequires() { - // CommonJS module - var DefaultA = require(\"A\"); - DefaultA.numberValue1 = 123; // ok, not frozen by default - - // ES6 module - var ES6_Named1 = require(\"ES6_Named1\"); - ES6_Named1.numberValue = 123; // error, es6 exports are frozen - - // CommonJS module that clobbers module.exports - var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); - CommonJS_Star.numberValue1 = 123; // ok, not frozen by default - - // CommonJS module that clobbers module.exports with a frozen object - var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); - CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -// -// Imports -// - -// CommonJS module -import * as DefaultA from \"A\"; -DefaultA.numberValue1 = 123; - -// Error: DefaultA is frozen -// ES6 module -import * as ES6_Named1 from \"ES6_Named1\"; -ES6_Named1.varDeclNumber1 = 123; - -// Error: ES6_Named1 is frozen -// CommonJS module that clobbers module.exports -import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; -CommonJS_Star.numberValue1 = 123; -// Error: frozen -CommonJS_Star.default.numberValue1 = 123; - -// ok -import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; -CommonJS_Clobbering_Lit.numberValue1 = 123; - -// ok -// CommonJS module that clobbers module.exports with a frozen object -import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; -CommonJS_Frozen_Star.numberValue1 = 123; -// Error: frozen -CommonJS_Frozen_Star.default.numberValue1 = 123; - -// Error: frozen -import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; -CommonJS_Clobbering_Frozen.numberValue1 = 123; - -// Error: exports are frozen -// -// Requires -// -function testRequires() { - // CommonJS module - var DefaultA = require(\"A\"); - DefaultA.numberValue1 = 123; - - // ok, not frozen by default - // ES6 module - var ES6_Named1 = require(\"ES6_Named1\"); - ES6_Named1.numberValue = 123; - - // error, es6 exports are frozen - // CommonJS module that clobbers module.exports - var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); - CommonJS_Star.numberValue1 = 123; - - // ok, not frozen by default - // CommonJS module that clobbers module.exports with a frozen object - var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); - CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen -} -" -`; diff --git a/tests/export_default/__snapshots__/jsfmt.spec.js.snap b/tests/export_default/__snapshots__/jsfmt.spec.js.snap index 6d57d6ba..ed909e14 100644 --- a/tests/export_default/__snapshots__/jsfmt.spec.js.snap +++ b/tests/export_default/__snapshots__/jsfmt.spec.js.snap @@ -1,34 +1,6 @@ -exports[`test P.js 1`] = ` -"module.exports = require(\'M\'); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = require(\"M\"); -" -`; - exports[`test body.js 1`] = ` "export default (class {}[1] = 1); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default ((class {})[1] = 1); " `; - -exports[`test test.js 1`] = ` -"var M = require(\'M\'); -var N = require(\'N\'); -N.x = M(N.x); -var P = require(\'./P\'); // implementation of P redirects to module M -N.y = P(N.y); -var Q = require(\'Q\'); // declaration of Q redirects to module M -N.z = Q(N.z); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var M = require(\"M\"); -var N = require(\"N\"); -N.x = M(N.x); -var P = require(\"./P\"); -// implementation of P redirects to module M -N.y = P(N.y); -var Q = require(\"Q\"); -// declaration of Q redirects to module M -N.z = Q(N.z); -" -`; diff --git a/tests/exports/__snapshots__/jsfmt.spec.js.snap b/tests/exports/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..502807fa --- /dev/null +++ b/tests/exports/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,12 @@ +exports[`test test.js 1`] = ` +"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \"exports\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +export { + value1, + value2 as value2_renamed, + value3, + value4 as value4_renamed, + value5 +} from \"exports\"; +" +`; diff --git a/tests/annot/jsfmt.spec.js b/tests/exports/jsfmt.spec.js similarity index 100% rename from tests/annot/jsfmt.spec.js rename to tests/exports/jsfmt.spec.js diff --git a/tests/prettier/exports.js b/tests/exports/test.js similarity index 100% rename from tests/prettier/exports.js rename to tests/exports/test.js diff --git a/tests/abnormal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/abnormal/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/abnormal/break-continue.js b/tests/flow/abnormal/break-continue.js similarity index 100% rename from tests/abnormal/break-continue.js rename to tests/flow/abnormal/break-continue.js diff --git a/tests/annot2/jsfmt.spec.js b/tests/flow/abnormal/jsfmt.spec.js similarity index 100% rename from tests/annot2/jsfmt.spec.js rename to tests/flow/abnormal/jsfmt.spec.js diff --git a/tests/abnormal/return.js b/tests/flow/abnormal/return.js similarity index 100% rename from tests/abnormal/return.js rename to tests/flow/abnormal/return.js diff --git a/tests/annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/annot/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/annot/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/annot/annot.js b/tests/flow/annot/annot.js similarity index 100% rename from tests/annot/annot.js rename to tests/flow/annot/annot.js diff --git a/tests/annot/any/A.js b/tests/flow/annot/any/A.js similarity index 100% rename from tests/annot/any/A.js rename to tests/flow/annot/any/A.js diff --git a/tests/annot/any/B.js b/tests/flow/annot/any/B.js similarity index 100% rename from tests/annot/any/B.js rename to tests/flow/annot/any/B.js diff --git a/tests/annot/any/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/annot/any/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/any/jsfmt.spec.js b/tests/flow/annot/any/jsfmt.spec.js similarity index 100% rename from tests/any/jsfmt.spec.js rename to tests/flow/annot/any/jsfmt.spec.js diff --git a/tests/annot/forward_ref.js b/tests/flow/annot/forward_ref.js similarity index 100% rename from tests/annot/forward_ref.js rename to tests/flow/annot/forward_ref.js diff --git a/tests/annot/issue-530.js b/tests/flow/annot/issue-530.js similarity index 100% rename from tests/annot/issue-530.js rename to tests/flow/annot/issue-530.js diff --git a/tests/arith/jsfmt.spec.js b/tests/flow/annot/jsfmt.spec.js similarity index 100% rename from tests/arith/jsfmt.spec.js rename to tests/flow/annot/jsfmt.spec.js diff --git a/tests/annot/leak.js b/tests/flow/annot/leak.js similarity index 100% rename from tests/annot/leak.js rename to tests/flow/annot/leak.js diff --git a/tests/annot/other.js b/tests/flow/annot/other.js similarity index 100% rename from tests/annot/other.js rename to tests/flow/annot/other.js diff --git a/tests/annot/scope.js b/tests/flow/annot/scope.js similarity index 100% rename from tests/annot/scope.js rename to tests/flow/annot/scope.js diff --git a/tests/annot/test.js b/tests/flow/annot/test.js similarity index 100% rename from tests/annot/test.js rename to tests/flow/annot/test.js diff --git a/tests/annot2/A.js b/tests/flow/annot2/A.js similarity index 100% rename from tests/annot2/A.js rename to tests/flow/annot2/A.js diff --git a/tests/annot2/B.js b/tests/flow/annot2/B.js similarity index 100% rename from tests/annot2/B.js rename to tests/flow/annot2/B.js diff --git a/tests/annot2/T.js b/tests/flow/annot2/T.js similarity index 100% rename from tests/annot2/T.js rename to tests/flow/annot2/T.js diff --git a/tests/annot2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/annot2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/array-filter/jsfmt.spec.js b/tests/flow/annot2/jsfmt.spec.js similarity index 100% rename from tests/array-filter/jsfmt.spec.js rename to tests/flow/annot2/jsfmt.spec.js diff --git a/tests/any/__snapshots__/jsfmt.spec.js.snap b/tests/flow/any/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/any/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/any/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/any/any.js b/tests/flow/any/any.js similarity index 100% rename from tests/any/any.js rename to tests/flow/any/any.js diff --git a/tests/any/anyexportflowfile.js b/tests/flow/any/anyexportflowfile.js similarity index 100% rename from tests/any/anyexportflowfile.js rename to tests/flow/any/anyexportflowfile.js diff --git a/tests/any/flowfixme.js b/tests/flow/any/flowfixme.js similarity index 100% rename from tests/any/flowfixme.js rename to tests/flow/any/flowfixme.js diff --git a/tests/any/flowissue.js b/tests/flow/any/flowissue.js similarity index 100% rename from tests/any/flowissue.js rename to tests/flow/any/flowissue.js diff --git a/tests/arraylib/jsfmt.spec.js b/tests/flow/any/jsfmt.spec.js similarity index 100% rename from tests/arraylib/jsfmt.spec.js rename to tests/flow/any/jsfmt.spec.js diff --git a/tests/any/nonflowfile.js b/tests/flow/any/nonflowfile.js similarity index 100% rename from tests/any/nonflowfile.js rename to tests/flow/any/nonflowfile.js diff --git a/tests/any/propagate.js b/tests/flow/any/propagate.js similarity index 100% rename from tests/any/propagate.js rename to tests/flow/any/propagate.js diff --git a/tests/any/reach.js b/tests/flow/any/reach.js similarity index 100% rename from tests/any/reach.js rename to tests/flow/any/reach.js diff --git a/tests/arith/Arith.js b/tests/flow/arith/Arith.js similarity index 100% rename from tests/arith/Arith.js rename to tests/flow/arith/Arith.js diff --git a/tests/arith/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arith/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/arith/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/arith/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/arith/exponent.js b/tests/flow/arith/exponent.js similarity index 100% rename from tests/arith/exponent.js rename to tests/flow/arith/exponent.js diff --git a/tests/arith/generic.js b/tests/flow/arith/generic.js similarity index 100% rename from tests/arith/generic.js rename to tests/flow/arith/generic.js diff --git a/tests/async_iteration/jsfmt.spec.js b/tests/flow/arith/jsfmt.spec.js similarity index 100% rename from tests/async_iteration/jsfmt.spec.js rename to tests/flow/arith/jsfmt.spec.js diff --git a/tests/arith/mult.js b/tests/flow/arith/mult.js similarity index 100% rename from tests/arith/mult.js rename to tests/flow/arith/mult.js diff --git a/tests/arith/relational.js b/tests/flow/arith/relational.js similarity index 100% rename from tests/arith/relational.js rename to tests/flow/arith/relational.js diff --git a/tests/array-filter/__snapshots__/jsfmt.spec.js.snap b/tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/array-filter/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/autocomplete/jsfmt.spec.js b/tests/flow/array-filter/jsfmt.spec.js similarity index 100% rename from tests/autocomplete/jsfmt.spec.js rename to tests/flow/array-filter/jsfmt.spec.js diff --git a/tests/array-filter/test.js b/tests/flow/array-filter/test.js similarity index 100% rename from tests/array-filter/test.js rename to tests/flow/array-filter/test.js diff --git a/tests/array-filter/test2.js b/tests/flow/array-filter/test2.js similarity index 100% rename from tests/array-filter/test2.js rename to tests/flow/array-filter/test2.js diff --git a/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap b/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..e5b00076 --- /dev/null +++ b/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,20 @@ +exports[`test test.js 1`] = ` +"var A = [1,2,3]; +var B = [...A]; +var C = [1,2,3]; +B.sort((a, b) => a - b); +C.sort((a, b) => a - b); + +var x: Array = [\'1\', \'2\']; +var y: Array = [\'3\', ...x]; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var A = [1, 2, 3]; +var B = [...A]; +var C = [1, 2, 3]; +B.sort((a, b) => a - b); +C.sort((a, b) => a - b); + +var x: Array = [\"1\", \"2\"]; +var y: Array = [\"3\", ...x]; +" +`; diff --git a/tests/auxiliary/jsfmt.spec.js b/tests/flow/array_spread/jsfmt.spec.js similarity index 100% rename from tests/auxiliary/jsfmt.spec.js rename to tests/flow/array_spread/jsfmt.spec.js diff --git a/tests/array_spread/test.js b/tests/flow/array_spread/test.js similarity index 100% rename from tests/array_spread/test.js rename to tests/flow/array_spread/test.js diff --git a/tests/arraylib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/arraylib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/arraylib/array_lib.js b/tests/flow/arraylib/array_lib.js similarity index 100% rename from tests/arraylib/array_lib.js rename to tests/flow/arraylib/array_lib.js diff --git a/tests/auxiliary/lib/jsfmt.spec.js b/tests/flow/arraylib/jsfmt.spec.js similarity index 100% rename from tests/auxiliary/lib/jsfmt.spec.js rename to tests/flow/arraylib/jsfmt.spec.js diff --git a/tests/arrays/Arrays.js b/tests/flow/arrays/Arrays.js similarity index 100% rename from tests/arrays/Arrays.js rename to tests/flow/arrays/Arrays.js diff --git a/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..54e28169 --- /dev/null +++ b/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,100 @@ +exports[`test Arrays.js 1`] = ` +" +/* @providesModule Arrays */ + +function foo(x:string) { } + +var a = []; +a[0] = 1; +a[1] = \"...\"; + +foo(a[1]); +var y; +a.forEach(x => y=x); + +// for literals, composite element type is union of individuals +// note: test both tuple and non-tuple inferred literals +var alittle: Array = [0, 1, 2, 3, null]; +var abig: Array = [0, 1, 2, 3, 4, 5, 6, 8, null]; + +var abig2: Array<{x:number; y:number}> = [ + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0}, + {x:0, y:0, a:true}, + {x:0, y:0, b:\"hey\"}, + {x:0, y:0, c:1}, + {x:0, y:0, c:\"hey\"} +]; + +module.exports = \"arrays\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @providesModule Arrays */ + +function foo(x: string) {} + +var a = []; +a[0] = 1; +a[1] = \"...\"; + +foo(a[1]); +var y; +a.forEach(x => y = x); + +// for literals, composite element type is union of individuals +// note: test both tuple and non-tuple inferred literals +var alittle: Array = [0, 1, 2, 3, null]; +var abig: Array = [0, 1, 2, 3, 4, 5, 6, 8, null]; + +var abig2: Array<{ x: number, y: number }> = [ + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0 }, + { x: 0, y: 0, a: true }, + { x: 0, y: 0, b: \"hey\" }, + { x: 0, y: 0, c: 1 }, + { x: 0, y: 0, c: \"hey\" } +]; + +module.exports = \"arrays\"; +" +`; + +exports[`test numeric_elem.js 1`] = ` +"var arr = []; +var day = new Date; + +// Date instances are numeric (see Flow_js.numeric) and thus can index into +// arrays. +arr[day] = 0; +(arr[day]: string); // error: number ~> string +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var arr = []; +var day = new Date(); + +// Date instances are numeric (see Flow_js.numeric) and thus can index into +// arrays. +arr[day] = 0; +(arr[day]: string); // error: number ~> string +" +`; diff --git a/tests/binary/jsfmt.spec.js b/tests/flow/arrays/jsfmt.spec.js similarity index 100% rename from tests/binary/jsfmt.spec.js rename to tests/flow/arrays/jsfmt.spec.js diff --git a/tests/arrays/numeric_elem.js b/tests/flow/arrays/numeric_elem.js similarity index 100% rename from tests/arrays/numeric_elem.js rename to tests/flow/arrays/numeric_elem.js diff --git a/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..89cd18a2 --- /dev/null +++ b/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,52 @@ +exports[`test advanced_arrows.js 1`] = ` +"/** + * @flow + */ + +var add = (x: number, y: number): number => x + y; + +var bad = (x: number): string => x; // Error! + +var ident = (x: T): T => x; +(ident(1): number); +(ident(\"hi\"): number); // Error +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @flow + */ + +var add = (x: number, y: number): number => x + y; + +var bad = (x: number): string => x; + +// Error! +var ident = (x: T): T => x; +(ident(1): number); +(ident(\"hi\"): number); // Error +" +`; + +exports[`test arrows.js 1`] = ` +"function selectBestEffortImageForWidth( + maxWidth: number, + images: Array +): Image { + var maxPixelWidth = maxWidth; + //images = images.sort(function (a, b) { return a.width - b.width }); + images = images.sort((a, b) => (a.width - b.width) + \"\"); + return images.find(image => image.width >= maxPixelWidth) || + images[images.length - 1]; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function selectBestEffortImageForWidth( + maxWidth: number, + images: Array +): Image { + var maxPixelWidth = maxWidth; + //images = images.sort(function (a, b) { return a.width - b.width }); + images = images.sort((a, b) => a.width - b.width + \"\"); + return images.find(image => image.width >= maxPixelWidth) || + images[images.length - 1]; +} +" +`; diff --git a/tests/arrows/advanced_arrows.js b/tests/flow/arrows/advanced_arrows.js similarity index 100% rename from tests/arrows/advanced_arrows.js rename to tests/flow/arrows/advanced_arrows.js diff --git a/tests/arrows/arrows.js b/tests/flow/arrows/arrows.js similarity index 93% rename from tests/arrows/arrows.js rename to tests/flow/arrows/arrows.js index 93f6b3c4..f25cc0fb 100644 --- a/tests/arrows/arrows.js +++ b/tests/flow/arrows/arrows.js @@ -8,5 +8,3 @@ function selectBestEffortImageForWidth( return images.find(image => image.width >= maxPixelWidth) || images[images.length - 1]; } - -a = () => ({} = this); diff --git a/tests/binding/jsfmt.spec.js b/tests/flow/arrows/jsfmt.spec.js similarity index 100% rename from tests/binding/jsfmt.spec.js rename to tests/flow/arrows/jsfmt.spec.js diff --git a/tests/flow/async/__snapshots__/jsfmt.spec.js.snap b/tests/flow/async/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..22ae0b7b --- /dev/null +++ b/tests/flow/async/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,519 @@ +exports[`test async.js 1`] = ` +"// @flow + +// \"For async functions, a Promise is returned, +// and the type of return expressions must be T.\" +// + +async function f0(): Promise { + return 1; +} + +async function f1(): Promise { + return 1; // error, number != bool +} + +// await: (p: Promise | T) => T +// + +async function f2(p: Promise): Promise { + var x: number = await p; + var y: number = await 1; + return x + y; +} + +async function f3(p: Promise): Promise { + return await p; +} + +// TODO: this is one of those bad generic errors, currently: +// \"inconsistent use of library definitions\" with two core.js locs +async function f4(p: Promise): Promise { + return await p; // error, number != bool +} + +// async arrow functions +// + +var f5: () => Promise = async () => await 1; + +// async methods +// + +class C { + async m() { return 1; } + async mt(a: T): Promise { return a; } + static async m(a): void { await a; } // error, void != Promise + static async mt(a: T): Promise { return a; } +} + +// async function props + +var obj = { f: async () => await 1 }; +var objf : () => Promise = obj.f; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +// \"For async functions, a Promise is returned, +// and the type of return expressions must be T.\" +// + +async function f0(): Promise { + return 1; +} + +async function f1(): Promise { + return 1; // error, number != bool +} + +// await: (p: Promise | T) => T +// +async function f2(p: Promise): Promise { + var x: number = await p; + var y: number = await 1; + return x + y; +} + +async function f3(p: Promise): Promise { + return await p; +} + +// TODO: this is one of those bad generic errors, currently: +// \"inconsistent use of library definitions\" with two core.js locs +async function f4(p: Promise): Promise { + return await p; // error, number != bool +} + +// async arrow functions +// +var f5: () => Promise = async () => await 1; + +// async methods +// +class C { + async m() { + return 1; + } + async mt(a: T): Promise { + return a; + } + static async m(a): void { + await a; + } + // error, void != Promise + static async mt(a: T): Promise { + return a; + } +} + +// async function props +var obj = { f: async () => await 1 }; +var objf: () => Promise = obj.f; +" +`; + +exports[`test async_base_class.js 1`] = ` +"// This is kind of weird, but it should parse. This works in babel without the +// parens around (await promise). From the es6 and async/await specs I (nmote) +// am not clear on whether it should. In any case it\'s a strange corner case +// that is probably not important to support. +class C {}; + +var P: Promise> = new Promise(function (resolve, reject) { + resolve(C); +}); + +async function foo() { + class Bar extends (await P) { } + return Bar; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// This is kind of weird, but it should parse. This works in babel without the +// parens around (await promise). From the es6 and async/await specs I (nmote) +// am not clear on whether it should. In any case it\'s a strange corner case +// that is probably not important to support. +class C {} + +var P: Promise> = new Promise(function(resolve, reject) { + resolve(C); +}); + +async function foo() { + class Bar extends (await P) {} + return Bar; +} +" +`; + +exports[`test async_parse.js 1`] = ` +"async function f() {} +async function ft(a: T) {} + +class C { + async m() {} + async mt(a: T) {} + static async m(a) {} + static async mt(a: T) {} +} + +var e = async function () {}; +var et = async function (a: T) {}; + +var n = new async function() {}; + +var o = { async m() {} }; +var ot = { async m(a: T) {} }; +var oz = { async async() {} }; + +var x = { async : 5 }; +console.log(x.async); + +var async = 3; +var y = { async }; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +async function f() {} +async function ft(a: T) {} + +class C { + async m() {} + async mt(a: T) {} + static async m(a) {} + static async mt(a: T) {} +} + +var e = async function() {}; +var et = async function(a: T) {}; + +var n = new (async function() {})(); + +var o = { async m() {} }; +var ot = { async m(a: T) {} }; +var oz = { async async() {} }; + +var x = { async: 5 }; +console.log(x.async); + +var async = 3; +var y = { async }; +" +`; + +exports[`test async_promise.js 1`] = ` +"async function f(): Promise { + return Promise.resolve(1); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +async function f(): Promise { + return Promise.resolve(1); +} +" +`; + +exports[`test async_return_void.js 1`] = ` +"// @flow + +async function foo1(): Promise { + return; +} + +async function foo2(): Promise { + return undefined; +} + +async function foo3(): Promise { + function bar() { } + return bar(); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +async function foo1(): Promise { + return; +} + +async function foo2(): Promise { + return undefined; +} + +async function foo3(): Promise { + function bar() {} + return bar(); +} +" +`; + +exports[`test async2.js 1`] = ` +"// @flow + +// misc basic + +function test1() { + async function foo() { + return 42; + } + + async function bar() { + var a = await foo(); + var b: number = a; // valid + var c: string = a; // Error: number ~> string + } +} + +// +// void returns: +// + +// inference should produce return type Promise +// in the absence of an explicit return +// + +function test2() { + async function voidoid1() { + console.log(\"HEY\"); + } + + var voidoid2: () => Promise = voidoid1; // ok + + var voidoid3: () => void = voidoid1; // error, void != Promise +} + +// annotated return type of Promise should work +// + +function test3() { + async function voidoid4(): Promise { // ok + console.log(\"HEY\"); + } +} + +// other annotated return types should fail +// (note: misannotated return types with explicit +// return statements are covered in async.js) +// + +function test4() { + async function voidoid5(): void { // error, void != Promise + console.log(\"HEY\"); + } +} + +function test5() { + async function voidoid6() + : Promise { // error, number != void + console.log(\"HEY\"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +// misc basic + +function test1() { + async function foo() { + return 42; + } + + async function bar() { + var a = await foo(); + var b: number = a; + // valid + var c: string = a; // Error: number ~> string + } +} + +// +// void returns: +// +// inference should produce return type Promise +// in the absence of an explicit return +// +function test2() { + async function voidoid1() { + console.log(\"HEY\"); + } + + var voidoid2: () => Promise = voidoid1; + + // ok + var voidoid3: () => void = voidoid1; // error, void != Promise +} + +// annotated return type of Promise should work +// +function test3() { + async function voidoid4(): Promise { + // ok + console.log(\"HEY\"); + } +} + +// other annotated return types should fail +// (note: misannotated return types with explicit +// return statements are covered in async.js) +// +function test4() { + async function voidoid5(): void { + // error, void != Promise + console.log(\"HEY\"); + } +} + +function test5() { + async function voidoid6(): Promise { + // error, number != void + console.log(\"HEY\"); + } +} +" +`; + +exports[`test async3.js 1`] = ` +"// @flow + +/** + * test nested-promise unwrapping. + * Note: currently we don\'t do this properly in the underlying + * type of the Promise class, which causes spurious errors to + * be raised here. Once that\'s fixed, the errors here will go + * away. + */ + +async function foo() { + return 42; +} + +async function bar() { + return foo(); +} + +async function baz() { + + // a should now be typed as number, but is in fact + // Promise until nested-promise unwrap is fixed + var a = await bar(); + + // TODO this is valid code, but currently gives Promise ~> number error + // due to lack of transitive Promise unwrap. + var b: number = a; + + // should be number ~> string error, but currently gives + // Promise ~> string error for the same reason + var c: string = a; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +/** + * test nested-promise unwrapping. + * Note: currently we don\'t do this properly in the underlying + * type of the Promise class, which causes spurious errors to + * be raised here. Once that\'s fixed, the errors here will go + * away. + */ + +async function foo() { + return 42; +} + +async function bar() { + return foo(); +} + +async function baz() { + // a should now be typed as number, but is in fact + // Promise until nested-promise unwrap is fixed + var a = await bar(); + + // TODO this is valid code, but currently gives Promise ~> number error + // due to lack of transitive Promise unwrap. + var b: number = a; + + // should be number ~> string error, but currently gives + // Promise ~> string error for the same reason + var c: string = a; +} +" +`; + +exports[`test await_parse.js 1`] = ` +"async function f() { await 1; } +async function ft(a: T) { await 1; } + +class C { + async m() { await 1; } + async mt(a: T) { await 1; } + static async m(a) { await 1; } + static async mt(a: T) { await 1; } +} + +var e = async function () { await 1; }; +var et = async function (a: T) { await 1; }; + +var n = new async function() { await 1; }; + +var o = { async m() { await 1; } }; +var ot = { async m(a: T) { await 1; } }; +var oz = { async async(async) { await async; } }; + +var x = { await : 5 }; +console.log(x.await); + +var await = 3; +var y = { await }; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +async function f() { + await 1; +} +async function ft(a: T) { + await 1; +} + +class C { + async m() { + await 1; + } + async mt(a: T) { + await 1; + } + static async m(a) { + await 1; + } + static async mt(a: T) { + await 1; + } +} + +var e = async function() { + await 1; +}; +var et = async function(a: T) { + await 1; +}; + +var n = new (async function() { + await 1; +})(); + +var o = { + async m() { + await 1; + } +}; +var ot = { + async m(a: T) { + await 1; + } +}; +var oz = { + async async(async) { + await async; + } +}; + +var x = { await: 5 }; +console.log(x.await); + +var await = 3; +var y = { await }; +" +`; diff --git a/tests/async/async.js b/tests/flow/async/async.js similarity index 100% rename from tests/async/async.js rename to tests/flow/async/async.js diff --git a/tests/async/async2.js b/tests/flow/async/async2.js similarity index 100% rename from tests/async/async2.js rename to tests/flow/async/async2.js diff --git a/tests/async/async3.js b/tests/flow/async/async3.js similarity index 100% rename from tests/async/async3.js rename to tests/flow/async/async3.js diff --git a/tests/async/async_base_class.js b/tests/flow/async/async_base_class.js similarity index 100% rename from tests/async/async_base_class.js rename to tests/flow/async/async_base_class.js diff --git a/tests/async/async_parse.js b/tests/flow/async/async_parse.js similarity index 100% rename from tests/async/async_parse.js rename to tests/flow/async/async_parse.js diff --git a/tests/async/async_promise.js b/tests/flow/async/async_promise.js similarity index 100% rename from tests/async/async_promise.js rename to tests/flow/async/async_promise.js diff --git a/tests/async/async_return_void.js b/tests/flow/async/async_return_void.js similarity index 100% rename from tests/async/async_return_void.js rename to tests/flow/async/async_return_void.js diff --git a/tests/flow/async/await_parse.js b/tests/flow/async/await_parse.js new file mode 100644 index 00000000..10149204 --- /dev/null +++ b/tests/flow/async/await_parse.js @@ -0,0 +1,24 @@ +async function f() { await 1; } +async function ft(a: T) { await 1; } + +class C { + async m() { await 1; } + async mt(a: T) { await 1; } + static async m(a) { await 1; } + static async mt(a: T) { await 1; } +} + +var e = async function () { await 1; }; +var et = async function (a: T) { await 1; }; + +var n = new async function() { await 1; }; + +var o = { async m() { await 1; } }; +var ot = { async m(a: T) { await 1; } }; +var oz = { async async(async) { await async; } }; + +var x = { await : 5 }; +console.log(x.await); + +var await = 3; +var y = { await }; diff --git a/tests/bom/jsfmt.spec.js b/tests/flow/async/jsfmt.spec.js similarity index 100% rename from tests/bom/jsfmt.spec.js rename to tests/flow/async/jsfmt.spec.js diff --git a/tests/async_iteration/__snapshots__/jsfmt.spec.js.snap b/tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/async_iteration/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/async_iteration/delegate_yield.js b/tests/flow/async_iteration/delegate_yield.js similarity index 100% rename from tests/async_iteration/delegate_yield.js rename to tests/flow/async_iteration/delegate_yield.js diff --git a/tests/async_iteration/generator.js b/tests/flow/async_iteration/generator.js similarity index 100% rename from tests/async_iteration/generator.js rename to tests/flow/async_iteration/generator.js diff --git a/tests/bounded_poly/jsfmt.spec.js b/tests/flow/async_iteration/jsfmt.spec.js similarity index 100% rename from tests/bounded_poly/jsfmt.spec.js rename to tests/flow/async_iteration/jsfmt.spec.js diff --git a/tests/async_iteration/return.js b/tests/flow/async_iteration/return.js similarity index 100% rename from tests/async_iteration/return.js rename to tests/flow/async_iteration/return.js diff --git a/tests/async_iteration/throw.js b/tests/flow/async_iteration/throw.js similarity index 100% rename from tests/async_iteration/throw.js rename to tests/flow/async_iteration/throw.js diff --git a/tests/autocomplete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/autocomplete/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/autocomplete/customfun.js b/tests/flow/autocomplete/customfun.js similarity index 100% rename from tests/autocomplete/customfun.js rename to tests/flow/autocomplete/customfun.js diff --git a/tests/break/jsfmt.spec.js b/tests/flow/autocomplete/jsfmt.spec.js similarity index 100% rename from tests/break/jsfmt.spec.js rename to tests/flow/autocomplete/jsfmt.spec.js diff --git a/tests/autocomplete/unknown.js b/tests/flow/autocomplete/unknown.js similarity index 100% rename from tests/autocomplete/unknown.js rename to tests/flow/autocomplete/unknown.js diff --git a/tests/auxiliary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/auxiliary/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/auxiliary/client.js b/tests/flow/auxiliary/client.js similarity index 100% rename from tests/auxiliary/client.js rename to tests/flow/auxiliary/client.js diff --git a/tests/builtin_uses/jsfmt.spec.js b/tests/flow/auxiliary/jsfmt.spec.js similarity index 100% rename from tests/builtin_uses/jsfmt.spec.js rename to tests/flow/auxiliary/jsfmt.spec.js diff --git a/tests/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/builtins/jsfmt.spec.js b/tests/flow/auxiliary/lib/jsfmt.spec.js similarity index 100% rename from tests/builtins/jsfmt.spec.js rename to tests/flow/auxiliary/lib/jsfmt.spec.js diff --git a/tests/auxiliary/lib/lib.js b/tests/flow/auxiliary/lib/lib.js similarity index 100% rename from tests/auxiliary/lib/lib.js rename to tests/flow/auxiliary/lib/lib.js diff --git a/tests/binary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/binary/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/binary/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/binary/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/binary/in.js b/tests/flow/binary/in.js similarity index 100% rename from tests/binary/in.js rename to tests/flow/binary/in.js diff --git a/tests/call_properties/jsfmt.spec.js b/tests/flow/binary/jsfmt.spec.js similarity index 100% rename from tests/call_properties/jsfmt.spec.js rename to tests/flow/binary/jsfmt.spec.js diff --git a/tests/binding/__snapshots__/jsfmt.spec.js.snap b/tests/flow/binding/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/binding/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/binding/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/binding/const.js b/tests/flow/binding/const.js similarity index 100% rename from tests/binding/const.js rename to tests/flow/binding/const.js diff --git a/tests/callable/jsfmt.spec.js b/tests/flow/binding/jsfmt.spec.js similarity index 100% rename from tests/callable/jsfmt.spec.js rename to tests/flow/binding/jsfmt.spec.js diff --git a/tests/binding/rebinding.js b/tests/flow/binding/rebinding.js similarity index 100% rename from tests/binding/rebinding.js rename to tests/flow/binding/rebinding.js diff --git a/tests/binding/scope.js b/tests/flow/binding/scope.js similarity index 100% rename from tests/binding/scope.js rename to tests/flow/binding/scope.js diff --git a/tests/binding/tdz.js b/tests/flow/binding/tdz.js similarity index 100% rename from tests/binding/tdz.js rename to tests/flow/binding/tdz.js diff --git a/tests/bom/FormData.js b/tests/flow/bom/FormData.js similarity index 100% rename from tests/bom/FormData.js rename to tests/flow/bom/FormData.js diff --git a/tests/bom/MutationObserver.js b/tests/flow/bom/MutationObserver.js similarity index 100% rename from tests/bom/MutationObserver.js rename to tests/flow/bom/MutationObserver.js diff --git a/tests/bom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/bom/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/bom/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/bom/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/check-contents/jsfmt.spec.js b/tests/flow/bom/jsfmt.spec.js similarity index 100% rename from tests/check-contents/jsfmt.spec.js rename to tests/flow/bom/jsfmt.spec.js diff --git a/tests/bounded_poly/__snapshots__/jsfmt.spec.js.snap b/tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/bounded_poly/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/class_munging/jsfmt.spec.js b/tests/flow/bounded_poly/jsfmt.spec.js similarity index 100% rename from tests/class_munging/jsfmt.spec.js rename to tests/flow/bounded_poly/jsfmt.spec.js diff --git a/tests/bounded_poly/scope.js b/tests/flow/bounded_poly/scope.js similarity index 100% rename from tests/bounded_poly/scope.js rename to tests/flow/bounded_poly/scope.js diff --git a/tests/bounded_poly/test.js b/tests/flow/bounded_poly/test.js similarity index 100% rename from tests/bounded_poly/test.js rename to tests/flow/bounded_poly/test.js diff --git a/tests/break/__snapshots__/jsfmt.spec.js.snap b/tests/flow/break/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/break/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/break/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/break/break.js b/tests/flow/break/break.js similarity index 100% rename from tests/break/break.js rename to tests/flow/break/break.js diff --git a/tests/class_statics/jsfmt.spec.js b/tests/flow/break/jsfmt.spec.js similarity index 100% rename from tests/class_statics/jsfmt.spec.js rename to tests/flow/break/jsfmt.spec.js diff --git a/tests/builtin_uses/__snapshots__/jsfmt.spec.js.snap b/tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/builtin_uses/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/class_subtyping/jsfmt.spec.js b/tests/flow/builtin_uses/jsfmt.spec.js similarity index 100% rename from tests/class_subtyping/jsfmt.spec.js rename to tests/flow/builtin_uses/jsfmt.spec.js diff --git a/tests/builtin_uses/test.js b/tests/flow/builtin_uses/test.js similarity index 100% rename from tests/builtin_uses/test.js rename to tests/flow/builtin_uses/test.js diff --git a/tests/builtin_uses/test2.js b/tests/flow/builtin_uses/test2.js similarity index 100% rename from tests/builtin_uses/test2.js rename to tests/flow/builtin_uses/test2.js diff --git a/tests/builtins/__snapshots__/jsfmt.spec.js.snap b/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/builtins/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/builtins/array.js b/tests/flow/builtins/array.js similarity index 100% rename from tests/builtins/array.js rename to tests/flow/builtins/array.js diff --git a/tests/builtins/genericfoo.js b/tests/flow/builtins/genericfoo.js similarity index 100% rename from tests/builtins/genericfoo.js rename to tests/flow/builtins/genericfoo.js diff --git a/tests/class_type/jsfmt.spec.js b/tests/flow/builtins/jsfmt.spec.js similarity index 100% rename from tests/class_type/jsfmt.spec.js rename to tests/flow/builtins/jsfmt.spec.js diff --git a/tests/call_properties/A.js b/tests/flow/call_properties/A.js similarity index 100% rename from tests/call_properties/A.js rename to tests/flow/call_properties/A.js diff --git a/tests/call_properties/B.js b/tests/flow/call_properties/B.js similarity index 100% rename from tests/call_properties/B.js rename to tests/flow/call_properties/B.js diff --git a/tests/call_properties/C.js b/tests/flow/call_properties/C.js similarity index 100% rename from tests/call_properties/C.js rename to tests/flow/call_properties/C.js diff --git a/tests/call_properties/D.js b/tests/flow/call_properties/D.js similarity index 100% rename from tests/call_properties/D.js rename to tests/flow/call_properties/D.js diff --git a/tests/call_properties/E.js b/tests/flow/call_properties/E.js similarity index 100% rename from tests/call_properties/E.js rename to tests/flow/call_properties/E.js diff --git a/tests/call_properties/F.js b/tests/flow/call_properties/F.js similarity index 100% rename from tests/call_properties/F.js rename to tests/flow/call_properties/F.js diff --git a/tests/call_properties/__snapshots__/jsfmt.spec.js.snap b/tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/call_properties/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/closure/jsfmt.spec.js b/tests/flow/call_properties/jsfmt.spec.js similarity index 100% rename from tests/closure/jsfmt.spec.js rename to tests/flow/call_properties/jsfmt.spec.js diff --git a/tests/callable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/callable/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/callable/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/callable/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/commonjs/jsfmt.spec.js b/tests/flow/callable/jsfmt.spec.js similarity index 100% rename from tests/commonjs/jsfmt.spec.js rename to tests/flow/callable/jsfmt.spec.js diff --git a/tests/callable/optional.js b/tests/flow/callable/optional.js similarity index 100% rename from tests/callable/optional.js rename to tests/flow/callable/optional.js diff --git a/tests/callable/primitives.js b/tests/flow/callable/primitives.js similarity index 100% rename from tests/callable/primitives.js rename to tests/flow/callable/primitives.js diff --git a/tests/check-contents/__snapshots__/jsfmt.spec.js.snap b/tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/check-contents/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/conditional/jsfmt.spec.js b/tests/flow/check-contents/jsfmt.spec.js similarity index 100% rename from tests/conditional/jsfmt.spec.js rename to tests/flow/check-contents/jsfmt.spec.js diff --git a/tests/check-contents/not_flow.js b/tests/flow/check-contents/not_flow.js similarity index 100% rename from tests/check-contents/not_flow.js rename to tests/flow/check-contents/not_flow.js diff --git a/tests/class_munging/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/class_munging/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_all/jsfmt.spec.js b/tests/flow/class_munging/jsfmt.spec.js similarity index 100% rename from tests/config_all/jsfmt.spec.js rename to tests/flow/class_munging/jsfmt.spec.js diff --git a/tests/class_munging/with_munging.js b/tests/flow/class_munging/with_munging.js similarity index 100% rename from tests/class_munging/with_munging.js rename to tests/flow/class_munging/with_munging.js diff --git a/tests/class_munging/without_munging.js b/tests/flow/class_munging/without_munging.js similarity index 100% rename from tests/class_munging/without_munging.js rename to tests/flow/class_munging/without_munging.js diff --git a/tests/class_statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/class_statics/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_all_false/jsfmt.spec.js b/tests/flow/class_statics/jsfmt.spec.js similarity index 100% rename from tests/config_all_false/jsfmt.spec.js rename to tests/flow/class_statics/jsfmt.spec.js diff --git a/tests/class_statics/test.js b/tests/flow/class_statics/test.js similarity index 100% rename from tests/class_statics/test.js rename to tests/flow/class_statics/test.js diff --git a/tests/class_subtyping/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/class_subtyping/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_all_weak/jsfmt.spec.js b/tests/flow/class_subtyping/jsfmt.spec.js similarity index 100% rename from tests/config_all_weak/jsfmt.spec.js rename to tests/flow/class_subtyping/jsfmt.spec.js diff --git a/tests/class_subtyping/test.js b/tests/flow/class_subtyping/test.js similarity index 100% rename from tests/class_subtyping/test.js rename to tests/flow/class_subtyping/test.js diff --git a/tests/class_subtyping/test2.js b/tests/flow/class_subtyping/test2.js similarity index 100% rename from tests/class_subtyping/test2.js rename to tests/flow/class_subtyping/test2.js diff --git a/tests/class_subtyping/test3.js b/tests/flow/class_subtyping/test3.js similarity index 100% rename from tests/class_subtyping/test3.js rename to tests/flow/class_subtyping/test3.js diff --git a/tests/class_subtyping/test4.js b/tests/flow/class_subtyping/test4.js similarity index 100% rename from tests/class_subtyping/test4.js rename to tests/flow/class_subtyping/test4.js diff --git a/tests/class_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/class_type/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_file_extensions/jsfmt.spec.js b/tests/flow/class_type/jsfmt.spec.js similarity index 100% rename from tests/config_file_extensions/jsfmt.spec.js rename to tests/flow/class_type/jsfmt.spec.js diff --git a/tests/class_type/test.js b/tests/flow/class_type/test.js similarity index 100% rename from tests/class_type/test.js rename to tests/flow/class_type/test.js diff --git a/tests/class_type/test2.js b/tests/flow/class_type/test2.js similarity index 100% rename from tests/class_type/test2.js rename to tests/flow/class_type/test2.js diff --git a/tests/classes/A.js b/tests/flow/classes/A.js similarity index 100% rename from tests/classes/A.js rename to tests/flow/classes/A.js diff --git a/tests/classes/B.js b/tests/flow/classes/B.js similarity index 100% rename from tests/classes/B.js rename to tests/flow/classes/B.js diff --git a/tests/classes/C.js b/tests/flow/classes/C.js similarity index 100% rename from tests/classes/C.js rename to tests/flow/classes/C.js diff --git a/tests/classes/D.js b/tests/flow/classes/D.js similarity index 100% rename from tests/classes/D.js rename to tests/flow/classes/D.js diff --git a/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap b/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..59a852e7 --- /dev/null +++ b/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,276 @@ +exports[`test A.js 1`] = ` +"class A { + foo(x:number):void { } +} + +module.exports = A; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class A { + foo(x: number): void {} +} + +module.exports = A; +" +`; + +exports[`test B.js 1`] = ` +"var A = require(\'./A\'); + +class B extends A { } + +let b = new B(); +(b.foo: number); // error, number !~> function + +module.exports = B; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var A = require(\"./A\"); + +class B extends A {} + +let b = new B(); +(b.foo: number); + +// error, number !~> function +module.exports = B; +" +`; + +exports[`test C.js 1`] = ` +"var B = require(\'./B\'); + +class C extends B { + foo(x:string):void { } +} + +let c = new C(); +(c.foo: number); // error, number !~> function + +module.exports = C; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var B = require(\"./B\"); + +class C extends B { + foo(x: string): void {} +} + +let c = new C(); +(c.foo: number); + +// error, number !~> function +module.exports = C; +" +`; + +exports[`test D.js 1`] = ` +"class D { } +class E { } +new E().x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class D {} +class E {} +new E().x; +" +`; + +exports[`test class_shapes.js 1`] = ` +"/* @flow */ + +type Foo = { + a: string; // exists in TestClass + b: string; // doesn\'t exist + c?: ?string; // exists in TestClass, optional + d?: number; // doesn\'t exist +} + +class TestClass { + a: string; + c: ?string; +} + +var x = new TestClass(); + +x.a; // ok +x.b; // error, TestClass has no b +x.c; // ok +x.d; // error, TestClass has no d + +var y : Foo = x; +y.b; // error, doesn\'t exist in TestClass +y.d; // ok, it\'s optional + +class Test2Superclass { + a: number; // conflicts with cast to Foo + c: ?number; // conflicts with cast to Foo +} +class Test2Class extends Test2Superclass { + b: number; // conflicts with cast to Foo +} + +var z = new Test2Class(); +var w : Foo = z; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +type Foo = { + a: string, + // exists in TestClass + b: string, + // doesn\'t exist + c?: ?string, + // exists in TestClass, optional + d?: number /* doesn\'t exist*/ +}; + +class TestClass { + a: string; + c: ?string; +} + +var x = new TestClass(); + +x.a; +// ok +x.b; +// error, TestClass has no b +x.c; +// ok +x.d; + +// error, TestClass has no d +var y: Foo = x; +y.b; +// error, doesn\'t exist in TestClass +y.d; + +// ok, it\'s optional +class Test2Superclass { + a: number; + // conflicts with cast to Foo + c: ?number; // conflicts with cast to Foo +} +class Test2Class extends Test2Superclass { + b: number; // conflicts with cast to Foo +} + +var z = new Test2Class(); +var w: Foo = z; +" +`; + +exports[`test expr.js 1`] = ` +"var Bar = class Foo { + static factory(): Foo { // OK: Foo is a type in this scope + return new Foo() // OK: Foo is a runtime binding in this scope + } +}; + +var bar1: Bar = new Bar() // OK +var bar2: Bar = Bar.factory() // OK + +// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an +// unexpected failure in the above code. + +var B = class Baz { } +var b = new Baz(); // error: Baz is not a runtime binding in this scope + +var C = class Qux { } +var c: Qux = new C(); // error: Qux is not a type in this scope + +// OK: anon classes create no binding, but can be bound manually +var Anon = class { } +var anon: Anon = new Anon(); + +class Alias { } +var _Alias = class Alias { + static factory(): Alias { + return new Alias(); + } +} +var alias1: Alias = new _Alias(); // error: bad pun +var alias2: Alias = _Alias.factory(); // error: bad pun +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var Bar = class Foo { + static factory(): Foo { + // OK: Foo is a type in this scope + return new Foo(); // OK: Foo is a runtime binding in this scope + } +}; + +var bar1: Bar = new Bar(); +// OK +var bar2: Bar = Bar.factory(); + +// OK +// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an +// unexpected failure in the above code. +var B = class Baz {}; +var b = new Baz(); + +// error: Baz is not a runtime binding in this scope +var C = class Qux {}; +var c: Qux = new C(); + +// error: Qux is not a type in this scope +// OK: anon classes create no binding, but can be bound manually +var Anon = class {}; +var anon: Anon = new Anon(); + +class Alias {} +var _Alias = class Alias { + static factory(): Alias { + return new Alias(); + } +}; +var alias1: Alias = new _Alias(); +// error: bad pun +var alias2: Alias = _Alias.factory(); // error: bad pun +" +`; + +exports[`test loc.js 1`] = ` +"/* @flow */ + +type Foo = number + +class Foo {} // error, shadows type Foo +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +type Foo = number; + +class Foo {} // error, shadows type Foo +" +`; + +exports[`test statics.js 1`] = ` +"/* @flow */ + +class C { + static p: string; +} +C.p = \"hi\"; + +// Class static fields are compatible with object types +(C: {p:string}); // ok +(C: {p:number}); // errors, string ~> number & vice versa (unify) + +declare var o: {p:number}; +(o: Class); // error, object type incompatible with class type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +class C { + static p: string; +} +C.p = \"hi\"; + +// Class static fields are compatible with object types +(C: { p: string }); +// ok +(C: { p: number }); + +// errors, string ~> number & vice versa (unify) +declare var o: { p: number }; +(o: Class); // error, object type incompatible with class type +" +`; diff --git a/tests/classes/class_shapes.js b/tests/flow/classes/class_shapes.js similarity index 100% rename from tests/classes/class_shapes.js rename to tests/flow/classes/class_shapes.js diff --git a/tests/classes/expr.js b/tests/flow/classes/expr.js similarity index 100% rename from tests/classes/expr.js rename to tests/flow/classes/expr.js diff --git a/tests/config_ignore/dir/jsfmt.spec.js b/tests/flow/classes/jsfmt.spec.js similarity index 100% rename from tests/config_ignore/dir/jsfmt.spec.js rename to tests/flow/classes/jsfmt.spec.js diff --git a/tests/classes/loc.js b/tests/flow/classes/loc.js similarity index 100% rename from tests/classes/loc.js rename to tests/flow/classes/loc.js diff --git a/tests/classes/statics.js b/tests/flow/classes/statics.js similarity index 100% rename from tests/classes/statics.js rename to tests/flow/classes/statics.js diff --git a/tests/closure/Closure.js b/tests/flow/closure/Closure.js similarity index 100% rename from tests/closure/Closure.js rename to tests/flow/closure/Closure.js diff --git a/tests/closure/__snapshots__/jsfmt.spec.js.snap b/tests/flow/closure/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/closure/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/closure/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/closure/cond_havoc.js b/tests/flow/closure/cond_havoc.js similarity index 100% rename from tests/closure/cond_havoc.js rename to tests/flow/closure/cond_havoc.js diff --git a/tests/closure/const.js b/tests/flow/closure/const.js similarity index 100% rename from tests/closure/const.js rename to tests/flow/closure/const.js diff --git a/tests/config_ignore/jsfmt.spec.js b/tests/flow/closure/jsfmt.spec.js similarity index 100% rename from tests/config_ignore/jsfmt.spec.js rename to tests/flow/closure/jsfmt.spec.js diff --git a/tests/commonjs/Abs.js b/tests/flow/commonjs/Abs.js similarity index 100% rename from tests/commonjs/Abs.js rename to tests/flow/commonjs/Abs.js diff --git a/tests/commonjs/Rel.js b/tests/flow/commonjs/Rel.js similarity index 100% rename from tests/commonjs/Rel.js rename to tests/flow/commonjs/Rel.js diff --git a/tests/commonjs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/commonjs/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/jsfmt.spec.js b/tests/flow/commonjs/jsfmt.spec.js similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/jsfmt.spec.js rename to tests/flow/commonjs/jsfmt.spec.js diff --git a/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap b/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..518241ff --- /dev/null +++ b/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,139 @@ +exports[`test test.js 1`] = ` +"var ColorId = { + RED: \'R\', + GREEN: \'G\', + BLUE: \'B\', +}; + +var ColorNumber = { + RED: \'ff0000\', + GREEN: \'00ff00\', + BLUE: \'0000ff\', +}; + +var ColorIdToNumber = { + [ColorId.RED]: ColorNumber.RED, + [ColorId.GREEN]: ColorNumber.GREEN, + [ColorId.BLUE]: ColorNumber.BLUE, +}; + +(ColorIdToNumber[ColorId.RED]: \'ffffff\'); // oops + +ColorIdToNumber.XXX; // oops + +module.exports = { ColorId, ColorNumber }; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var ColorId = { RED: \"R\", GREEN: \"G\", BLUE: \"B\" }; + +var ColorNumber = { RED: \"ff0000\", GREEN: \"00ff00\", BLUE: \"0000ff\" }; + +var ColorIdToNumber = { + [ColorId.RED]: ColorNumber.RED, + [ColorId.GREEN]: ColorNumber.GREEN, + [ColorId.BLUE]: ColorNumber.BLUE +}; + +(ColorIdToNumber[ColorId.RED]: \"ffffff\"); + +// oops +ColorIdToNumber.XXX; + +// oops +module.exports = { ColorId, ColorNumber }; +" +`; + +exports[`test test2.js 1`] = ` +"var { ColorId, ColorNumber } = require(\'./test\'); +var ColorIdToNumber = { + [ColorId.RED]: ColorNumber.RED, + [ColorId.GREEN]: ColorNumber.GREEN, + [ColorId.BLUE]: ColorNumber.BLUE, +}; + +(ColorIdToNumber[ColorId.GREEN]: \'ffffff\'); // oops + +module.exports = ColorIdToNumber; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var { ColorId, ColorNumber } = require(\"./test\"); +var ColorIdToNumber = { + [ColorId.RED]: ColorNumber.RED, + [ColorId.GREEN]: ColorNumber.GREEN, + [ColorId.BLUE]: ColorNumber.BLUE +}; + +(ColorIdToNumber[ColorId.GREEN]: \"ffffff\"); + +// oops +module.exports = ColorIdToNumber; +" +`; + +exports[`test test3.js 1`] = ` +"var { ColorId } = require(\'./test\'); +var ColorIdToNumber = require(\'./test2\'); + +(ColorIdToNumber[ColorId.BLUE]: \'ffffff\'); // oops +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var { ColorId } = require(\"./test\"); +var ColorIdToNumber = require(\"./test2\"); + +(ColorIdToNumber[ColorId.BLUE]: \"ffffff\"); // oops +" +`; + +exports[`test test4.js 1`] = ` +"module.exports = \'hello\'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +module.exports = \"hello\"; +" +`; + +exports[`test test5.js 1`] = ` +"var hello = require(\'./test4\'); +var dummy = require(\'./test\'); +module.exports = { + ...dummy, + [hello]: \'world\', + ...dummy, +}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var hello = require(\"./test4\"); +var dummy = require(\"./test\"); +module.exports = { ...dummy, [hello]: \"world\", ...dummy }; +" +`; + +exports[`test test6.js 1`] = ` +"var o = require(\'./test5\'); +(o.hello: \'nothing\'); // oops +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var o = require(\"./test5\"); +(o.hello: \"nothing\"); // oops +" +`; + +exports[`test test7.js 1`] = ` +"var obj = {x: 0, m() { return this.x }} +var x: string = obj[\'m\'](); // error, number ~> string + +var arr = [function() { return this.length }]; +var y: string = arr[0](); // error: number ~> string +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var obj = { + x: 0, + m() { + return this.x; + } +}; +var x: string = obj[\"m\"](); + +// error, number ~> string +var arr = [ + function() { + return this.length; + } +]; +var y: string = arr[0](); // error: number ~> string +" +`; diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/jsfmt.spec.js b/tests/flow/computed_props/jsfmt.spec.js similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/jsfmt.spec.js rename to tests/flow/computed_props/jsfmt.spec.js diff --git a/tests/computed_props/test.js b/tests/flow/computed_props/test.js similarity index 100% rename from tests/computed_props/test.js rename to tests/flow/computed_props/test.js diff --git a/tests/computed_props/test2.js b/tests/flow/computed_props/test2.js similarity index 100% rename from tests/computed_props/test2.js rename to tests/flow/computed_props/test2.js diff --git a/tests/computed_props/test3.js b/tests/flow/computed_props/test3.js similarity index 100% rename from tests/computed_props/test3.js rename to tests/flow/computed_props/test3.js diff --git a/tests/computed_props/test4.js b/tests/flow/computed_props/test4.js similarity index 100% rename from tests/computed_props/test4.js rename to tests/flow/computed_props/test4.js diff --git a/tests/computed_props/test5.js b/tests/flow/computed_props/test5.js similarity index 100% rename from tests/computed_props/test5.js rename to tests/flow/computed_props/test5.js diff --git a/tests/computed_props/test6.js b/tests/flow/computed_props/test6.js similarity index 100% rename from tests/computed_props/test6.js rename to tests/flow/computed_props/test6.js diff --git a/tests/computed_props/test7.js b/tests/flow/computed_props/test7.js similarity index 100% rename from tests/computed_props/test7.js rename to tests/flow/computed_props/test7.js diff --git a/tests/conditional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/conditional/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/conditional/conditional.js b/tests/flow/conditional/conditional.js similarity index 100% rename from tests/conditional/conditional.js rename to tests/flow/conditional/conditional.js diff --git a/tests/config_module_name_mapper_filetype/jsfmt.spec.js b/tests/flow/conditional/jsfmt.spec.js similarity index 100% rename from tests/config_module_name_mapper_filetype/jsfmt.spec.js rename to tests/flow/conditional/jsfmt.spec.js diff --git a/tests/config_all/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_all/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_name_rewrite_haste/jsfmt.spec.js b/tests/flow/config_all/jsfmt.spec.js similarity index 100% rename from tests/config_module_name_rewrite_haste/jsfmt.spec.js rename to tests/flow/config_all/jsfmt.spec.js diff --git a/tests/config_all/no_at_flow.js b/tests/flow/config_all/no_at_flow.js similarity index 100% rename from tests/config_all/no_at_flow.js rename to tests/flow/config_all/no_at_flow.js diff --git a/tests/config_all_false/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_all_false/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_name_rewrite_node/jsfmt.spec.js b/tests/flow/config_all_false/jsfmt.spec.js similarity index 100% rename from tests/config_module_name_rewrite_node/jsfmt.spec.js rename to tests/flow/config_all_false/jsfmt.spec.js diff --git a/tests/config_all_false/no_at_flow.js b/tests/flow/config_all_false/no_at_flow.js similarity index 100% rename from tests/config_all_false/no_at_flow.js rename to tests/flow/config_all_false/no_at_flow.js diff --git a/tests/config_all_weak/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_all_weak/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/jsfmt.spec.js b/tests/flow/config_all_weak/jsfmt.spec.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/jsfmt.spec.js rename to tests/flow/config_all_weak/jsfmt.spec.js diff --git a/tests/config_all_weak/no_at_flow.js b/tests/flow/config_all_weak/no_at_flow.js similarity index 100% rename from tests/config_all_weak/no_at_flow.js rename to tests/flow/config_all_weak/no_at_flow.js diff --git a/tests/config_file_extensions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_file_extensions/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/jsfmt.spec.js b/tests/flow/config_file_extensions/jsfmt.spec.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/jsfmt.spec.js rename to tests/flow/config_file_extensions/jsfmt.spec.js diff --git a/tests/config_file_extensions/test.js b/tests/flow/config_file_extensions/test.js similarity index 100% rename from tests/config_file_extensions/test.js rename to tests/flow/config_file_extensions/test.js diff --git a/tests/config_ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_ignore/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_ignore/dir/foo.js b/tests/flow/config_ignore/dir/foo.js similarity index 100% rename from tests/config_ignore/dir/foo.js rename to tests/flow/config_ignore/dir/foo.js diff --git a/tests/config_module_system_node_resolve_dirname/jsfmt.spec.js b/tests/flow/config_ignore/dir/jsfmt.spec.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/jsfmt.spec.js rename to tests/flow/config_ignore/dir/jsfmt.spec.js diff --git a/tests/config_ignore/foo.js b/tests/flow/config_ignore/foo.js similarity index 100% rename from tests/config_ignore/foo.js rename to tests/flow/config_ignore/foo.js diff --git a/tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/jsfmt.spec.js b/tests/flow/config_ignore/jsfmt.spec.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/jsfmt.spec.js rename to tests/flow/config_ignore/jsfmt.spec.js diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/subdir/jsfmt.spec.js b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/jsfmt.spec.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/jsfmt.spec.js rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/jsfmt.spec.js diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/main.js b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/main.js similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/main.js rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/main.js diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_munging_underscores/jsfmt.spec.js b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/jsfmt.spec.js similarity index 100% rename from tests/config_munging_underscores/jsfmt.spec.js rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/jsfmt.spec.js diff --git a/tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/testmodule.js b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/testmodule.js similarity index 100% rename from tests/config_module_name_mapper_PROJECT_ROOT-1.0/src/testmodule.js rename to tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/testmodule.js diff --git a/tests/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_munging_underscores2/jsfmt.spec.js b/tests/flow/config_module_name_mapper_filetype/jsfmt.spec.js similarity index 100% rename from tests/config_munging_underscores2/jsfmt.spec.js rename to tests/flow/config_module_name_mapper_filetype/jsfmt.spec.js diff --git a/tests/config_module_name_mapper_filetype/test.js b/tests/flow/config_module_name_mapper_filetype/test.js similarity index 100% rename from tests/config_module_name_mapper_filetype/test.js rename to tests/flow/config_module_name_mapper_filetype/test.js diff --git a/tests/config_module_name_rewrite_haste/A.js b/tests/flow/config_module_name_rewrite_haste/A.js similarity index 100% rename from tests/config_module_name_rewrite_haste/A.js rename to tests/flow/config_module_name_rewrite_haste/A.js diff --git a/tests/config_module_name_rewrite_haste/Exists.js b/tests/flow/config_module_name_rewrite_haste/Exists.js similarity index 100% rename from tests/config_module_name_rewrite_haste/Exists.js rename to tests/flow/config_module_name_rewrite_haste/Exists.js diff --git a/tests/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/const_params/jsfmt.spec.js b/tests/flow/config_module_name_rewrite_haste/jsfmt.spec.js similarity index 100% rename from tests/const_params/jsfmt.spec.js rename to tests/flow/config_module_name_rewrite_haste/jsfmt.spec.js diff --git a/tests/config_module_name_rewrite_node/A.js b/tests/flow/config_module_name_rewrite_node/A.js similarity index 100% rename from tests/config_module_name_rewrite_node/A.js rename to tests/flow/config_module_name_rewrite_node/A.js diff --git a/tests/config_module_name_rewrite_node/Exists.js b/tests/flow/config_module_name_rewrite_node/Exists.js similarity index 100% rename from tests/config_module_name_rewrite_node/Exists.js rename to tests/flow/config_module_name_rewrite_node/Exists.js diff --git a/tests/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/constructor/jsfmt.spec.js b/tests/flow/config_module_name_rewrite_node/jsfmt.spec.js similarity index 100% rename from tests/constructor/jsfmt.spec.js rename to tests/flow/config_module_name_rewrite_node/jsfmt.spec.js diff --git a/tests/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/index.js b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/index.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/index.js rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/index.js diff --git a/tests/constructor_annots/jsfmt.spec.js b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/jsfmt.spec.js similarity index 100% rename from tests/constructor_annots/jsfmt.spec.js rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/jsfmt.spec.js diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/index.js b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/index.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/index.js rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/index.js diff --git a/tests/contents/ignore/jsfmt.spec.js b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/jsfmt.spec.js similarity index 100% rename from tests/contents/ignore/jsfmt.spec.js rename to tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/jsfmt.spec.js diff --git a/tests/contents/no_flow/jsfmt.spec.js b/tests/flow/config_module_system_node_resolve_dirname/jsfmt.spec.js similarity index 100% rename from tests/contents/no_flow/jsfmt.spec.js rename to tests/flow/config_module_system_node_resolve_dirname/jsfmt.spec.js diff --git a/tests/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/index.js b/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/index.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/index.js rename to tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/index.js diff --git a/tests/core_tests/jsfmt.spec.js b/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/jsfmt.spec.js similarity index 100% rename from tests/core_tests/jsfmt.spec.js rename to tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/jsfmt.spec.js diff --git a/tests/covariance/jsfmt.spec.js b/tests/flow/config_module_system_node_resolve_dirname/subdir/jsfmt.spec.js similarity index 100% rename from tests/covariance/jsfmt.spec.js rename to tests/flow/config_module_system_node_resolve_dirname/subdir/jsfmt.spec.js diff --git a/tests/config_module_system_node_resolve_dirname/subdir/sublevel.js b/tests/flow/config_module_system_node_resolve_dirname/subdir/sublevel.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/subdir/sublevel.js rename to tests/flow/config_module_system_node_resolve_dirname/subdir/sublevel.js diff --git a/tests/config_module_system_node_resolve_dirname/toplevel.js b/tests/flow/config_module_system_node_resolve_dirname/toplevel.js similarity index 100% rename from tests/config_module_system_node_resolve_dirname/toplevel.js rename to tests/flow/config_module_system_node_resolve_dirname/toplevel.js diff --git a/tests/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_munging_underscores/chain.js b/tests/flow/config_munging_underscores/chain.js similarity index 100% rename from tests/config_munging_underscores/chain.js rename to tests/flow/config_munging_underscores/chain.js diff --git a/tests/config_munging_underscores/commonjs_export.js b/tests/flow/config_munging_underscores/commonjs_export.js similarity index 100% rename from tests/config_munging_underscores/commonjs_export.js rename to tests/flow/config_munging_underscores/commonjs_export.js diff --git a/tests/config_munging_underscores/commonjs_import.js b/tests/flow/config_munging_underscores/commonjs_import.js similarity index 100% rename from tests/config_munging_underscores/commonjs_import.js rename to tests/flow/config_munging_underscores/commonjs_import.js diff --git a/tests/coverage/jsfmt.spec.js b/tests/flow/config_munging_underscores/jsfmt.spec.js similarity index 100% rename from tests/coverage/jsfmt.spec.js rename to tests/flow/config_munging_underscores/jsfmt.spec.js diff --git a/tests/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/config_munging_underscores2/chain.js b/tests/flow/config_munging_underscores2/chain.js similarity index 100% rename from tests/config_munging_underscores2/chain.js rename to tests/flow/config_munging_underscores2/chain.js diff --git a/tests/cycle/jsfmt.spec.js b/tests/flow/config_munging_underscores2/jsfmt.spec.js similarity index 100% rename from tests/cycle/jsfmt.spec.js rename to tests/flow/config_munging_underscores2/jsfmt.spec.js diff --git a/tests/const_params/__snapshots__/jsfmt.spec.js.snap b/tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/const_params/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/date/jsfmt.spec.js b/tests/flow/const_params/jsfmt.spec.js similarity index 100% rename from tests/date/jsfmt.spec.js rename to tests/flow/const_params/jsfmt.spec.js diff --git a/tests/const_params/test.js b/tests/flow/const_params/test.js similarity index 100% rename from tests/const_params/test.js rename to tests/flow/const_params/test.js diff --git a/tests/constructor/__snapshots__/jsfmt.spec.js.snap b/tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/constructor/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/constructor/constructor.js b/tests/flow/constructor/constructor.js similarity index 100% rename from tests/constructor/constructor.js rename to tests/flow/constructor/constructor.js diff --git a/tests/declaration_files_haste/external/_d3/jsfmt.spec.js b/tests/flow/constructor/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_haste/external/_d3/jsfmt.spec.js rename to tests/flow/constructor/jsfmt.spec.js diff --git a/tests/constructor_annots/__snapshots__/jsfmt.spec.js.snap b/tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/constructor_annots/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/constructor_annots/constructors.js b/tests/flow/constructor_annots/constructors.js similarity index 100% rename from tests/constructor_annots/constructors.js rename to tests/flow/constructor_annots/constructors.js diff --git a/tests/declaration_files_haste/foo/bar/jsfmt.spec.js b/tests/flow/constructor_annots/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_haste/foo/bar/jsfmt.spec.js rename to tests/flow/constructor_annots/jsfmt.spec.js diff --git a/tests/constructor_annots/test.js b/tests/flow/constructor_annots/test.js similarity index 100% rename from tests/constructor_annots/test.js rename to tests/flow/constructor_annots/test.js diff --git a/tests/contents/ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/contents/ignore/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/contents/ignore/dummy.js b/tests/flow/contents/ignore/dummy.js similarity index 100% rename from tests/contents/ignore/dummy.js rename to tests/flow/contents/ignore/dummy.js diff --git a/tests/declaration_files_haste/jsfmt.spec.js b/tests/flow/contents/ignore/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_haste/jsfmt.spec.js rename to tests/flow/contents/ignore/jsfmt.spec.js diff --git a/tests/contents/ignore/test.js b/tests/flow/contents/ignore/test.js similarity index 100% rename from tests/contents/ignore/test.js rename to tests/flow/contents/ignore/test.js diff --git a/tests/contents/no_flow/__snapshots__/jsfmt.spec.js.snap b/tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/contents/no_flow/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/contents/no_flow/dummy.js b/tests/flow/contents/no_flow/dummy.js similarity index 100% rename from tests/contents/no_flow/dummy.js rename to tests/flow/contents/no_flow/dummy.js diff --git a/tests/declaration_files_haste/ws/jsfmt.spec.js b/tests/flow/contents/no_flow/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_haste/ws/jsfmt.spec.js rename to tests/flow/contents/no_flow/jsfmt.spec.js diff --git a/tests/contents/no_flow/test.js b/tests/flow/contents/no_flow/test.js similarity index 100% rename from tests/contents/no_flow/test.js rename to tests/flow/contents/no_flow/test.js diff --git a/tests/core_tests/__snapshots__/jsfmt.spec.js.snap b/tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/core_tests/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/core_tests/boolean.js b/tests/flow/core_tests/boolean.js similarity index 100% rename from tests/core_tests/boolean.js rename to tests/flow/core_tests/boolean.js diff --git a/tests/declaration_files_haste/ws/test/jsfmt.spec.js b/tests/flow/core_tests/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_haste/ws/test/jsfmt.spec.js rename to tests/flow/core_tests/jsfmt.spec.js diff --git a/tests/core_tests/map.js b/tests/flow/core_tests/map.js similarity index 100% rename from tests/core_tests/map.js rename to tests/flow/core_tests/map.js diff --git a/tests/core_tests/regexp.js b/tests/flow/core_tests/regexp.js similarity index 100% rename from tests/core_tests/regexp.js rename to tests/flow/core_tests/regexp.js diff --git a/tests/core_tests/weakset.js b/tests/flow/core_tests/weakset.js similarity index 100% rename from tests/core_tests/weakset.js rename to tests/flow/core_tests/weakset.js diff --git a/tests/covariance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/covariance/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/external/_d3/jsfmt.spec.js b/tests/flow/covariance/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_haste/external/_d3/jsfmt.spec.js rename to tests/flow/covariance/jsfmt.spec.js diff --git a/tests/covariance/test.js b/tests/flow/covariance/test.js similarity index 100% rename from tests/covariance/test.js rename to tests/flow/covariance/test.js diff --git a/tests/coverage/__snapshots__/jsfmt.spec.js.snap b/tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/coverage/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/coverage/crash.js b/tests/flow/coverage/crash.js similarity index 100% rename from tests/coverage/crash.js rename to tests/flow/coverage/crash.js diff --git a/tests/coverage/declare_module.js b/tests/flow/coverage/declare_module.js similarity index 100% rename from tests/coverage/declare_module.js rename to tests/flow/coverage/declare_module.js diff --git a/tests/declaration_files_incremental_haste/foo/bar/jsfmt.spec.js b/tests/flow/coverage/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_haste/foo/bar/jsfmt.spec.js rename to tests/flow/coverage/jsfmt.spec.js diff --git a/tests/coverage/no_pragma.js b/tests/flow/coverage/no_pragma.js similarity index 100% rename from tests/coverage/no_pragma.js rename to tests/flow/coverage/no_pragma.js diff --git a/tests/coverage/non-termination.js b/tests/flow/coverage/non-termination.js similarity index 100% rename from tests/coverage/non-termination.js rename to tests/flow/coverage/non-termination.js diff --git a/tests/cycle/A.js b/tests/flow/cycle/A.js similarity index 100% rename from tests/cycle/A.js rename to tests/flow/cycle/A.js diff --git a/tests/cycle/B.js b/tests/flow/cycle/B.js similarity index 100% rename from tests/cycle/B.js rename to tests/flow/cycle/B.js diff --git a/tests/cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/cycle/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/jsfmt.spec.js b/tests/flow/cycle/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_haste/jsfmt.spec.js rename to tests/flow/cycle/jsfmt.spec.js diff --git a/tests/date/__snapshots__/jsfmt.spec.js.snap b/tests/flow/date/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/date/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/date/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/date/date.js b/tests/flow/date/date.js similarity index 100% rename from tests/date/date.js rename to tests/flow/date/date.js diff --git a/tests/declaration_files_incremental_haste/ws/jsfmt.spec.js b/tests/flow/date/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_haste/ws/jsfmt.spec.js rename to tests/flow/date/jsfmt.spec.js diff --git a/tests/declaration_files_haste/ExplicitProvidesModuleDifferentName.js b/tests/flow/declaration_files_haste/ExplicitProvidesModuleDifferentName.js similarity index 100% rename from tests/declaration_files_haste/ExplicitProvidesModuleDifferentName.js rename to tests/flow/declaration_files_haste/ExplicitProvidesModuleDifferentName.js diff --git a/tests/declaration_files_haste/ExplicitProvidesModuleSameName.js b/tests/flow/declaration_files_haste/ExplicitProvidesModuleSameName.js similarity index 100% rename from tests/declaration_files_haste/ExplicitProvidesModuleSameName.js rename to tests/flow/declaration_files_haste/ExplicitProvidesModuleSameName.js diff --git a/tests/declaration_files_haste/ImplicitProvidesModule.js b/tests/flow/declaration_files_haste/ImplicitProvidesModule.js similarity index 100% rename from tests/declaration_files_haste/ImplicitProvidesModule.js rename to tests/flow/declaration_files_haste/ImplicitProvidesModule.js diff --git a/tests/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/ws/test/jsfmt.spec.js b/tests/flow/declaration_files_haste/external/_d3/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_haste/ws/test/jsfmt.spec.js rename to tests/flow/declaration_files_haste/external/_d3/jsfmt.spec.js diff --git a/tests/declaration_files_haste/external/_d3/min.js b/tests/flow/declaration_files_haste/external/_d3/min.js similarity index 100% rename from tests/declaration_files_haste/external/_d3/min.js rename to tests/flow/declaration_files_haste/external/_d3/min.js diff --git a/tests/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_node/jsfmt.spec.js b/tests/flow/declaration_files_haste/foo/bar/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_incremental_node/jsfmt.spec.js rename to tests/flow/declaration_files_haste/foo/bar/jsfmt.spec.js diff --git a/tests/declaration_files_haste/foo/bar/nested_test.js b/tests/flow/declaration_files_haste/foo/bar/nested_test.js similarity index 100% rename from tests/declaration_files_haste/foo/bar/nested_test.js rename to tests/flow/declaration_files_haste/foo/bar/nested_test.js diff --git a/tests/declaration_files_node/jsfmt.spec.js b/tests/flow/declaration_files_haste/jsfmt.spec.js similarity index 100% rename from tests/declaration_files_node/jsfmt.spec.js rename to tests/flow/declaration_files_haste/jsfmt.spec.js diff --git a/tests/declaration_files_haste/md5.js b/tests/flow/declaration_files_haste/md5.js similarity index 100% rename from tests/declaration_files_haste/md5.js rename to tests/flow/declaration_files_haste/md5.js diff --git a/tests/declaration_files_haste/test.js b/tests/flow/declaration_files_haste/test.js similarity index 100% rename from tests/declaration_files_haste/test.js rename to tests/flow/declaration_files_haste/test.js diff --git a/tests/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_haste/ws/index.js b/tests/flow/declaration_files_haste/ws/index.js similarity index 100% rename from tests/declaration_files_haste/ws/index.js rename to tests/flow/declaration_files_haste/ws/index.js diff --git a/tests/declare_class/jsfmt.spec.js b/tests/flow/declaration_files_haste/ws/jsfmt.spec.js similarity index 100% rename from tests/declare_class/jsfmt.spec.js rename to tests/flow/declaration_files_haste/ws/jsfmt.spec.js diff --git a/tests/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_haste/ws/test/client.js b/tests/flow/declaration_files_haste/ws/test/client.js similarity index 100% rename from tests/declaration_files_haste/ws/test/client.js rename to tests/flow/declaration_files_haste/ws/test/client.js diff --git a/tests/declare_class/lib/jsfmt.spec.js b/tests/flow/declaration_files_haste/ws/test/jsfmt.spec.js similarity index 100% rename from tests/declare_class/lib/jsfmt.spec.js rename to tests/flow/declaration_files_haste/ws/test/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_haste/A.js b/tests/flow/declaration_files_incremental_haste/A.js similarity index 100% rename from tests/declaration_files_incremental_haste/A.js rename to tests/flow/declaration_files_incremental_haste/A.js diff --git a/tests/declaration_files_incremental_haste/ExplicitProvidesModuleDifferentName.js b/tests/flow/declaration_files_incremental_haste/ExplicitProvidesModuleDifferentName.js similarity index 100% rename from tests/declaration_files_incremental_haste/ExplicitProvidesModuleDifferentName.js rename to tests/flow/declaration_files_incremental_haste/ExplicitProvidesModuleDifferentName.js diff --git a/tests/declaration_files_incremental_haste/ExplicitProvidesModuleSameName.js b/tests/flow/declaration_files_incremental_haste/ExplicitProvidesModuleSameName.js similarity index 100% rename from tests/declaration_files_incremental_haste/ExplicitProvidesModuleSameName.js rename to tests/flow/declaration_files_incremental_haste/ExplicitProvidesModuleSameName.js diff --git a/tests/declaration_files_incremental_haste/ImplicitProvidesModule.js b/tests/flow/declaration_files_incremental_haste/ImplicitProvidesModule.js similarity index 100% rename from tests/declaration_files_incremental_haste/ImplicitProvidesModule.js rename to tests/flow/declaration_files_incremental_haste/ImplicitProvidesModule.js diff --git a/tests/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_export/jsfmt.spec.js b/tests/flow/declaration_files_incremental_haste/external/_d3/jsfmt.spec.js similarity index 100% rename from tests/declare_export/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_haste/external/_d3/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_haste/external/_d3/min.js b/tests/flow/declaration_files_incremental_haste/external/_d3/min.js similarity index 100% rename from tests/declaration_files_incremental_haste/external/_d3/min.js rename to tests/flow/declaration_files_incremental_haste/external/_d3/min.js diff --git a/tests/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_fun/jsfmt.spec.js b/tests/flow/declaration_files_incremental_haste/foo/bar/jsfmt.spec.js similarity index 100% rename from tests/declare_fun/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_haste/foo/bar/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_haste/foo/bar/nested_test.js b/tests/flow/declaration_files_incremental_haste/foo/bar/nested_test.js similarity index 100% rename from tests/declaration_files_incremental_haste/foo/bar/nested_test.js rename to tests/flow/declaration_files_incremental_haste/foo/bar/nested_test.js diff --git a/tests/declare_module_exports/flow-typed/jsfmt.spec.js b/tests/flow/declaration_files_incremental_haste/jsfmt.spec.js similarity index 100% rename from tests/declare_module_exports/flow-typed/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_haste/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_haste/md5.js b/tests/flow/declaration_files_incremental_haste/md5.js similarity index 100% rename from tests/declaration_files_incremental_haste/md5.js rename to tests/flow/declaration_files_incremental_haste/md5.js diff --git a/tests/declaration_files_incremental_haste/test.js b/tests/flow/declaration_files_incremental_haste/test.js similarity index 100% rename from tests/declaration_files_incremental_haste/test.js rename to tests/flow/declaration_files_incremental_haste/test.js diff --git a/tests/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/ws/index.js b/tests/flow/declaration_files_incremental_haste/ws/index.js similarity index 100% rename from tests/declaration_files_incremental_haste/ws/index.js rename to tests/flow/declaration_files_incremental_haste/ws/index.js diff --git a/tests/declare_module_exports/jsfmt.spec.js b/tests/flow/declaration_files_incremental_haste/ws/jsfmt.spec.js similarity index 100% rename from tests/declare_module_exports/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_haste/ws/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declaration_files_incremental_haste/ws/test/client.js b/tests/flow/declaration_files_incremental_haste/ws/test/client.js similarity index 100% rename from tests/declaration_files_incremental_haste/ws/test/client.js rename to tests/flow/declaration_files_incremental_haste/ws/test/client.js diff --git a/tests/declare_type/jsfmt.spec.js b/tests/flow/declaration_files_incremental_haste/ws/test/jsfmt.spec.js similarity index 100% rename from tests/declare_type/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_haste/ws/test/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_node/A.js b/tests/flow/declaration_files_incremental_node/A.js similarity index 100% rename from tests/declaration_files_incremental_node/A.js rename to tests/flow/declaration_files_incremental_node/A.js diff --git a/tests/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_type/lib/jsfmt.spec.js b/tests/flow/declaration_files_incremental_node/jsfmt.spec.js similarity index 100% rename from tests/declare_type/lib/jsfmt.spec.js rename to tests/flow/declaration_files_incremental_node/jsfmt.spec.js diff --git a/tests/declaration_files_incremental_node/test_absolute.js b/tests/flow/declaration_files_incremental_node/test_absolute.js similarity index 100% rename from tests/declaration_files_incremental_node/test_absolute.js rename to tests/flow/declaration_files_incremental_node/test_absolute.js diff --git a/tests/declaration_files_incremental_node/test_relative.js b/tests/flow/declaration_files_incremental_node/test_relative.js similarity index 100% rename from tests/declaration_files_incremental_node/test_relative.js rename to tests/flow/declaration_files_incremental_node/test_relative.js diff --git a/tests/declaration_files_node/A.js b/tests/flow/declaration_files_node/A.js similarity index 100% rename from tests/declaration_files_node/A.js rename to tests/flow/declaration_files_node/A.js diff --git a/tests/declaration_files_node/CJS.js b/tests/flow/declaration_files_node/CJS.js similarity index 100% rename from tests/declaration_files_node/CJS.js rename to tests/flow/declaration_files_node/CJS.js diff --git a/tests/declaration_files_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declaration_files_node/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/def_site_variance/jsfmt.spec.js b/tests/flow/declaration_files_node/jsfmt.spec.js similarity index 100% rename from tests/def_site_variance/jsfmt.spec.js rename to tests/flow/declaration_files_node/jsfmt.spec.js diff --git a/tests/declaration_files_node/test_absolute.js b/tests/flow/declaration_files_node/test_absolute.js similarity index 100% rename from tests/declaration_files_node/test_absolute.js rename to tests/flow/declaration_files_node/test_absolute.js diff --git a/tests/declaration_files_node/test_relative.js b/tests/flow/declaration_files_node/test_relative.js similarity index 100% rename from tests/declaration_files_node/test_relative.js rename to tests/flow/declaration_files_node/test_relative.js diff --git a/tests/declare_class/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_class/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_class/declare_class.js b/tests/flow/declare_class/declare_class.js similarity index 100% rename from tests/declare_class/declare_class.js rename to tests/flow/declare_class/declare_class.js diff --git a/tests/demo/1/jsfmt.spec.js b/tests/flow/declare_class/jsfmt.spec.js similarity index 100% rename from tests/demo/1/jsfmt.spec.js rename to tests/flow/declare_class/jsfmt.spec.js diff --git a/tests/declare_class/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_class/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/demo/2/jsfmt.spec.js b/tests/flow/declare_class/lib/jsfmt.spec.js similarity index 100% rename from tests/demo/2/jsfmt.spec.js rename to tests/flow/declare_class/lib/jsfmt.spec.js diff --git a/tests/declare_class/lib/test.js b/tests/flow/declare_class/lib/test.js similarity index 100% rename from tests/declare_class/lib/test.js rename to tests/flow/declare_class/lib/test.js diff --git a/tests/declare_export/B.js b/tests/flow/declare_export/B.js similarity index 100% rename from tests/declare_export/B.js rename to tests/flow/declare_export/B.js diff --git a/tests/declare_export/C.js b/tests/flow/declare_export/C.js similarity index 100% rename from tests/declare_export/C.js rename to tests/flow/declare_export/C.js diff --git a/tests/declare_export/CommonJS_Clobbering_Class.js b/tests/flow/declare_export/CommonJS_Clobbering_Class.js similarity index 100% rename from tests/declare_export/CommonJS_Clobbering_Class.js rename to tests/flow/declare_export/CommonJS_Clobbering_Class.js diff --git a/tests/declare_export/CommonJS_Clobbering_Lit.js b/tests/flow/declare_export/CommonJS_Clobbering_Lit.js similarity index 100% rename from tests/declare_export/CommonJS_Clobbering_Lit.js rename to tests/flow/declare_export/CommonJS_Clobbering_Lit.js diff --git a/tests/declare_export/CommonJS_Named.js b/tests/flow/declare_export/CommonJS_Named.js similarity index 100% rename from tests/declare_export/CommonJS_Named.js rename to tests/flow/declare_export/CommonJS_Named.js diff --git a/tests/declare_export/ES6_DefaultAndNamed.js b/tests/flow/declare_export/ES6_DefaultAndNamed.js similarity index 100% rename from tests/declare_export/ES6_DefaultAndNamed.js rename to tests/flow/declare_export/ES6_DefaultAndNamed.js diff --git a/tests/declare_export/ES6_Default_AnonFunction1.js b/tests/flow/declare_export/ES6_Default_AnonFunction1.js similarity index 100% rename from tests/declare_export/ES6_Default_AnonFunction1.js rename to tests/flow/declare_export/ES6_Default_AnonFunction1.js diff --git a/tests/declare_export/ES6_Default_AnonFunction2.js b/tests/flow/declare_export/ES6_Default_AnonFunction2.js similarity index 100% rename from tests/declare_export/ES6_Default_AnonFunction2.js rename to tests/flow/declare_export/ES6_Default_AnonFunction2.js diff --git a/tests/declare_export/ES6_Default_NamedClass1.js b/tests/flow/declare_export/ES6_Default_NamedClass1.js similarity index 100% rename from tests/declare_export/ES6_Default_NamedClass1.js rename to tests/flow/declare_export/ES6_Default_NamedClass1.js diff --git a/tests/declare_export/ES6_Default_NamedClass2.js b/tests/flow/declare_export/ES6_Default_NamedClass2.js similarity index 100% rename from tests/declare_export/ES6_Default_NamedClass2.js rename to tests/flow/declare_export/ES6_Default_NamedClass2.js diff --git a/tests/declare_export/ES6_Default_NamedFunction1.js b/tests/flow/declare_export/ES6_Default_NamedFunction1.js similarity index 100% rename from tests/declare_export/ES6_Default_NamedFunction1.js rename to tests/flow/declare_export/ES6_Default_NamedFunction1.js diff --git a/tests/declare_export/ES6_Default_NamedFunction2.js b/tests/flow/declare_export/ES6_Default_NamedFunction2.js similarity index 100% rename from tests/declare_export/ES6_Default_NamedFunction2.js rename to tests/flow/declare_export/ES6_Default_NamedFunction2.js diff --git a/tests/declare_export/ES6_ExportAllFromMulti.js b/tests/flow/declare_export/ES6_ExportAllFromMulti.js similarity index 100% rename from tests/declare_export/ES6_ExportAllFromMulti.js rename to tests/flow/declare_export/ES6_ExportAllFromMulti.js diff --git a/tests/declare_export/ES6_ExportAllFrom_Intermediary1.js b/tests/flow/declare_export/ES6_ExportAllFrom_Intermediary1.js similarity index 100% rename from tests/declare_export/ES6_ExportAllFrom_Intermediary1.js rename to tests/flow/declare_export/ES6_ExportAllFrom_Intermediary1.js diff --git a/tests/declare_export/ES6_ExportAllFrom_Intermediary2.js b/tests/flow/declare_export/ES6_ExportAllFrom_Intermediary2.js similarity index 100% rename from tests/declare_export/ES6_ExportAllFrom_Intermediary2.js rename to tests/flow/declare_export/ES6_ExportAllFrom_Intermediary2.js diff --git a/tests/declare_export/ES6_ExportAllFrom_Source1.js b/tests/flow/declare_export/ES6_ExportAllFrom_Source1.js similarity index 100% rename from tests/declare_export/ES6_ExportAllFrom_Source1.js rename to tests/flow/declare_export/ES6_ExportAllFrom_Source1.js diff --git a/tests/declare_export/ES6_ExportAllFrom_Source2.js b/tests/flow/declare_export/ES6_ExportAllFrom_Source2.js similarity index 100% rename from tests/declare_export/ES6_ExportAllFrom_Source2.js rename to tests/flow/declare_export/ES6_ExportAllFrom_Source2.js diff --git a/tests/declare_export/ES6_ExportFrom_Intermediary1.js b/tests/flow/declare_export/ES6_ExportFrom_Intermediary1.js similarity index 100% rename from tests/declare_export/ES6_ExportFrom_Intermediary1.js rename to tests/flow/declare_export/ES6_ExportFrom_Intermediary1.js diff --git a/tests/declare_export/ES6_ExportFrom_Intermediary2.js b/tests/flow/declare_export/ES6_ExportFrom_Intermediary2.js similarity index 100% rename from tests/declare_export/ES6_ExportFrom_Intermediary2.js rename to tests/flow/declare_export/ES6_ExportFrom_Intermediary2.js diff --git a/tests/declare_export/ES6_ExportFrom_Source1.js b/tests/flow/declare_export/ES6_ExportFrom_Source1.js similarity index 100% rename from tests/declare_export/ES6_ExportFrom_Source1.js rename to tests/flow/declare_export/ES6_ExportFrom_Source1.js diff --git a/tests/declare_export/ES6_ExportFrom_Source2.js b/tests/flow/declare_export/ES6_ExportFrom_Source2.js similarity index 100% rename from tests/declare_export/ES6_ExportFrom_Source2.js rename to tests/flow/declare_export/ES6_ExportFrom_Source2.js diff --git a/tests/declare_export/ES6_Named1.js b/tests/flow/declare_export/ES6_Named1.js similarity index 100% rename from tests/declare_export/ES6_Named1.js rename to tests/flow/declare_export/ES6_Named1.js diff --git a/tests/declare_export/ES6_Named2.js b/tests/flow/declare_export/ES6_Named2.js similarity index 100% rename from tests/declare_export/ES6_Named2.js rename to tests/flow/declare_export/ES6_Named2.js diff --git a/tests/declare_export/ProvidesModuleA.js b/tests/flow/declare_export/ProvidesModuleA.js similarity index 100% rename from tests/declare_export/ProvidesModuleA.js rename to tests/flow/declare_export/ProvidesModuleA.js diff --git a/tests/declare_export/ProvidesModuleCJSDefault.js b/tests/flow/declare_export/ProvidesModuleCJSDefault.js similarity index 100% rename from tests/declare_export/ProvidesModuleCJSDefault.js rename to tests/flow/declare_export/ProvidesModuleCJSDefault.js diff --git a/tests/declare_export/ProvidesModuleD.js b/tests/flow/declare_export/ProvidesModuleD.js similarity index 100% rename from tests/declare_export/ProvidesModuleD.js rename to tests/flow/declare_export/ProvidesModuleD.js diff --git a/tests/declare_export/ProvidesModuleES6Default.js b/tests/flow/declare_export/ProvidesModuleES6Default.js similarity index 100% rename from tests/declare_export/ProvidesModuleES6Default.js rename to tests/flow/declare_export/ProvidesModuleES6Default.js diff --git a/tests/declare_export/SideEffects.js b/tests/flow/declare_export/SideEffects.js similarity index 100% rename from tests/declare_export/SideEffects.js rename to tests/flow/declare_export/SideEffects.js diff --git a/tests/declare_export/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_export/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_export/es6modules.js b/tests/flow/declare_export/es6modules.js similarity index 100% rename from tests/declare_export/es6modules.js rename to tests/flow/declare_export/es6modules.js diff --git a/tests/deps/jsfmt.spec.js b/tests/flow/declare_export/jsfmt.spec.js similarity index 100% rename from tests/deps/jsfmt.spec.js rename to tests/flow/declare_export/jsfmt.spec.js diff --git a/tests/declare_fun/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_fun/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/destructuring/jsfmt.spec.js b/tests/flow/declare_fun/jsfmt.spec.js similarity index 100% rename from tests/destructuring/jsfmt.spec.js rename to tests/flow/declare_fun/jsfmt.spec.js diff --git a/tests/declare_fun/test.js b/tests/flow/declare_fun/test.js similarity index 100% rename from tests/declare_fun/test.js rename to tests/flow/declare_fun/test.js diff --git a/tests/declare_module_exports/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_module_exports/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/dictionary/jsfmt.spec.js b/tests/flow/declare_module_exports/flow-typed/jsfmt.spec.js similarity index 100% rename from tests/dictionary/jsfmt.spec.js rename to tests/flow/declare_module_exports/flow-typed/jsfmt.spec.js diff --git a/tests/declare_module_exports/flow-typed/libs.js b/tests/flow/declare_module_exports/flow-typed/libs.js similarity index 100% rename from tests/declare_module_exports/flow-typed/libs.js rename to tests/flow/declare_module_exports/flow-typed/libs.js diff --git a/tests/disjoint-union-perf/jsfmt.spec.js b/tests/flow/declare_module_exports/jsfmt.spec.js similarity index 100% rename from tests/disjoint-union-perf/jsfmt.spec.js rename to tests/flow/declare_module_exports/jsfmt.spec.js diff --git a/tests/declare_module_exports/main.js b/tests/flow/declare_module_exports/main.js similarity index 100% rename from tests/declare_module_exports/main.js rename to tests/flow/declare_module_exports/main.js diff --git a/tests/declare_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_type/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_type/import_declare_type.js b/tests/flow/declare_type/import_declare_type.js similarity index 100% rename from tests/declare_type/import_declare_type.js rename to tests/flow/declare_type/import_declare_type.js diff --git a/tests/docblock_flow/jsfmt.spec.js b/tests/flow/declare_type/jsfmt.spec.js similarity index 100% rename from tests/docblock_flow/jsfmt.spec.js rename to tests/flow/declare_type/jsfmt.spec.js diff --git a/tests/declare_type/lib/DeclareModule_TypeAlias.js b/tests/flow/declare_type/lib/DeclareModule_TypeAlias.js similarity index 100% rename from tests/declare_type/lib/DeclareModule_TypeAlias.js rename to tests/flow/declare_type/lib/DeclareModule_TypeAlias.js diff --git a/tests/declare_type/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/declare_type/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/declare_type/lib/declare_type_exports.js b/tests/flow/declare_type/lib/declare_type_exports.js similarity index 100% rename from tests/declare_type/lib/declare_type_exports.js rename to tests/flow/declare_type/lib/declare_type_exports.js diff --git a/tests/dom/jsfmt.spec.js b/tests/flow/declare_type/lib/jsfmt.spec.js similarity index 100% rename from tests/dom/jsfmt.spec.js rename to tests/flow/declare_type/lib/jsfmt.spec.js diff --git a/tests/def_site_variance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/def_site_variance/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/dump-types/jsfmt.spec.js b/tests/flow/def_site_variance/jsfmt.spec.js similarity index 100% rename from tests/dump-types/jsfmt.spec.js rename to tests/flow/def_site_variance/jsfmt.spec.js diff --git a/tests/def_site_variance/test.js b/tests/flow/def_site_variance/test.js similarity index 100% rename from tests/def_site_variance/test.js rename to tests/flow/def_site_variance/test.js diff --git a/tests/demo/1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/demo/1/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/demo/1/f.js b/tests/flow/demo/1/f.js similarity index 100% rename from tests/demo/1/f.js rename to tests/flow/demo/1/f.js diff --git a/tests/duplicate_methods/jsfmt.spec.js b/tests/flow/demo/1/jsfmt.spec.js similarity index 100% rename from tests/duplicate_methods/jsfmt.spec.js rename to tests/flow/demo/1/jsfmt.spec.js diff --git a/tests/demo/2/A.js b/tests/flow/demo/2/A.js similarity index 100% rename from tests/demo/2/A.js rename to tests/flow/demo/2/A.js diff --git a/tests/demo/2/B.js b/tests/flow/demo/2/B.js similarity index 100% rename from tests/demo/2/B.js rename to tests/flow/demo/2/B.js diff --git a/tests/demo/2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/demo/2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/encaps/jsfmt.spec.js b/tests/flow/demo/2/jsfmt.spec.js similarity index 100% rename from tests/encaps/jsfmt.spec.js rename to tests/flow/demo/2/jsfmt.spec.js diff --git a/tests/deps/A.js b/tests/flow/deps/A.js similarity index 100% rename from tests/deps/A.js rename to tests/flow/deps/A.js diff --git a/tests/deps/B.js b/tests/flow/deps/B.js similarity index 100% rename from tests/deps/B.js rename to tests/flow/deps/B.js diff --git a/tests/deps/C.js b/tests/flow/deps/C.js similarity index 100% rename from tests/deps/C.js rename to tests/flow/deps/C.js diff --git a/tests/deps/D.js b/tests/flow/deps/D.js similarity index 100% rename from tests/deps/D.js rename to tests/flow/deps/D.js diff --git a/tests/deps/E.js b/tests/flow/deps/E.js similarity index 100% rename from tests/deps/E.js rename to tests/flow/deps/E.js diff --git a/tests/deps/F.js b/tests/flow/deps/F.js similarity index 100% rename from tests/deps/F.js rename to tests/flow/deps/F.js diff --git a/tests/deps/G.js b/tests/flow/deps/G.js similarity index 100% rename from tests/deps/G.js rename to tests/flow/deps/G.js diff --git a/tests/deps/H.js b/tests/flow/deps/H.js similarity index 100% rename from tests/deps/H.js rename to tests/flow/deps/H.js diff --git a/tests/deps/I.js b/tests/flow/deps/I.js similarity index 100% rename from tests/deps/I.js rename to tests/flow/deps/I.js diff --git a/tests/deps/__snapshots__/jsfmt.spec.js.snap b/tests/flow/deps/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/deps/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/deps/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/enumerror/jsfmt.spec.js b/tests/flow/deps/jsfmt.spec.js similarity index 100% rename from tests/enumerror/jsfmt.spec.js rename to tests/flow/deps/jsfmt.spec.js diff --git a/tests/destructuring/__snapshots__/jsfmt.spec.js.snap b/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap similarity index 99% rename from tests/destructuring/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap index fe1ca236..62a9ddcd 100644 --- a/tests/destructuring/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap @@ -406,7 +406,8 @@ exports[`test destructuring_param.js 1`] = ` return a + b; } -// TODO: These throw errors when parsing. +// Doesn\'t parse right now + // function g(a, { a }) { // return a; // } @@ -418,7 +419,7 @@ exports[`test destructuring_param.js 1`] = ` function f(a, { b }) { return a + b; } -// TODO: These throw errors when parsing. +// Doesn\'t parse right now // function g(a, { a }) { // return a; // } diff --git a/tests/destructuring/array_rest.js b/tests/flow/destructuring/array_rest.js similarity index 100% rename from tests/destructuring/array_rest.js rename to tests/flow/destructuring/array_rest.js diff --git a/tests/destructuring/computed.js b/tests/flow/destructuring/computed.js similarity index 100% rename from tests/destructuring/computed.js rename to tests/flow/destructuring/computed.js diff --git a/tests/destructuring/defaults.js b/tests/flow/destructuring/defaults.js similarity index 100% rename from tests/destructuring/defaults.js rename to tests/flow/destructuring/defaults.js diff --git a/tests/destructuring/destructuring.js b/tests/flow/destructuring/destructuring.js similarity index 100% rename from tests/destructuring/destructuring.js rename to tests/flow/destructuring/destructuring.js diff --git a/tests/destructuring/destructuring_param.js b/tests/flow/destructuring/destructuring_param.js similarity index 80% rename from tests/destructuring/destructuring_param.js rename to tests/flow/destructuring/destructuring_param.js index 76a30128..b9fc9d00 100644 --- a/tests/destructuring/destructuring_param.js +++ b/tests/flow/destructuring/destructuring_param.js @@ -2,7 +2,8 @@ function f(a, { b }) { return a + b; } -// TODO: These throw errors when parsing. +// Doesn't parse right now + // function g(a, { a }) { // return a; // } diff --git a/tests/destructuring/eager.js b/tests/flow/destructuring/eager.js similarity index 100% rename from tests/destructuring/eager.js rename to tests/flow/destructuring/eager.js diff --git a/tests/equals/jsfmt.spec.js b/tests/flow/destructuring/jsfmt.spec.js similarity index 100% rename from tests/equals/jsfmt.spec.js rename to tests/flow/destructuring/jsfmt.spec.js diff --git a/tests/destructuring/poly.js b/tests/flow/destructuring/poly.js similarity index 100% rename from tests/destructuring/poly.js rename to tests/flow/destructuring/poly.js diff --git a/tests/destructuring/rec.js b/tests/flow/destructuring/rec.js similarity index 100% rename from tests/destructuring/rec.js rename to tests/flow/destructuring/rec.js diff --git a/tests/destructuring/string_lit.js b/tests/flow/destructuring/string_lit.js similarity index 100% rename from tests/destructuring/string_lit.js rename to tests/flow/destructuring/string_lit.js diff --git a/tests/destructuring/unannotated.js b/tests/flow/destructuring/unannotated.js similarity index 100% rename from tests/destructuring/unannotated.js rename to tests/flow/destructuring/unannotated.js diff --git a/tests/dictionary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/dictionary/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/dictionary/any.js b/tests/flow/dictionary/any.js similarity index 100% rename from tests/dictionary/any.js rename to tests/flow/dictionary/any.js diff --git a/tests/dictionary/compatible.js b/tests/flow/dictionary/compatible.js similarity index 100% rename from tests/dictionary/compatible.js rename to tests/flow/dictionary/compatible.js diff --git a/tests/dictionary/dictionary.js b/tests/flow/dictionary/dictionary.js similarity index 100% rename from tests/dictionary/dictionary.js rename to tests/flow/dictionary/dictionary.js diff --git a/tests/dictionary/incompatible.js b/tests/flow/dictionary/incompatible.js similarity index 100% rename from tests/dictionary/incompatible.js rename to tests/flow/dictionary/incompatible.js diff --git a/tests/dictionary/issue-1745.js b/tests/flow/dictionary/issue-1745.js similarity index 100% rename from tests/dictionary/issue-1745.js rename to tests/flow/dictionary/issue-1745.js diff --git a/tests/error_messages/jsfmt.spec.js b/tests/flow/dictionary/jsfmt.spec.js similarity index 100% rename from tests/error_messages/jsfmt.spec.js rename to tests/flow/dictionary/jsfmt.spec.js diff --git a/tests/dictionary/test.js b/tests/flow/dictionary/test.js similarity index 100% rename from tests/dictionary/test.js rename to tests/flow/dictionary/test.js diff --git a/tests/dictionary/test_client.js b/tests/flow/dictionary/test_client.js similarity index 100% rename from tests/dictionary/test_client.js rename to tests/flow/dictionary/test_client.js diff --git a/tests/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap b/tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/disjoint-union-perf/ast.js b/tests/flow/disjoint-union-perf/ast.js similarity index 100% rename from tests/disjoint-union-perf/ast.js rename to tests/flow/disjoint-union-perf/ast.js diff --git a/tests/disjoint-union-perf/emit.js b/tests/flow/disjoint-union-perf/emit.js similarity index 100% rename from tests/disjoint-union-perf/emit.js rename to tests/flow/disjoint-union-perf/emit.js diff --git a/tests/disjoint-union-perf/jsAst.js b/tests/flow/disjoint-union-perf/jsAst.js similarity index 100% rename from tests/disjoint-union-perf/jsAst.js rename to tests/flow/disjoint-union-perf/jsAst.js diff --git a/tests/es_declare_module/flow-typed/jsfmt.spec.js b/tests/flow/disjoint-union-perf/jsfmt.spec.js similarity index 100% rename from tests/es_declare_module/flow-typed/jsfmt.spec.js rename to tests/flow/disjoint-union-perf/jsfmt.spec.js diff --git a/tests/docblock_flow/__snapshots__/jsfmt.spec.js.snap b/tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/docblock_flow/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/es_declare_module/jsfmt.spec.js b/tests/flow/docblock_flow/jsfmt.spec.js similarity index 100% rename from tests/es_declare_module/jsfmt.spec.js rename to tests/flow/docblock_flow/jsfmt.spec.js diff --git a/tests/docblock_flow/license_with_flow.js b/tests/flow/docblock_flow/license_with_flow.js similarity index 100% rename from tests/docblock_flow/license_with_flow.js rename to tests/flow/docblock_flow/license_with_flow.js diff --git a/tests/docblock_flow/max_header_tokens.js b/tests/flow/docblock_flow/max_header_tokens.js similarity index 100% rename from tests/docblock_flow/max_header_tokens.js rename to tests/flow/docblock_flow/max_header_tokens.js diff --git a/tests/docblock_flow/multiple_flows_1.js b/tests/flow/docblock_flow/multiple_flows_1.js similarity index 100% rename from tests/docblock_flow/multiple_flows_1.js rename to tests/flow/docblock_flow/multiple_flows_1.js diff --git a/tests/docblock_flow/multiple_flows_2.js b/tests/flow/docblock_flow/multiple_flows_2.js similarity index 100% rename from tests/docblock_flow/multiple_flows_2.js rename to tests/flow/docblock_flow/multiple_flows_2.js diff --git a/tests/docblock_flow/multiple_providesModule_1.js b/tests/flow/docblock_flow/multiple_providesModule_1.js similarity index 100% rename from tests/docblock_flow/multiple_providesModule_1.js rename to tests/flow/docblock_flow/multiple_providesModule_1.js diff --git a/tests/docblock_flow/multiple_providesModule_2.js b/tests/flow/docblock_flow/multiple_providesModule_2.js similarity index 100% rename from tests/docblock_flow/multiple_providesModule_2.js rename to tests/flow/docblock_flow/multiple_providesModule_2.js diff --git a/tests/docblock_flow/use_strict_with_flow.js b/tests/flow/docblock_flow/use_strict_with_flow.js similarity index 100% rename from tests/docblock_flow/use_strict_with_flow.js rename to tests/flow/docblock_flow/use_strict_with_flow.js diff --git a/tests/docblock_flow/with_flow.js b/tests/flow/docblock_flow/with_flow.js similarity index 100% rename from tests/docblock_flow/with_flow.js rename to tests/flow/docblock_flow/with_flow.js diff --git a/tests/docblock_flow/without_flow.js b/tests/flow/docblock_flow/without_flow.js similarity index 100% rename from tests/docblock_flow/without_flow.js rename to tests/flow/docblock_flow/without_flow.js diff --git a/tests/dom/CanvasRenderingContext2D.js b/tests/flow/dom/CanvasRenderingContext2D.js similarity index 100% rename from tests/dom/CanvasRenderingContext2D.js rename to tests/flow/dom/CanvasRenderingContext2D.js diff --git a/tests/dom/CustomEvent.js b/tests/flow/dom/CustomEvent.js similarity index 100% rename from tests/dom/CustomEvent.js rename to tests/flow/dom/CustomEvent.js diff --git a/tests/dom/Document.js b/tests/flow/dom/Document.js similarity index 100% rename from tests/dom/Document.js rename to tests/flow/dom/Document.js diff --git a/tests/dom/Element.js b/tests/flow/dom/Element.js similarity index 100% rename from tests/dom/Element.js rename to tests/flow/dom/Element.js diff --git a/tests/dom/HTMLCanvasElement.js b/tests/flow/dom/HTMLCanvasElement.js similarity index 100% rename from tests/dom/HTMLCanvasElement.js rename to tests/flow/dom/HTMLCanvasElement.js diff --git a/tests/dom/HTMLElement.js b/tests/flow/dom/HTMLElement.js similarity index 100% rename from tests/dom/HTMLElement.js rename to tests/flow/dom/HTMLElement.js diff --git a/tests/dom/HTMLInputElement.js b/tests/flow/dom/HTMLInputElement.js similarity index 100% rename from tests/dom/HTMLInputElement.js rename to tests/flow/dom/HTMLInputElement.js diff --git a/tests/dom/URL.js b/tests/flow/dom/URL.js similarity index 100% rename from tests/dom/URL.js rename to tests/flow/dom/URL.js diff --git a/tests/dom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dom/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/dom/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/dom/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/dom/eventtarget.js b/tests/flow/dom/eventtarget.js similarity index 100% rename from tests/dom/eventtarget.js rename to tests/flow/dom/eventtarget.js diff --git a/tests/esproposal_export_star_as.enable/jsfmt.spec.js b/tests/flow/dom/jsfmt.spec.js similarity index 100% rename from tests/esproposal_export_star_as.enable/jsfmt.spec.js rename to tests/flow/dom/jsfmt.spec.js diff --git a/tests/dom/path2d.js b/tests/flow/dom/path2d.js similarity index 100% rename from tests/dom/path2d.js rename to tests/flow/dom/path2d.js diff --git a/tests/dom/registerElement.js b/tests/flow/dom/registerElement.js similarity index 100% rename from tests/dom/registerElement.js rename to tests/flow/dom/registerElement.js diff --git a/tests/dom/traversal.js b/tests/flow/dom/traversal.js similarity index 100% rename from tests/dom/traversal.js rename to tests/flow/dom/traversal.js diff --git a/tests/dump-types/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/dump-types/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/dump-types/import.js b/tests/flow/dump-types/import.js similarity index 100% rename from tests/dump-types/import.js rename to tests/flow/dump-types/import.js diff --git a/tests/esproposal_export_star_as.ignore/jsfmt.spec.js b/tests/flow/dump-types/jsfmt.spec.js similarity index 100% rename from tests/esproposal_export_star_as.ignore/jsfmt.spec.js rename to tests/flow/dump-types/jsfmt.spec.js diff --git a/tests/dump-types/test.js b/tests/flow/dump-types/test.js similarity index 100% rename from tests/dump-types/test.js rename to tests/flow/dump-types/test.js diff --git a/tests/duplicate_methods/__snapshots__/jsfmt.spec.js.snap b/tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/duplicate_methods/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/export_default/lib/jsfmt.spec.js b/tests/flow/duplicate_methods/jsfmt.spec.js similarity index 100% rename from tests/export_default/lib/jsfmt.spec.js rename to tests/flow/duplicate_methods/jsfmt.spec.js diff --git a/tests/duplicate_methods/test.js b/tests/flow/duplicate_methods/test.js similarity index 100% rename from tests/duplicate_methods/test.js rename to tests/flow/duplicate_methods/test.js diff --git a/tests/encaps/__snapshots__/jsfmt.spec.js.snap b/tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/encaps/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/encaps/encaps.js b/tests/flow/encaps/encaps.js similarity index 100% rename from tests/encaps/encaps.js rename to tests/flow/encaps/encaps.js diff --git a/tests/export_type/jsfmt.spec.js b/tests/flow/encaps/jsfmt.spec.js similarity index 100% rename from tests/export_type/jsfmt.spec.js rename to tests/flow/encaps/jsfmt.spec.js diff --git a/tests/enumerror/__snapshots__/jsfmt.spec.js.snap b/tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/enumerror/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/enumerror/enumerror.js b/tests/flow/enumerror/enumerror.js similarity index 100% rename from tests/enumerror/enumerror.js rename to tests/flow/enumerror/enumerror.js diff --git a/tests/extensions/jsfmt.spec.js b/tests/flow/enumerror/jsfmt.spec.js similarity index 100% rename from tests/extensions/jsfmt.spec.js rename to tests/flow/enumerror/jsfmt.spec.js diff --git a/tests/equals/__snapshots__/jsfmt.spec.js.snap b/tests/flow/equals/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/equals/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/equals/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/equals/equals.js b/tests/flow/equals/equals.js similarity index 100% rename from tests/equals/equals.js rename to tests/flow/equals/equals.js diff --git a/tests/facebook_fbt_none/jsfmt.spec.js b/tests/flow/equals/jsfmt.spec.js similarity index 100% rename from tests/facebook_fbt_none/jsfmt.spec.js rename to tests/flow/equals/jsfmt.spec.js diff --git a/tests/error_messages/__snapshots__/jsfmt.spec.js.snap b/tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/error_messages/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/error_messages/errors.js b/tests/flow/error_messages/errors.js similarity index 100% rename from tests/error_messages/errors.js rename to tests/flow/error_messages/errors.js diff --git a/tests/facebook_fbt_some/flow-typed/jsfmt.spec.js b/tests/flow/error_messages/jsfmt.spec.js similarity index 100% rename from tests/facebook_fbt_some/flow-typed/jsfmt.spec.js rename to tests/flow/error_messages/jsfmt.spec.js diff --git a/tests/es6modules/B.js b/tests/flow/es6modules/B.js similarity index 100% rename from tests/es6modules/B.js rename to tests/flow/es6modules/B.js diff --git a/tests/es6modules/C.js b/tests/flow/es6modules/C.js similarity index 100% rename from tests/es6modules/C.js rename to tests/flow/es6modules/C.js diff --git a/tests/es6modules/CommonJS_Clobbering_Class.js b/tests/flow/es6modules/CommonJS_Clobbering_Class.js similarity index 100% rename from tests/es6modules/CommonJS_Clobbering_Class.js rename to tests/flow/es6modules/CommonJS_Clobbering_Class.js diff --git a/tests/es6modules/CommonJS_Clobbering_Frozen.js b/tests/flow/es6modules/CommonJS_Clobbering_Frozen.js similarity index 100% rename from tests/es6modules/CommonJS_Clobbering_Frozen.js rename to tests/flow/es6modules/CommonJS_Clobbering_Frozen.js diff --git a/tests/es6modules/CommonJS_Clobbering_Lit.js b/tests/flow/es6modules/CommonJS_Clobbering_Lit.js similarity index 100% rename from tests/es6modules/CommonJS_Clobbering_Lit.js rename to tests/flow/es6modules/CommonJS_Clobbering_Lit.js diff --git a/tests/es6modules/CommonJS_Named.js b/tests/flow/es6modules/CommonJS_Named.js similarity index 100% rename from tests/es6modules/CommonJS_Named.js rename to tests/flow/es6modules/CommonJS_Named.js diff --git a/tests/es6modules/ES6_DefaultAndNamed.js b/tests/flow/es6modules/ES6_DefaultAndNamed.js similarity index 100% rename from tests/es6modules/ES6_DefaultAndNamed.js rename to tests/flow/es6modules/ES6_DefaultAndNamed.js diff --git a/tests/es6modules/ES6_Default_AnonClass1.js b/tests/flow/es6modules/ES6_Default_AnonClass1.js similarity index 100% rename from tests/es6modules/ES6_Default_AnonClass1.js rename to tests/flow/es6modules/ES6_Default_AnonClass1.js diff --git a/tests/es6modules/ES6_Default_AnonClass2.js b/tests/flow/es6modules/ES6_Default_AnonClass2.js similarity index 100% rename from tests/es6modules/ES6_Default_AnonClass2.js rename to tests/flow/es6modules/ES6_Default_AnonClass2.js diff --git a/tests/es6modules/ES6_Default_AnonFunction1.js b/tests/flow/es6modules/ES6_Default_AnonFunction1.js similarity index 100% rename from tests/es6modules/ES6_Default_AnonFunction1.js rename to tests/flow/es6modules/ES6_Default_AnonFunction1.js diff --git a/tests/es6modules/ES6_Default_AnonFunction2.js b/tests/flow/es6modules/ES6_Default_AnonFunction2.js similarity index 100% rename from tests/es6modules/ES6_Default_AnonFunction2.js rename to tests/flow/es6modules/ES6_Default_AnonFunction2.js diff --git a/tests/es6modules/ES6_Default_NamedClass1.js b/tests/flow/es6modules/ES6_Default_NamedClass1.js similarity index 100% rename from tests/es6modules/ES6_Default_NamedClass1.js rename to tests/flow/es6modules/ES6_Default_NamedClass1.js diff --git a/tests/es6modules/ES6_Default_NamedClass2.js b/tests/flow/es6modules/ES6_Default_NamedClass2.js similarity index 100% rename from tests/es6modules/ES6_Default_NamedClass2.js rename to tests/flow/es6modules/ES6_Default_NamedClass2.js diff --git a/tests/es6modules/ES6_Default_NamedFunction1.js b/tests/flow/es6modules/ES6_Default_NamedFunction1.js similarity index 100% rename from tests/es6modules/ES6_Default_NamedFunction1.js rename to tests/flow/es6modules/ES6_Default_NamedFunction1.js diff --git a/tests/es6modules/ES6_Default_NamedFunction2.js b/tests/flow/es6modules/ES6_Default_NamedFunction2.js similarity index 100% rename from tests/es6modules/ES6_Default_NamedFunction2.js rename to tests/flow/es6modules/ES6_Default_NamedFunction2.js diff --git a/tests/es6modules/ES6_ExportAllFromMulti.js b/tests/flow/es6modules/ES6_ExportAllFromMulti.js similarity index 100% rename from tests/es6modules/ES6_ExportAllFromMulti.js rename to tests/flow/es6modules/ES6_ExportAllFromMulti.js diff --git a/tests/es6modules/ES6_ExportAllFrom_Intermediary1.js b/tests/flow/es6modules/ES6_ExportAllFrom_Intermediary1.js similarity index 100% rename from tests/es6modules/ES6_ExportAllFrom_Intermediary1.js rename to tests/flow/es6modules/ES6_ExportAllFrom_Intermediary1.js diff --git a/tests/es6modules/ES6_ExportAllFrom_Intermediary2.js b/tests/flow/es6modules/ES6_ExportAllFrom_Intermediary2.js similarity index 100% rename from tests/es6modules/ES6_ExportAllFrom_Intermediary2.js rename to tests/flow/es6modules/ES6_ExportAllFrom_Intermediary2.js diff --git a/tests/es6modules/ES6_ExportAllFrom_Source1.js b/tests/flow/es6modules/ES6_ExportAllFrom_Source1.js similarity index 100% rename from tests/es6modules/ES6_ExportAllFrom_Source1.js rename to tests/flow/es6modules/ES6_ExportAllFrom_Source1.js diff --git a/tests/es6modules/ES6_ExportAllFrom_Source2.js b/tests/flow/es6modules/ES6_ExportAllFrom_Source2.js similarity index 100% rename from tests/es6modules/ES6_ExportAllFrom_Source2.js rename to tests/flow/es6modules/ES6_ExportAllFrom_Source2.js diff --git a/tests/es6modules/ES6_ExportFrom_Intermediary1.js b/tests/flow/es6modules/ES6_ExportFrom_Intermediary1.js similarity index 100% rename from tests/es6modules/ES6_ExportFrom_Intermediary1.js rename to tests/flow/es6modules/ES6_ExportFrom_Intermediary1.js diff --git a/tests/es6modules/ES6_ExportFrom_Intermediary2.js b/tests/flow/es6modules/ES6_ExportFrom_Intermediary2.js similarity index 100% rename from tests/es6modules/ES6_ExportFrom_Intermediary2.js rename to tests/flow/es6modules/ES6_ExportFrom_Intermediary2.js diff --git a/tests/es6modules/ES6_ExportFrom_Source1.js b/tests/flow/es6modules/ES6_ExportFrom_Source1.js similarity index 100% rename from tests/es6modules/ES6_ExportFrom_Source1.js rename to tests/flow/es6modules/ES6_ExportFrom_Source1.js diff --git a/tests/es6modules/ES6_ExportFrom_Source2.js b/tests/flow/es6modules/ES6_ExportFrom_Source2.js similarity index 100% rename from tests/es6modules/ES6_ExportFrom_Source2.js rename to tests/flow/es6modules/ES6_ExportFrom_Source2.js diff --git a/tests/es6modules/ES6_Named1.js b/tests/flow/es6modules/ES6_Named1.js similarity index 100% rename from tests/es6modules/ES6_Named1.js rename to tests/flow/es6modules/ES6_Named1.js diff --git a/tests/es6modules/ES6_Named2.js b/tests/flow/es6modules/ES6_Named2.js similarity index 100% rename from tests/es6modules/ES6_Named2.js rename to tests/flow/es6modules/ES6_Named2.js diff --git a/tests/es6modules/ExportType.js b/tests/flow/es6modules/ExportType.js similarity index 100% rename from tests/es6modules/ExportType.js rename to tests/flow/es6modules/ExportType.js diff --git a/tests/es6modules/ProvidesModuleA.js b/tests/flow/es6modules/ProvidesModuleA.js similarity index 100% rename from tests/es6modules/ProvidesModuleA.js rename to tests/flow/es6modules/ProvidesModuleA.js diff --git a/tests/es6modules/ProvidesModuleCJSDefault.js b/tests/flow/es6modules/ProvidesModuleCJSDefault.js similarity index 100% rename from tests/es6modules/ProvidesModuleCJSDefault.js rename to tests/flow/es6modules/ProvidesModuleCJSDefault.js diff --git a/tests/es6modules/ProvidesModuleD.js b/tests/flow/es6modules/ProvidesModuleD.js similarity index 100% rename from tests/es6modules/ProvidesModuleD.js rename to tests/flow/es6modules/ProvidesModuleD.js diff --git a/tests/es6modules/ProvidesModuleES6Default.js b/tests/flow/es6modules/ProvidesModuleES6Default.js similarity index 100% rename from tests/es6modules/ProvidesModuleES6Default.js rename to tests/flow/es6modules/ProvidesModuleES6Default.js diff --git a/tests/es6modules/SideEffects.js b/tests/flow/es6modules/SideEffects.js similarity index 100% rename from tests/es6modules/SideEffects.js rename to tests/flow/es6modules/SideEffects.js diff --git a/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..d360426e --- /dev/null +++ b/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,1466 @@ +exports[`test B.js 1`] = ` +"/* @flow */ + +exports.numberValue = 42; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +exports.numberValue = 42; +" +`; + +exports[`test C.js 1`] = ` +"/* @flow */ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +" +`; + +exports[`test CommonJS_Clobbering_Class.js 1`] = ` +"/** + * @providesModule CommonJS_Clobbering_Class + * @flow + */ + +class Base { + static baseProp: number; +} + +class Test extends Base { + static childProp: number; + + static staticNumber1():number { return 1; } + static staticNumber2():number { return 2; } + static staticNumber3():number { return 3; } + + instNumber1():number { return 1; } + instNumber2():number { return 2; } +}; + +module.exports = Test; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule CommonJS_Clobbering_Class + * @flow + */ + +class Base { + static baseProp: number; +} + +class Test extends Base { + static childProp: number; + + static staticNumber1(): number { + return 1; + } + static staticNumber2(): number { + return 2; + } + static staticNumber3(): number { + return 3; + } + + instNumber1(): number { + return 1; + } + instNumber2(): number { + return 2; + } +} + +module.exports = Test; +" +`; + +exports[`test CommonJS_Clobbering_Frozen.js 1`] = ` +"/** + * @providesModule CommonJS_Clobbering_Frozen + * @flow + */ + +module.exports = Object.freeze({ + numberValue1: 1, +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule CommonJS_Clobbering_Frozen + * @flow + */ + +module.exports = Object.freeze({ numberValue1: 1 }); +" +`; + +exports[`test CommonJS_Clobbering_Lit.js 1`] = ` +"/** + * @providesModule CommonJS_Clobbering_Lit + * @flow + */ + +module.exports = { + numberValue1: 1, + numberValue2: 2, + numberValue3: 3, + numberValue4: 4, + numberValue5: 5 +}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule CommonJS_Clobbering_Lit + * @flow + */ + +module.exports = { + numberValue1: 1, + numberValue2: 2, + numberValue3: 3, + numberValue4: 4, + numberValue5: 5 +}; +" +`; + +exports[`test CommonJS_Named.js 1`] = ` +"/** + * @providesModule CommonJS_Named + * @flow + */ + +exports.numberValue1 = 1; +exports.numberValue2 = 2; +exports.numberValue3 = 3; +exports.numberValue4 = 4; +exports.numberValue5 = 5; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule CommonJS_Named + * @flow + */ + +exports.numberValue1 = 1; +exports.numberValue2 = 2; +exports.numberValue3 = 3; +exports.numberValue4 = 4; +exports.numberValue5 = 5; +" +`; + +exports[`test ES6_Default_AnonClass1.js 1`] = ` +"/** + * @providesModule ES6_Default_AnonClass1 + * @flow + */ + +export default class { givesANum(): number { return 42; }}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_AnonClass1 + * @flow + */ + +export default class { + givesANum(): number { + return 42; + } +} +" +`; + +exports[`test ES6_Default_AnonClass2.js 1`] = ` +"/** + * @providesModule ES6_Default_AnonClass2 + * @flow + */ + +export default class { givesANum(): number { return 42; }}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_AnonClass2 + * @flow + */ + +export default class { + givesANum(): number { + return 42; + } +} +" +`; + +exports[`test ES6_Default_AnonFunction1.js 1`] = ` +"/** + * @providesModule ES6_Default_AnonFunction1 + * @flow + */ + +export default function():number { return 42; } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_AnonFunction1 + * @flow + */ + +export default function(): number { + return 42; +} +" +`; + +exports[`test ES6_Default_AnonFunction2.js 1`] = ` +"/** + * @providesModule ES6_Default_AnonFunction2 + * @flow + */ + +export default function():number { return 42; } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_AnonFunction2 + * @flow + */ + +export default function(): number { + return 42; +} +" +`; + +exports[`test ES6_Default_NamedClass1.js 1`] = ` +"/** + * @providesModule ES6_Default_NamedClass1 + * @flow + */ + +export default class Foo { givesANum(): number { return 42; }}; + +// Regression test for https://github.com/facebook/flow/issues/511 +// +// Default-exported class should also be available in local scope +new Foo(); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_NamedClass1 + * @flow + */ + +export default class Foo { + givesANum(): number { + return 42; + } +} + +// Regression test for https://github.com/facebook/flow/issues/511 +// +// Default-exported class should also be available in local scope +new Foo(); +" +`; + +exports[`test ES6_Default_NamedClass2.js 1`] = ` +"/** + * @providesModule ES6_Default_NamedClass2 + * @flow + */ + +export default class Foo { givesANum(): number { return 42; }}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_NamedClass2 + * @flow + */ + +export default class Foo { + givesANum(): number { + return 42; + } +} +" +`; + +exports[`test ES6_Default_NamedFunction1.js 1`] = ` +"/** + * @providesModule ES6_Default_NamedFunction1 + * @flow + */ + +export default function foo():number { return 42; } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_NamedFunction1 + * @flow + */ + +export default function foo(): number { + return 42; +} +" +`; + +exports[`test ES6_Default_NamedFunction2.js 1`] = ` +"/** + * @providesModule ES6_Default_NamedFunction2 + * @flow + */ + +export default function foo():number { return 42; } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Default_NamedFunction2 + * @flow + */ + +export default function foo(): number { + return 42; +} +" +`; + +exports[`test ES6_DefaultAndNamed.js 1`] = ` +"/* @flow */ + +export default 42; +export var str = \'asdf\'; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +export default 42; +export var str = \"asdf\"; +" +`; + +exports[`test ES6_ExportAllFrom_Intermediary1.js 1`] = ` +"/** + * @providesModule ES6_ExportAllFrom_Intermediary1 + * @flow + */ + +export * from \"ES6_ExportAllFrom_Source1\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportAllFrom_Intermediary1 + * @flow + */ + +export * from \"ES6_ExportAllFrom_Source1\"; +" +`; + +exports[`test ES6_ExportAllFrom_Intermediary2.js 1`] = ` +"/** + * @providesModule ES6_ExportAllFrom_Intermediary2 + * @flow + */ + +export * from \"ES6_ExportAllFrom_Source2\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportAllFrom_Intermediary2 + * @flow + */ + +export * from \"ES6_ExportAllFrom_Source2\"; +" +`; + +exports[`test ES6_ExportAllFrom_Source1.js 1`] = ` +"/** + * @providesModule ES6_ExportAllFrom_Source1 + * @flow + */ + +export var numberValue1 = 1; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportAllFrom_Source1 + * @flow + */ + +export var numberValue1 = 1; +" +`; + +exports[`test ES6_ExportAllFrom_Source2.js 1`] = ` +"/** + * @providesModule ES6_ExportAllFrom_Source2 + * @flow + */ + +export var numberValue2 = 1; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportAllFrom_Source2 + * @flow + */ + +export var numberValue2 = 1; +" +`; + +exports[`test ES6_ExportAllFromMulti.js 1`] = ` +"// @flow + +export * from \"./ES6_ExportAllFrom_Source1\"; +export * from \"./ES6_ExportAllFrom_Source2\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +export * from \"./ES6_ExportAllFrom_Source1\"; +export * from \"./ES6_ExportAllFrom_Source2\"; +" +`; + +exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` +"/** + * @providesModule ES6_ExportFrom_Intermediary1 + * @flow + */ + +export { + numberValue1, + numberValue2 as numberValue2_renamed +} from \"ES6_ExportFrom_Source1\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportFrom_Intermediary1 + * @flow + */ + +export { + numberValue1, + numberValue2 as numberValue2_renamed +} from \"ES6_ExportFrom_Source1\"; +" +`; + +exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` +"/** + * @providesModule ES6_ExportFrom_Intermediary2 + * @flow + */ + +export { + numberValue1, + numberValue2 as numberValue2_renamed2 +} from \"ES6_ExportFrom_Source2\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportFrom_Intermediary2 + * @flow + */ + +export { + numberValue1, + numberValue2 as numberValue2_renamed2 +} from \"ES6_ExportFrom_Source2\"; +" +`; + +exports[`test ES6_ExportFrom_Source1.js 1`] = ` +"/** + * @providesModule ES6_ExportFrom_Source1 + * @flow + */ + +export var numberValue1 = 1, numberValue2 = 2; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportFrom_Source1 + * @flow + */ + +export var numberValue1 = 1, numberValue2 = 2; +" +`; + +exports[`test ES6_ExportFrom_Source2.js 1`] = ` +"/** + * @providesModule ES6_ExportFrom_Source2 + * @flow + */ + +export var numberValue1 = 1, numberValue2 = 2; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_ExportFrom_Source2 + * @flow + */ + +export var numberValue1 = 1, numberValue2 = 2; +" +`; + +exports[`test ES6_Named1.js 1`] = ` +"/** + * @providesModule ES6_Named1 + * @flow + */ + +var specifierNumber1 = 1; +var specifierNumber2 = 2; +var specifierNumber3 = 3; +var groupedSpecifierNumber1 = 1; +var groupedSpecifierNumber2 = 2; + +export {specifierNumber1}; +export {specifierNumber2 as specifierNumber2Renamed}; +export {specifierNumber3}; +export {groupedSpecifierNumber1, groupedSpecifierNumber2}; + +export function givesANumber(): number { return 42; }; +export class NumberGenerator { givesANumber(): number { return 42; }}; + +export var varDeclNumber1 = 1, varDeclNumber2 = 2; +export var {destructuredObjNumber} = {destructuredObjNumber: 1}; +export var [destructuredArrNumber] = [1] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Named1 + * @flow + */ + +var specifierNumber1 = 1; +var specifierNumber2 = 2; +var specifierNumber3 = 3; +var groupedSpecifierNumber1 = 1; +var groupedSpecifierNumber2 = 2; + +export { specifierNumber1 }; +export { specifierNumber2 as specifierNumber2Renamed }; +export { specifierNumber3 }; +export { groupedSpecifierNumber1, groupedSpecifierNumber2 }; + +export function givesANumber(): number { + return 42; +} +export class NumberGenerator { + givesANumber(): number { + return 42; + } +} + +export var varDeclNumber1 = 1, varDeclNumber2 = 2; +export var { destructuredObjNumber } = { destructuredObjNumber: 1 }; +export var [destructuredArrNumber] = [1]; +" +`; + +exports[`test ES6_Named2.js 1`] = ` +"/** + * @providesModule ES6_Named2 + * @flow + */ + +var specifierNumber4 = 1; +var specifierNumber5 = 2; +var groupedSpecifierNumber3 = 1; +var groupedSpecifierNumber4 = 2; + +export {specifierNumber4}; +export {specifierNumber5 as specifierNumber5Renamed}; +export {groupedSpecifierNumber3, groupedSpecifierNumber4}; + +export function givesANumber2(): number { return 42; }; +export class NumberGenerator2 { givesANumber(): number { return 42; }}; + +export var varDeclNumber3 = 1, varDeclNumber4 = 2; +export var {destructuredObjNumber2} = {destructuredObjNumber2: 1}; +export var [destructuredArrNumber2] = [1] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule ES6_Named2 + * @flow + */ + +var specifierNumber4 = 1; +var specifierNumber5 = 2; +var groupedSpecifierNumber3 = 1; +var groupedSpecifierNumber4 = 2; + +export { specifierNumber4 }; +export { specifierNumber5 as specifierNumber5Renamed }; +export { groupedSpecifierNumber3, groupedSpecifierNumber4 }; + +export function givesANumber2(): number { + return 42; +} +export class NumberGenerator2 { + givesANumber(): number { + return 42; + } +} + +export var varDeclNumber3 = 1, varDeclNumber4 = 2; +export var { destructuredObjNumber2 } = { destructuredObjNumber2: 1 }; +export var [destructuredArrNumber2] = [1]; +" +`; + +exports[`test ExportType.js 1`] = ` +"// @flow + +export type typeAlias = number; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +export type typeAlias = number; +" +`; + +exports[`test ProvidesModuleA.js 1`] = ` +"/** + * @providesModule A + * @flow + */ + +exports.numberValue1 = 42; +exports.numberValue2 = 42; +exports.numberValue3 = 42; +exports.numberValue4 = 42; +exports.stringValue = \"str\"; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule A + * @flow + */ + +exports.numberValue1 = 42; +exports.numberValue2 = 42; +exports.numberValue3 = 42; +exports.numberValue4 = 42; +exports.stringValue = \"str\"; +" +`; + +exports[`test ProvidesModuleCJSDefault.js 1`] = ` +"/** + * @providesModule CJSDefault + * @flow + */ + +module.exports = { + numberValue: 42 +}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule CJSDefault + * @flow + */ + +module.exports = { numberValue: 42 }; +" +`; + +exports[`test ProvidesModuleD.js 1`] = ` +"/** + * @providesModule D + * @flow + */ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +" +`; + +exports[`test ProvidesModuleES6Default.js 1`] = ` +"/** + * @providesModule ES6Default + * @flow + */ + +/* +export default { + numberValue: 42, +}; +*/ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +" +`; + +exports[`test SideEffects.js 1`] = ` +"/* @flow */ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +" +`; + +exports[`test es6modules.js 1`] = ` +"/* @flow */ + +// ===================== // +// == Path Resolution == // +// ===================== // + +// @providesModule +import * as DefaultA from \"A\"; +var a1: number = DefaultA.numberValue1; +var a2: string = DefaultA.numberValue1; // Error: number ~> string + +// File path +import * as DefaultB from \"./B\"; +var b1: number = DefaultB.numberValue; +var b2: string = DefaultB.numberValue; // Error: number ~> string + +// C.js exists, but not as a providesModule +import DefaultC from \"C\"; // Error: No such module + +// @providesModule D exists, but not as a filename +import DefaultD from \"./D\"; // Error: No such module + +// ================================================ // +// == CommonJS Clobbering Literal Exports -> ES6 == // +// ================================================ // + +import {doesntExist1} from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding + +import {numberValue1} from \"CommonJS_Clobbering_Lit\"; +var c1: number = numberValue1; +var c2: string = numberValue1; // Error: number ~> string + +import {numberValue2 as numVal1} from \"CommonJS_Clobbering_Lit\"; +var d1: number = numVal1; +var d2: string = numVal1; // Error: number ~> string + +import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +var e1: number = CJS_Clobb_Lit.numberValue3; +var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string +CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property + +import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +var f1: number = CJS_Clobb_Lit_NS.numberValue4; +var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; +CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj +var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string +var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string + +// ============================================== // +// == CommonJS Clobbering Class Exports -> ES6 == // +// ============================================== // + +import {doesntExist2} from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding + +// The following import should error because class statics are not turned into +// named exports for now. This avoids complexities with polymorphic static +// members (where the polymophism is defined on the class itself rather than the +// method). +import {staticNumber1, baseProp, childProp} from \"CommonJS_Clobbering_Class\"; // Error + +import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +new CJS_Clobb_Class(); +new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property +var h1: number = CJS_Clobb_Class.staticNumber2(); +var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string +var h3: number = new CJS_Clobb_Class().instNumber1(); +var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string + +import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; +new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable +var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object +var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); +var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string + +// =================================== // +// == CommonJS Named Exports -> ES6 == // +// =================================== // + +import {doesntExist3} from \"CommonJS_Named\"; // Error: Not an exported binding + +import {numberValue2} from \"CommonJS_Named\"; +var j1: number = numberValue2; +var j2: string = numberValue2; // Error: number ~> string + +import {numberValue3 as numVal3} from \"CommonJS_Named\"; +var k1: number = numVal3; +var k2: string = numVal3; // Error: number ~> string + +import * as CJS_Named from \"CommonJS_Named\"; +var l1: number = CJS_Named.numberValue1; +var l2: string = CJS_Named.numberValue1; // Error: number ~> string +CJS_Named.doesntExist; // Error: doesntExist isn\'t a property + +import * as CJS_Named_NS from \"CommonJS_Named\"; +var m1: number = CJS_Named_NS.numberValue4; +var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export +var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string + +////////////////////////////// +// == ES6 Default -> ES6 == // +////////////////////////////// + +import {doesntExist4} from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding + +import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +var n1: number = ES6_Def_AnonFunc1(); +var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string + +import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +var o1: number = ES6_Def_NamedFunc1(); +var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string + +import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; +var p1: number = new ES6_Def_AnonClass1().givesANum(); +var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string + +import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +var q1: number = new ES6_Def_NamedClass1().givesANum(); +var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string + +//////////////////////////// +// == ES6 Named -> ES6 == // +//////////////////////////// + +import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding + +import {specifierNumber1 as specifierNumber1_1} from \"ES6_Named1\"; +var r1: number = specifierNumber1_1; +var r2: string = specifierNumber1_1; // Error: number ~> string + +import {specifierNumber2Renamed} from \"ES6_Named1\"; +var s1: number = specifierNumber2Renamed; +var s2: string = specifierNumber2Renamed; // Error: number ~> string + +import {specifierNumber3 as specifierNumber3Renamed} from \"ES6_Named1\"; +var t1: number = specifierNumber3Renamed; +var t2: string = specifierNumber3Renamed; // Error: number ~> string + +import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \"ES6_Named1\"; +var u1: number = groupedSpecifierNumber1; +var u2: number = groupedSpecifierNumber2; +var u3: string = groupedSpecifierNumber1; // Error: number ~> string +var u4: string = groupedSpecifierNumber2; // Error: number ~> string + +import {givesANumber} from \"ES6_Named1\"; +var v1: number = givesANumber(); +var v2: string = givesANumber(); // Error: number ~> string + +import {NumberGenerator} from \"ES6_Named1\"; +var w1: number = new NumberGenerator().givesANumber(); +var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string + +import {varDeclNumber1, varDeclNumber2} from \"ES6_Named1\"; +var x1: number = varDeclNumber1; +var x2: number = varDeclNumber2; +var x3: string = varDeclNumber1; // Error: number ~> string +var x4: string = varDeclNumber2; // Error: number ~> string + +import {destructuredObjNumber} from \"ES6_Named1\"; +var y1: number = destructuredObjNumber; +var y2: string = destructuredObjNumber; // Error: number ~> string + +import {destructuredArrNumber} from \"ES6_Named1\"; +var z1: number = destructuredArrNumber; +var z2: string = destructuredArrNumber; // Error: number ~> string + +import {numberValue1 as numberValue4} from \"ES6_ExportFrom_Intermediary1\"; +var aa1: number = numberValue4; +var aa2: string = numberValue4; // Error: number ~> string + +import {numberValue2_renamed} from \"ES6_ExportFrom_Intermediary1\"; +var ab1: number = numberValue2_renamed; +var ab2: string = numberValue2_renamed; // Error: number ~> string + +import {numberValue1 as numberValue5} from \"ES6_ExportAllFrom_Intermediary1\"; +var ac1: number = numberValue5; +var ac2: string = numberValue5; // Error: number ~> string + +/////////////////////////////////// +// == ES6 Default -> CommonJS == // +/////////////////////////////////// + +require(\'ES6_Default_AnonFunction2\').doesntExist; // Error: \'doesntExist\' isn\'t an export + +var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ad1: number = ES6_Def_AnonFunc2(); +var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string + +var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ae1: number = ES6_Def_NamedFunc2(); +var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string + +var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; +var af1: number = new ES6_Def_AnonClass2().givesANum(); +var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string + +var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ag1: number = new ES6_Def_NamedClass2().givesANum(); +var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string + +///////////////////////////////// +// == ES6 Named -> CommonJS == // +///////////////////////////////// + +var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var ah1: number = specifierNumber4; +var ah2: string = specifierNumber4; // Error: number ~> string + +var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var ai1: number = specifierNumber5Renamed; +var ai2: string = specifierNumber5Renamed; // Error: number ~> string + +var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var aj1: number = groupedSpecifierNumber3; +var aj2: number = groupedSpecifierNumber4; +var aj3: string = groupedSpecifierNumber3; // Error: number ~> string +var aj4: string = groupedSpecifierNumber4; // Error: number ~> string + +var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var ak1: number = givesANumber2(); +var ak2: string = givesANumber2(); // Error: number ~> string + +var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var al1: number = new NumberGenerator2().givesANumber(); +var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string + +var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; +var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var am1: number = varDeclNumber3; +var am2: number = varDeclNumber4; +var am3: string = varDeclNumber3; // Error: number ~> string +var am4: string = varDeclNumber4; // Error: number ~> string + +var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; +var an1: number = destructuredObjNumber2; +var an2: string = destructuredObjNumber2; // Error: number ~> string + +var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; +var ao1: number = destructuredArrNumber2; +var ao2: string = destructuredArrNumber2; // Error: number ~> string + +var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var ap1: number = numberValue6; +var ap2: string = numberValue6; // Error: number ~> string + +var numberValue2_renamed2 = require(\"ES6_ExportFrom_Intermediary2\").numberValue2_renamed2; +var aq1: number = numberValue2_renamed2; +var aq2: string = numberValue2_renamed2; // Error: number ~> string + +var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var ar1: number = numberValue7; +var ar2: string = numberValue7; // Error: number ~> string + +//////////////////////////////////////////////////////// +// == ES6 Default+Named -> ES6 import Default+Named== // +//////////////////////////////////////////////////////// + +import defaultNum, {str as namedStr} from \"./ES6_DefaultAndNamed\"; + +var as1: number = defaultNum; +var as2: string = defaultNum; // Error: number ~> string + +var as3: string = namedStr; +var as4: number = namedStr; // Error: string ~> number + +//////////////////////////////////////// +// == Side-effect only ES6 imports == // +//////////////////////////////////////// + +import \"./SideEffects\"; + +////////////////////////////////////////////// +// == Suggest export name on likely typo == // +////////////////////////////////////////////// +import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? +import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? + +/////////////////////////////////////////////////// +// == Multi \`export *\` should combine exports == // +/////////////////////////////////////////////////// +import { + numberValue1 as numberValue8, + numberValue2 as numberValue9 +} from \"./ES6_ExportAllFromMulti\"; + +var at1: number = numberValue8; +var at2: string = numberValue8; // Error: number ~> string + +var at3: number = numberValue9; +var at4: string = numberValue9; // Error: number ~> string + +///////////////////////////////////////////////////////////// +// == Vanilla \`import\` cannot import a type-only export == // +///////////////////////////////////////////////////////////// +import {typeAlias} from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +// ===================== // +// == Path Resolution == // +// ===================== // + +// @providesModule +import * as DefaultA from \"A\"; +var a1: number = DefaultA.numberValue1; +var a2: string = DefaultA.numberValue1; + +// Error: number ~> string +// File path +import * as DefaultB from \"./B\"; +var b1: number = DefaultB.numberValue; +var b2: string = DefaultB.numberValue; + +// Error: number ~> string +// C.js exists, but not as a providesModule +import DefaultC from \"C\"; + +// Error: No such module +// @providesModule D exists, but not as a filename +import DefaultD from \"./D\"; + +// Error: No such module +// ================================================ // +// == CommonJS Clobbering Literal Exports -> ES6 == // +// ================================================ // +import { doesntExist1 } from \"CommonJS_Clobbering_Lit\"; + +// Error: Not an exported binding +import { numberValue1 } from \"CommonJS_Clobbering_Lit\"; +var c1: number = numberValue1; +var c2: string = numberValue1; + +// Error: number ~> string +import { numberValue2 as numVal1 } from \"CommonJS_Clobbering_Lit\"; +var d1: number = numVal1; +var d2: string = numVal1; + +// Error: number ~> string +import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +var e1: number = CJS_Clobb_Lit.numberValue3; +var e2: string = CJS_Clobb_Lit.numberValue3; +// Error: number ~> string +CJS_Clobb_Lit.doesntExist; + +// Error: doesntExist isn\'t a property +import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +var f1: number = CJS_Clobb_Lit_NS.numberValue4; +var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; +CJS_Clobb_Lit_NS.default.default; +// Error: No \'default\' property on the exported obj +var f3: string = CJS_Clobb_Lit_NS.numberValue4; +// Error: number ~> string +var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; + +// Error: number ~> string +// ============================================== // +// == CommonJS Clobbering Class Exports -> ES6 == // +// ============================================== // +import { doesntExist2 } from \"CommonJS_Clobbering_Class\"; + +// Error: Not an exported binding +// The following import should error because class statics are not turned into +// named exports for now. This avoids complexities with polymorphic static +// members (where the polymophism is defined on the class itself rather than the +// method). +import { staticNumber1, baseProp, childProp } from \"CommonJS_Clobbering_Class\"; + +// Error +import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +new CJS_Clobb_Class(); +new CJS_Clobb_Class().doesntExist; +// Error: Class has no \`doesntExist\` property +var h1: number = CJS_Clobb_Class.staticNumber2(); +var h2: string = CJS_Clobb_Class.staticNumber2(); +// Error: number ~> string +var h3: number = new CJS_Clobb_Class().instNumber1(); +var h4: string = new CJS_Clobb_Class().instNumber1(); + +// Error: number ~> string +import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; +new CJS_Clobb_Class_NS(); +// Error: Namespace object isn\'t constructable +var i1: number = CJS_Clobb_Class_NS.staticNumber3(); +// Error: Class statics not copied to Namespace object +var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); +var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); + +// Error: number ~> string +// =================================== // +// == CommonJS Named Exports -> ES6 == // +// =================================== // +import { doesntExist3 } from \"CommonJS_Named\"; + +// Error: Not an exported binding +import { numberValue2 } from \"CommonJS_Named\"; +var j1: number = numberValue2; +var j2: string = numberValue2; + +// Error: number ~> string +import { numberValue3 as numVal3 } from \"CommonJS_Named\"; +var k1: number = numVal3; +var k2: string = numVal3; + +// Error: number ~> string +import * as CJS_Named from \"CommonJS_Named\"; +var l1: number = CJS_Named.numberValue1; +var l2: string = CJS_Named.numberValue1; +// Error: number ~> string +CJS_Named.doesntExist; + +// Error: doesntExist isn\'t a property +import * as CJS_Named_NS from \"CommonJS_Named\"; +var m1: number = CJS_Named_NS.numberValue4; +var m2: string = CJS_Named_NS.default.numberValue4; +// Error: CommonJS_Named has no default export +var m3: string = CJS_Named_NS.numberValue4; + +// Error: number ~> string +////////////////////////////// +// == ES6 Default -> ES6 == // +////////////////////////////// +import { doesntExist4 } from \"ES6_Default_AnonFunction1\"; + +// Error: Not an exported binding +import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +var n1: number = ES6_Def_AnonFunc1(); +var n2: string = ES6_Def_AnonFunc1(); + +// Error: number ~> string +import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +var o1: number = ES6_Def_NamedFunc1(); +var o2: string = ES6_Def_NamedFunc1(); + +// Error: number ~> string +import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; +var p1: number = new ES6_Def_AnonClass1().givesANum(); +var p2: string = new ES6_Def_AnonClass1().givesANum(); + +// Error: number ~> string +import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +var q1: number = new ES6_Def_NamedClass1().givesANum(); +var q2: string = new ES6_Def_NamedClass1().givesANum(); + +// Error: number ~> string +//////////////////////////// +// == ES6 Named -> ES6 == // +//////////////////////////// +import doesntExist5 from \"ES6_Named1\"; + +// Error: Not an exported binding +import { specifierNumber1 as specifierNumber1_1 } from \"ES6_Named1\"; +var r1: number = specifierNumber1_1; +var r2: string = specifierNumber1_1; + +// Error: number ~> string +import { specifierNumber2Renamed } from \"ES6_Named1\"; +var s1: number = specifierNumber2Renamed; +var s2: string = specifierNumber2Renamed; + +// Error: number ~> string +import { specifierNumber3 as specifierNumber3Renamed } from \"ES6_Named1\"; +var t1: number = specifierNumber3Renamed; +var t2: string = specifierNumber3Renamed; + +// Error: number ~> string +import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \"ES6_Named1\"; +var u1: number = groupedSpecifierNumber1; +var u2: number = groupedSpecifierNumber2; +var u3: string = groupedSpecifierNumber1; +// Error: number ~> string +var u4: string = groupedSpecifierNumber2; + +// Error: number ~> string +import { givesANumber } from \"ES6_Named1\"; +var v1: number = givesANumber(); +var v2: string = givesANumber(); + +// Error: number ~> string +import { NumberGenerator } from \"ES6_Named1\"; +var w1: number = new NumberGenerator().givesANumber(); +var w2: string = new NumberGenerator().givesANumber(); + +// Error: number ~> string +import { varDeclNumber1, varDeclNumber2 } from \"ES6_Named1\"; +var x1: number = varDeclNumber1; +var x2: number = varDeclNumber2; +var x3: string = varDeclNumber1; +// Error: number ~> string +var x4: string = varDeclNumber2; + +// Error: number ~> string +import { destructuredObjNumber } from \"ES6_Named1\"; +var y1: number = destructuredObjNumber; +var y2: string = destructuredObjNumber; + +// Error: number ~> string +import { destructuredArrNumber } from \"ES6_Named1\"; +var z1: number = destructuredArrNumber; +var z2: string = destructuredArrNumber; + +// Error: number ~> string +import { numberValue1 as numberValue4 } from \"ES6_ExportFrom_Intermediary1\"; +var aa1: number = numberValue4; +var aa2: string = numberValue4; + +// Error: number ~> string +import { numberValue2_renamed } from \"ES6_ExportFrom_Intermediary1\"; +var ab1: number = numberValue2_renamed; +var ab2: string = numberValue2_renamed; + +// Error: number ~> string +import { numberValue1 as numberValue5 } from \"ES6_ExportAllFrom_Intermediary1\"; +var ac1: number = numberValue5; +var ac2: string = numberValue5; + +// Error: number ~> string +/////////////////////////////////// +// == ES6 Default -> CommonJS == // +/////////////////////////////////// +require(\"ES6_Default_AnonFunction2\").doesntExist; + +// Error: \'doesntExist\' isn\'t an export +var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ad1: number = ES6_Def_AnonFunc2(); +var ad2: string = ES6_Def_AnonFunc2(); + +// Error: number ~> string +var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ae1: number = ES6_Def_NamedFunc2(); +var ae2: string = ES6_Def_NamedFunc2(); + +// Error: number ~> string +var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; +var af1: number = new ES6_Def_AnonClass2().givesANum(); +var af2: string = new ES6_Def_AnonClass2().givesANum(); + +// Error: number ~> string +var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ag1: number = new ES6_Def_NamedClass2().givesANum(); +var ag2: string = new ES6_Def_NamedClass2().givesANum(); + +// Error: number ~> string +///////////////////////////////// +// == ES6 Named -> CommonJS == // +///////////////////////////////// +var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var ah1: number = specifierNumber4; +var ah2: string = specifierNumber4; + +// Error: number ~> string +var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var ai1: number = specifierNumber5Renamed; +var ai2: string = specifierNumber5Renamed; + +// Error: number ~> string +var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var aj1: number = groupedSpecifierNumber3; +var aj2: number = groupedSpecifierNumber4; +var aj3: string = groupedSpecifierNumber3; +// Error: number ~> string +var aj4: string = groupedSpecifierNumber4; + +// Error: number ~> string +var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var ak1: number = givesANumber2(); +var ak2: string = givesANumber2(); + +// Error: number ~> string +var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var al1: number = new NumberGenerator2().givesANumber(); +var al2: string = new NumberGenerator2().givesANumber(); + +// Error: number ~> string +var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; +var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var am1: number = varDeclNumber3; +var am2: number = varDeclNumber4; +var am3: string = varDeclNumber3; +// Error: number ~> string +var am4: string = varDeclNumber4; + +// Error: number ~> string +var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; +var an1: number = destructuredObjNumber2; +var an2: string = destructuredObjNumber2; + +// Error: number ~> string +var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; +var ao1: number = destructuredArrNumber2; +var ao2: string = destructuredArrNumber2; + +// Error: number ~> string +var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var ap1: number = numberValue6; +var ap2: string = numberValue6; + +// Error: number ~> string +var numberValue2_renamed2 = require( + \"ES6_ExportFrom_Intermediary2\" +).numberValue2_renamed2; +var aq1: number = numberValue2_renamed2; +var aq2: string = numberValue2_renamed2; + +// Error: number ~> string +var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var ar1: number = numberValue7; +var ar2: string = numberValue7; + +// Error: number ~> string +//////////////////////////////////////////////////////// +// == ES6 Default+Named -> ES6 import Default+Named== // +//////////////////////////////////////////////////////// +import defaultNum, { str as namedStr } from \"./ES6_DefaultAndNamed\"; + +var as1: number = defaultNum; +var as2: string = defaultNum; + +// Error: number ~> string +var as3: string = namedStr; +var as4: number = namedStr; + +// Error: string ~> number +//////////////////////////////////////// +// == Side-effect only ES6 imports == // +//////////////////////////////////////// +import \"./SideEffects\"; + +////////////////////////////////////////////// +// == Suggest export name on likely typo == // +////////////////////////////////////////////// +import specifierNumber1 from \"ES6_Named1\"; +// Error: Did you mean \`import {specifierNumber1} from ...\`? +import { specifierNumber } from \"ES6_Named1\"; + +// Error: Did you mean \`specifierNumber1\`? +/////////////////////////////////////////////////// +// == Multi \`export *\` should combine exports == // +/////////////////////////////////////////////////// +import { + numberValue1 as numberValue8, + numberValue2 as numberValue9 +} from \"./ES6_ExportAllFromMulti\"; + +var at1: number = numberValue8; +var at2: string = numberValue8; + +// Error: number ~> string +var at3: number = numberValue9; +var at4: string = numberValue9; + +// Error: number ~> string +///////////////////////////////////////////////////////////// +// == Vanilla \`import\` cannot import a type-only export == // +///////////////////////////////////////////////////////////// +import { + typeAlias +} from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! +" +`; + +exports[`test test_imports_are_frozen.js 1`] = ` +"/* @flow */ + +// +// Imports +// + +// CommonJS module +import * as DefaultA from \"A\"; +DefaultA.numberValue1 = 123; // Error: DefaultA is frozen + +// ES6 module +import * as ES6_Named1 from \"ES6_Named1\"; +ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen + +// CommonJS module that clobbers module.exports +import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; +CommonJS_Star.numberValue1 = 123; // Error: frozen +CommonJS_Star.default.numberValue1 = 123; // ok + +import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; +CommonJS_Clobbering_Lit.numberValue1 = 123; // ok + +// CommonJS module that clobbers module.exports with a frozen object +import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; +CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen +CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen + +import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; +CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen + + +// +// Requires +// + +function testRequires() { + // CommonJS module + var DefaultA = require(\"A\"); + DefaultA.numberValue1 = 123; // ok, not frozen by default + + // ES6 module + var ES6_Named1 = require(\"ES6_Named1\"); + ES6_Named1.numberValue = 123; // error, es6 exports are frozen + + // CommonJS module that clobbers module.exports + var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); + CommonJS_Star.numberValue1 = 123; // ok, not frozen by default + + // CommonJS module that clobbers module.exports with a frozen object + var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); + CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +// +// Imports +// + +// CommonJS module +import * as DefaultA from \"A\"; +DefaultA.numberValue1 = 123; + +// Error: DefaultA is frozen +// ES6 module +import * as ES6_Named1 from \"ES6_Named1\"; +ES6_Named1.varDeclNumber1 = 123; + +// Error: ES6_Named1 is frozen +// CommonJS module that clobbers module.exports +import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; +CommonJS_Star.numberValue1 = 123; +// Error: frozen +CommonJS_Star.default.numberValue1 = 123; + +// ok +import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; +CommonJS_Clobbering_Lit.numberValue1 = 123; + +// ok +// CommonJS module that clobbers module.exports with a frozen object +import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; +CommonJS_Frozen_Star.numberValue1 = 123; +// Error: frozen +CommonJS_Frozen_Star.default.numberValue1 = 123; + +// Error: frozen +import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; +CommonJS_Clobbering_Frozen.numberValue1 = 123; + +// Error: exports are frozen +// +// Requires +// +function testRequires() { + // CommonJS module + var DefaultA = require(\"A\"); + DefaultA.numberValue1 = 123; + + // ok, not frozen by default + // ES6 module + var ES6_Named1 = require(\"ES6_Named1\"); + ES6_Named1.numberValue = 123; + + // error, es6 exports are frozen + // CommonJS module that clobbers module.exports + var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); + CommonJS_Star.numberValue1 = 123; + + // ok, not frozen by default + // CommonJS module that clobbers module.exports with a frozen object + var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); + CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen +} +" +`; diff --git a/tests/es6modules/es6modules.js b/tests/flow/es6modules/es6modules.js similarity index 100% rename from tests/es6modules/es6modules.js rename to tests/flow/es6modules/es6modules.js diff --git a/tests/facebook_fbt_some/jsfmt.spec.js b/tests/flow/es6modules/jsfmt.spec.js similarity index 100% rename from tests/facebook_fbt_some/jsfmt.spec.js rename to tests/flow/es6modules/jsfmt.spec.js diff --git a/tests/es6modules/test_imports_are_frozen.js b/tests/flow/es6modules/test_imports_are_frozen.js similarity index 100% rename from tests/es6modules/test_imports_are_frozen.js rename to tests/flow/es6modules/test_imports_are_frozen.js diff --git a/tests/es_declare_module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/es_declare_module/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/es_declare_module/es_declare_module.js b/tests/flow/es_declare_module/es_declare_module.js similarity index 100% rename from tests/es_declare_module/es_declare_module.js rename to tests/flow/es_declare_module/es_declare_module.js diff --git a/tests/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/es_declare_module/flow-typed/declares.js b/tests/flow/es_declare_module/flow-typed/declares.js similarity index 100% rename from tests/es_declare_module/flow-typed/declares.js rename to tests/flow/es_declare_module/flow-typed/declares.js diff --git a/tests/facebookisms/jsfmt.spec.js b/tests/flow/es_declare_module/flow-typed/jsfmt.spec.js similarity index 100% rename from tests/facebookisms/jsfmt.spec.js rename to tests/flow/es_declare_module/flow-typed/jsfmt.spec.js diff --git a/tests/fetch/jsfmt.spec.js b/tests/flow/es_declare_module/jsfmt.spec.js similarity index 100% rename from tests/fetch/jsfmt.spec.js rename to tests/flow/es_declare_module/jsfmt.spec.js diff --git a/tests/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/esproposal_export_star_as.enable/dest.js b/tests/flow/esproposal_export_star_as.enable/dest.js similarity index 100% rename from tests/esproposal_export_star_as.enable/dest.js rename to tests/flow/esproposal_export_star_as.enable/dest.js diff --git a/tests/find-module/jsfmt.spec.js b/tests/flow/esproposal_export_star_as.enable/jsfmt.spec.js similarity index 100% rename from tests/find-module/jsfmt.spec.js rename to tests/flow/esproposal_export_star_as.enable/jsfmt.spec.js diff --git a/tests/esproposal_export_star_as.enable/source.js b/tests/flow/esproposal_export_star_as.enable/source.js similarity index 100% rename from tests/esproposal_export_star_as.enable/source.js rename to tests/flow/esproposal_export_star_as.enable/source.js diff --git a/tests/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/esproposal_export_star_as.ignore/dest.js b/tests/flow/esproposal_export_star_as.ignore/dest.js similarity index 100% rename from tests/esproposal_export_star_as.ignore/dest.js rename to tests/flow/esproposal_export_star_as.ignore/dest.js diff --git a/tests/fixpoint/jsfmt.spec.js b/tests/flow/esproposal_export_star_as.ignore/jsfmt.spec.js similarity index 100% rename from tests/fixpoint/jsfmt.spec.js rename to tests/flow/esproposal_export_star_as.ignore/jsfmt.spec.js diff --git a/tests/esproposal_export_star_as.ignore/source.js b/tests/flow/esproposal_export_star_as.ignore/source.js similarity index 100% rename from tests/esproposal_export_star_as.ignore/source.js rename to tests/flow/esproposal_export_star_as.ignore/source.js diff --git a/tests/export_default/P.js b/tests/flow/export_default/P.js similarity index 100% rename from tests/export_default/P.js rename to tests/flow/export_default/P.js diff --git a/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..7a5c5da5 --- /dev/null +++ b/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,27 @@ +exports[`test P.js 1`] = ` +"module.exports = require(\'M\'); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +module.exports = require(\"M\"); +" +`; + +exports[`test test.js 1`] = ` +"var M = require(\'M\'); +var N = require(\'N\'); +N.x = M(N.x); +var P = require(\'./P\'); // implementation of P redirects to module M +N.y = P(N.y); +var Q = require(\'Q\'); // declaration of Q redirects to module M +N.z = Q(N.z); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var M = require(\"M\"); +var N = require(\"N\"); +N.x = M(N.x); +var P = require(\"./P\"); +// implementation of P redirects to module M +N.y = P(N.y); +var Q = require(\"Q\"); +// declaration of Q redirects to module M +N.z = Q(N.z); +" +`; diff --git a/tests/flow_ast.template_strings/jsfmt.spec.js b/tests/flow/export_default/jsfmt.spec.js similarity index 100% rename from tests/flow_ast.template_strings/jsfmt.spec.js rename to tests/flow/export_default/jsfmt.spec.js diff --git a/tests/export_default/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/export_default/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/forof/jsfmt.spec.js b/tests/flow/export_default/lib/jsfmt.spec.js similarity index 100% rename from tests/forof/jsfmt.spec.js rename to tests/flow/export_default/lib/jsfmt.spec.js diff --git a/tests/export_default/lib/lib.js b/tests/flow/export_default/lib/lib.js similarity index 100% rename from tests/export_default/lib/lib.js rename to tests/flow/export_default/lib/lib.js diff --git a/tests/export_default/test.js b/tests/flow/export_default/test.js similarity index 100% rename from tests/export_default/test.js rename to tests/flow/export_default/test.js diff --git a/tests/export_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/export_type/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/export_type/cjs_with_types.js b/tests/flow/export_type/cjs_with_types.js similarity index 100% rename from tests/export_type/cjs_with_types.js rename to tests/flow/export_type/cjs_with_types.js diff --git a/tests/export_type/importer.js b/tests/flow/export_type/importer.js similarity index 100% rename from tests/export_type/importer.js rename to tests/flow/export_type/importer.js diff --git a/tests/funrec/jsfmt.spec.js b/tests/flow/export_type/jsfmt.spec.js similarity index 100% rename from tests/funrec/jsfmt.spec.js rename to tests/flow/export_type/jsfmt.spec.js diff --git a/tests/export_type/types_only.js b/tests/flow/export_type/types_only.js similarity index 100% rename from tests/export_type/types_only.js rename to tests/flow/export_type/types_only.js diff --git a/tests/export_type/types_only2.js b/tests/flow/export_type/types_only2.js similarity index 100% rename from tests/export_type/types_only2.js rename to tests/flow/export_type/types_only2.js diff --git a/tests/extensions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/extensions/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/extensions/foo.js b/tests/flow/extensions/foo.js similarity index 100% rename from tests/extensions/foo.js rename to tests/flow/extensions/foo.js diff --git a/tests/generators/jsfmt.spec.js b/tests/flow/extensions/jsfmt.spec.js similarity index 100% rename from tests/generators/jsfmt.spec.js rename to tests/flow/extensions/jsfmt.spec.js diff --git a/tests/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/generics/jsfmt.spec.js b/tests/flow/facebook_fbt_none/jsfmt.spec.js similarity index 100% rename from tests/generics/jsfmt.spec.js rename to tests/flow/facebook_fbt_none/jsfmt.spec.js diff --git a/tests/facebook_fbt_none/main.js b/tests/flow/facebook_fbt_none/main.js similarity index 100% rename from tests/facebook_fbt_none/main.js rename to tests/flow/facebook_fbt_none/main.js diff --git a/tests/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/facebook_fbt_some/flow-typed/fbt.js b/tests/flow/facebook_fbt_some/flow-typed/fbt.js similarity index 100% rename from tests/facebook_fbt_some/flow-typed/fbt.js rename to tests/flow/facebook_fbt_some/flow-typed/fbt.js diff --git a/tests/geolocation/jsfmt.spec.js b/tests/flow/facebook_fbt_some/flow-typed/jsfmt.spec.js similarity index 100% rename from tests/geolocation/jsfmt.spec.js rename to tests/flow/facebook_fbt_some/flow-typed/jsfmt.spec.js diff --git a/tests/get-def/helpers/jsfmt.spec.js b/tests/flow/facebook_fbt_some/jsfmt.spec.js similarity index 100% rename from tests/get-def/helpers/jsfmt.spec.js rename to tests/flow/facebook_fbt_some/jsfmt.spec.js diff --git a/tests/facebook_fbt_some/main.js b/tests/flow/facebook_fbt_some/main.js similarity index 100% rename from tests/facebook_fbt_some/main.js rename to tests/flow/facebook_fbt_some/main.js diff --git a/tests/facebookisms/Bar.js b/tests/flow/facebookisms/Bar.js similarity index 100% rename from tests/facebookisms/Bar.js rename to tests/flow/facebookisms/Bar.js diff --git a/tests/facebookisms/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/facebookisms/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/facebookisms/copyProperties.js b/tests/flow/facebookisms/copyProperties.js similarity index 100% rename from tests/facebookisms/copyProperties.js rename to tests/flow/facebookisms/copyProperties.js diff --git a/tests/facebookisms/invariant.js b/tests/flow/facebookisms/invariant.js similarity index 100% rename from tests/facebookisms/invariant.js rename to tests/flow/facebookisms/invariant.js diff --git a/tests/get-def/jsfmt.spec.js b/tests/flow/facebookisms/jsfmt.spec.js similarity index 100% rename from tests/get-def/jsfmt.spec.js rename to tests/flow/facebookisms/jsfmt.spec.js diff --git a/tests/facebookisms/lib.js b/tests/flow/facebookisms/lib.js similarity index 100% rename from tests/facebookisms/lib.js rename to tests/flow/facebookisms/lib.js diff --git a/tests/facebookisms/mergeInto.js b/tests/flow/facebookisms/mergeInto.js similarity index 100% rename from tests/facebookisms/mergeInto.js rename to tests/flow/facebookisms/mergeInto.js diff --git a/tests/facebookisms/test.js b/tests/flow/facebookisms/test.js similarity index 100% rename from tests/facebookisms/test.js rename to tests/flow/facebookisms/test.js diff --git a/tests/fetch/__snapshots__/jsfmt.spec.js.snap b/tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/fetch/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/fetch/fetch.js b/tests/flow/fetch/fetch.js similarity index 100% rename from tests/fetch/fetch.js rename to tests/flow/fetch/fetch.js diff --git a/tests/fetch/headers.js b/tests/flow/fetch/headers.js similarity index 100% rename from tests/fetch/headers.js rename to tests/flow/fetch/headers.js diff --git a/tests/get-def2/jsfmt.spec.js b/tests/flow/fetch/jsfmt.spec.js similarity index 100% rename from tests/get-def2/jsfmt.spec.js rename to tests/flow/fetch/jsfmt.spec.js diff --git a/tests/fetch/request.js b/tests/flow/fetch/request.js similarity index 100% rename from tests/fetch/request.js rename to tests/flow/fetch/request.js diff --git a/tests/fetch/response.js b/tests/flow/fetch/response.js similarity index 100% rename from tests/fetch/response.js rename to tests/flow/fetch/response.js diff --git a/tests/fetch/urlsearchparams.js b/tests/flow/fetch/urlsearchparams.js similarity index 100% rename from tests/fetch/urlsearchparams.js rename to tests/flow/fetch/urlsearchparams.js diff --git a/tests/find-module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/find-module/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/get-def2/lib/jsfmt.spec.js b/tests/flow/find-module/jsfmt.spec.js similarity index 100% rename from tests/get-def2/lib/jsfmt.spec.js rename to tests/flow/find-module/jsfmt.spec.js diff --git a/tests/find-module/req.js b/tests/flow/find-module/req.js similarity index 100% rename from tests/find-module/req.js rename to tests/flow/find-module/req.js diff --git a/tests/find-module/test.js b/tests/flow/find-module/test.js similarity index 100% rename from tests/find-module/test.js rename to tests/flow/find-module/test.js diff --git a/tests/fixpoint/Fun.js b/tests/flow/fixpoint/Fun.js similarity index 100% rename from tests/fixpoint/Fun.js rename to tests/flow/fixpoint/Fun.js diff --git a/tests/fixpoint/Ycombinator.js b/tests/flow/fixpoint/Ycombinator.js similarity index 100% rename from tests/fixpoint/Ycombinator.js rename to tests/flow/fixpoint/Ycombinator.js diff --git a/tests/fixpoint/__snapshots__/jsfmt.spec.js.snap b/tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/fixpoint/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/get-imports-and-importers/jsfmt.spec.js b/tests/flow/fixpoint/jsfmt.spec.js similarity index 100% rename from tests/get-imports-and-importers/jsfmt.spec.js rename to tests/flow/fixpoint/jsfmt.spec.js diff --git a/tests/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap b/tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow_ast.template_strings/foo.js b/tests/flow/flow_ast.template_strings/foo.js similarity index 100% rename from tests/flow_ast.template_strings/foo.js rename to tests/flow/flow_ast.template_strings/foo.js diff --git a/tests/getters_and_setters_disabled/jsfmt.spec.js b/tests/flow/flow_ast.template_strings/jsfmt.spec.js similarity index 100% rename from tests/getters_and_setters_disabled/jsfmt.spec.js rename to tests/flow/flow_ast.template_strings/jsfmt.spec.js diff --git a/tests/flow/for/__snapshots__/jsfmt.spec.js.snap b/tests/flow/for/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..b96ac341 --- /dev/null +++ b/tests/flow/for/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,282 @@ +exports[`test abnormal.js 1`] = ` +"/* @flow */ + +function foo(x: boolean) { + var max = 10; + for (var ii = 0; ii < max; ii++) { + if (x) { + continue; + } + return; + } + console.log(\'this is still reachable\'); +} + +function bar(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + return; + } + console.log(\'this is still reachable\'); +} + +function baz(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + continue; + } + console.log(\'this is still reachable\'); +} + +function bliffl(x: boolean) { + var max = 10; + loop1: for (var ii = 0; ii < max; ii++) { + loop2: for (var jj = 0; jj < max; jj++) { + break loop1; + } + console.log(\'this is still reachable\'); + } + console.log(\'this is still reachable\'); +} + +function corge(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + break; + } + console.log(\'this is still reachable\'); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +function foo(x: boolean) { + var max = 10; + for (var ii = 0; ii < max; ii++) { + if (x) { + continue; + } + return; + } + console.log(\"this is still reachable\"); +} + +function bar(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + return; + } + console.log(\"this is still reachable\"); +} + +function baz(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + continue; + } + console.log(\"this is still reachable\"); +} + +function bliffl(x: boolean) { + var max = 10; + loop1: + for (var ii = 0; ii < max; ii++) { + loop2: + for (var jj = 0; jj < max; jj++) { + break loop1; + } + console.log(\"this is still reachable\"); + } + console.log(\"this is still reachable\"); +} + +function corge(x: boolean) { + var max = 0; + for (var ii = 0; ii < max; ii++) { + break; + } + console.log(\"this is still reachable\"); +} +" +`; + +exports[`test abnormal_for_in.js 1`] = ` +"function foo(x: boolean) { + var obj = { a: 1, b: 2}; + for (var prop in obj) { + if (x) { + continue; + } + return; + } + console.log(\'this is still reachable\'); +} + +function bar(x: boolean) { + for (var prop in {}) { + return; + } + console.log(\'this is still reachable\'); +} + +function baz(x: boolean) { + for (var prop in {}) { + continue; + } + console.log(\'this is still reachable\'); +} + +function bliffl(x: boolean) { + var obj = { a: 1, b: 2}; + loop1: for (var prop1 in obj) { + loop2: for (var prop2 in obj) { + break loop1; + } + console.log(\'this is still reachable\'); + } + console.log(\'this is still reachable\'); +} + +function corge(x: boolean) { + for (var prop in {}) { + break; + } + console.log(\'this is still reachable\'); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function foo(x: boolean) { + var obj = { a: 1, b: 2 }; + for (var prop in obj) { + if (x) { + continue; + } + return; + } + console.log(\"this is still reachable\"); +} + +function bar(x: boolean) { + for (var prop in {}) { + return; + } + console.log(\"this is still reachable\"); +} + +function baz(x: boolean) { + for (var prop in {}) { + continue; + } + console.log(\"this is still reachable\"); +} + +function bliffl(x: boolean) { + var obj = { a: 1, b: 2 }; + loop1: + for (var prop1 in obj) { + loop2: + for (var prop2 in obj) { + break loop1; + } + console.log(\"this is still reachable\"); + } + console.log(\"this is still reachable\"); +} + +function corge(x: boolean) { + for (var prop in {}) { + break; + } + console.log(\"this is still reachable\"); +} +" +`; + +exports[`test abnormal_for_of.js 1`] = ` +"function foo(x: boolean) { + var arr = [1, 2, 3]; + for (var elem of arr) { + if (x) { + continue; + } + return; + } + console.log(\'this is still reachable\'); +} + +function bar(x: boolean) { + for (var elem of []) { + return; + } + console.log(\'this is still reachable\'); +} + +function baz(x: boolean) { + for (var elem of []) { + continue; + } + console.log(\'this is still reachable\'); +} + +function bliffl(x: boolean) { + var arr = [1, 2, 3]; + loop1: for (var elem of arr) { + loop2: for (var elem of arr) { + break loop1; + } + console.log(\'this is still reachable\'); + } + console.log(\'this is still reachable\'); +} + +function corge(x: boolean) { + for (var elem of []) { + break; + } + console.log(\'this is still reachable\'); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function foo(x: boolean) { + var arr = [1, 2, 3]; + for (var elem of arr) { + if (x) { + continue; + } + return; + } + console.log(\"this is still reachable\"); +} + +function bar(x: boolean) { + for (var elem of []) { + return; + } + console.log(\"this is still reachable\"); +} + +function baz(x: boolean) { + for (var elem of []) { + continue; + } + console.log(\"this is still reachable\"); +} + +function bliffl(x: boolean) { + var arr = [1, 2, 3]; + loop1: + for (var elem of arr) { + loop2: + for (var elem of arr) { + break loop1; + } + console.log(\"this is still reachable\"); + } + console.log(\"this is still reachable\"); +} + +function corge(x: boolean) { + for (var elem of []) { + break; + } + console.log(\"this is still reachable\"); +} +" +`; diff --git a/tests/for/abnormal.js b/tests/flow/for/abnormal.js similarity index 100% rename from tests/for/abnormal.js rename to tests/flow/for/abnormal.js diff --git a/tests/for/abnormal_for_in.js b/tests/flow/for/abnormal_for_in.js similarity index 100% rename from tests/for/abnormal_for_in.js rename to tests/flow/for/abnormal_for_in.js diff --git a/tests/for/abnormal_for_of.js b/tests/flow/for/abnormal_for_of.js similarity index 100% rename from tests/for/abnormal_for_of.js rename to tests/flow/for/abnormal_for_of.js diff --git a/tests/getters_and_setters_enabled/jsfmt.spec.js b/tests/flow/for/jsfmt.spec.js similarity index 100% rename from tests/getters_and_setters_enabled/jsfmt.spec.js rename to tests/flow/for/jsfmt.spec.js diff --git a/tests/forof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/forof/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/forof/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/forof/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/forof/forof.js b/tests/flow/forof/forof.js similarity index 100% rename from tests/forof/forof.js rename to tests/flow/forof/forof.js diff --git a/tests/haste_cycle/jsfmt.spec.js b/tests/flow/forof/jsfmt.spec.js similarity index 100% rename from tests/haste_cycle/jsfmt.spec.js rename to tests/flow/forof/jsfmt.spec.js diff --git a/tests/flow/function/__snapshots__/jsfmt.spec.js.snap b/tests/flow/function/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..5c59497e --- /dev/null +++ b/tests/flow/function/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,405 @@ +exports[`test apply.js 1`] = ` +"function test(a: string, b: number): number { + return this.length; // expect []/\"\" this +} + +// tuples flow correctly into params +test.apply(\"\", [\"\", 0]); + +// wrong this is an error +test.apply(0, [\"\", 0]); // error: lookup \`length\` on Number + +// not enough arguments is an error (via incompatible RestT) +test.apply(\"\", [\"\"]); // error: string ~> number + +// mistyped arguments is an error +test.apply(\"\", [\"\", \"\"]); // error: string ~> number (2nd arg) +test.apply(\"\", [0, 0]); // error: number ~> string (1st arg) + +// resolve args array from tvar +function f(args) { test.apply(\"\", args) } +f([\"\", 0]); // OK +f([\"\", \"\"]); // error: string ~> number (2nd arg) +f([0, 0]); // error: number ~> string (1st arg) + +// expect array +test.apply(\"\", \"not array\"); // error: expect array of args + +// expect 4 errors: +// - lookup length on Number (because 0 is used as \`this\`) +// - 123 is not a string +// - \'foo\' is not a number +// - return type (number) is not void +(test.call.apply(test, [0, 123, \'foo\']): void); + +// expect 2 errors: +// - lookup length on number (0 is used as \`this\`) +// - 123 is not a string +(test.bind.apply(test, [0, 123]): (b: number) => number); + +// args are optional +function test2(): number { return 0; } +(test2.apply(): number); +(test2.apply(\"\"): number); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function test(a: string, b: number): number { + return this.length; // expect []/\"\" this +} + +// tuples flow correctly into params +test.apply(\"\", [\"\", 0]); + +// wrong this is an error +test.apply(0, [\"\", 0]); + +// error: lookup \`length\` on Number +// not enough arguments is an error (via incompatible RestT) +test.apply(\"\", [\"\"]); + +// error: string ~> number +// mistyped arguments is an error +test.apply(\"\", [\"\", \"\"]); +// error: string ~> number (2nd arg) +test.apply(\"\", [0, 0]); + +// error: number ~> string (1st arg) +// resolve args array from tvar +function f(args) { + test.apply(\"\", args); +} +f([\"\", 0]); +// OK +f([\"\", \"\"]); +// error: string ~> number (2nd arg) +f([0, 0]); + +// error: number ~> string (1st arg) +// expect array +test.apply(\"\", \"not array\"); + +// error: expect array of args +// expect 4 errors: +// - lookup length on Number (because 0 is used as \`this\`) +// - 123 is not a string +// - \'foo\' is not a number +// - return type (number) is not void +(test.call.apply(test, [0, 123, \"foo\"]): void); + +// expect 2 errors: +// - lookup length on number (0 is used as \`this\`) +// - 123 is not a string +(test.bind.apply(test, [0, 123]): (b: number) => number); + +// args are optional +function test2(): number { + return 0; +} +(test2.apply(): number); +(test2.apply(\"\"): number); +" +`; + +exports[`test bind.js 1`] = ` +"// @flow + +let tests = [ + function(x: (a: string, b: string) => void) { + let y = x.bind(x, \'foo\'); + y(\'bar\'); // ok + y(123); // error, number !~> string + }, +]; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +let tests = [ + function(x: (a: string, b: string) => void) { + let y = x.bind(x, \"foo\"); + y(\"bar\"); + // ok + y(123); // error, number !~> string + } +]; +" +`; + +exports[`test call.js 1`] = ` +"// @flow + +function test(a: string, b: number): number { + return this.length; // expect []/\"\" this +} + +// args flow correctly into params +test.call(\"\", \"\", 0); + +// wrong this is an error +test.call(0, \"\", 0); // error: lookup \`length\` on Number + +// not enough arguments is an error (via incompatible RestT) +test.call(\"\", \"\"); // error: string ~> number + +// mistyped arguments is an error +test.call(\"\", \"\", \"\"); // error: string ~> number (2nd arg) +test.call(\"\", 0, 0); // error: number ~> string (1st arg) + +// resolve args array from tvar +function f(args) { test.call(\"\", args[0], args[1]) } +f([\"\", 0]); // OK +f([\"\", \"\"]); // error: string ~> number (2nd arg) +f([0, 0]); // error: number ~> string (1st arg) + +// expect 3 errors: +// - lookup length on Number (0 used as \`this\`) +// - number !~> string (param a) +// - string !~> number (param b) +(test.apply.call(test, 0, [0, \'foo\']): number); + +// args are optional +function test2(): number { return 0; } +(test2.call(): number); +(test2.call(\"\"): number); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +function test(a: string, b: number): number { + return this.length; // expect []/\"\" this +} + +// args flow correctly into params +test.call(\"\", \"\", 0); + +// wrong this is an error +test.call(0, \"\", 0); + +// error: lookup \`length\` on Number +// not enough arguments is an error (via incompatible RestT) +test.call(\"\", \"\"); + +// error: string ~> number +// mistyped arguments is an error +test.call(\"\", \"\", \"\"); +// error: string ~> number (2nd arg) +test.call(\"\", 0, 0); + +// error: number ~> string (1st arg) +// resolve args array from tvar +function f(args) { + test.call(\"\", args[0], args[1]); +} +f([\"\", 0]); +// OK +f([\"\", \"\"]); +// error: string ~> number (2nd arg) +f([0, 0]); + +// error: number ~> string (1st arg) +// expect 3 errors: +// - lookup length on Number (0 used as \`this\`) +// - number !~> string (param a) +// - string !~> number (param b) +(test.apply.call(test, 0, [0, \"foo\"]): number); + +// args are optional +function test2(): number { + return 0; +} +(test2.call(): number); +(test2.call(\"\"): number); +" +`; + +exports[`test function.js 1`] = ` +"/** + * @flow + */ + +// Previously we represented Function as (...rest: any) => any +// This means the following wouldn\'t pass, because that arrow function +// can only be called with 3 arguments. +var a: Function = (a, b, c) => 123; + +var b: Function = function(a: number, b: number): number { return a + b; }; + +class C {} + +var c: Function = C; + +function good(x: Function, MyThing: Function): number { + var o: Object = x; // Function is an Object + x.foo = 123; + x[\'foo\'] = 456; + x(); + ; + var {...something} = x; + Object.assign(x, {hi: \'there\'}); + Object.keys(x); + return x.bar + x[\'bar\'] + x.lala(); +} + +function bad(x: Function, y: Object): void { + var a: number = x; // Error + var b: string = x; // Error + var c: Function = y; // Object is not a Function +} + +let tests = [ + function(y: () => void, z: Function) { + function x() {} + (x.length: void); // error, it\'s a number + (y.length: void); // error, it\'s a number + (z.length: void); // error, it\'s a number + + (x.name: void); // error, it\'s a string + (y.name: void); // error, it\'s a string + (z.name: void); // error, it\'s a string + }, + + function(y: () => void, z: Function) { + function x() {} + x.length = \'foo\'; // error, it\'s a number + y.length = \'foo\'; // error, it\'s a number + z.length = \'foo\'; // error, it\'s a number + + x.name = 123; // error, it\'s a string + y.name = 123; // error, it\'s a string + z.name = 123; // error, it\'s a string + + // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` + (z.foo: number); + (z.foo: string); + }, +]; + +// \`Function\` types can be bound (resulting in a \`Function\` type) +var d: Function = () => 1; +var e = (d.bind(1): Function)(); +(e: number); +(e: string); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @flow + */ + +// Previously we represented Function as (...rest: any) => any +// This means the following wouldn\'t pass, because that arrow function +// can only be called with 3 arguments. +var a: Function = (a, b, c) => 123; + +var b: Function = function(a: number, b: number): number { + return a + b; +}; + +class C {} + +var c: Function = C; + +function good(x: Function, MyThing: Function): number { + var o: Object = x; + // Function is an Object + x.foo = 123; + x[\"foo\"] = 456; + x(); + ; + var { ...something } = x; + Object.assign(x, { hi: \"there\" }); + Object.keys(x); + return x.bar + x[\"bar\"] + x.lala(); +} + +function bad(x: Function, y: Object): void { + var a: number = x; + // Error + var b: string = x; + // Error + var c: Function = y; // Object is not a Function +} + +let tests = [ + function(y: () => void, z: Function) { + function x() {} + (x.length: void); + // error, it\'s a number + (y.length: void); + // error, it\'s a number + (z.length: void); + + // error, it\'s a number + (x.name: void); + // error, it\'s a string + (y.name: void); + // error, it\'s a string + (z.name: void); // error, it\'s a string + }, + function(y: () => void, z: Function) { + function x() {} + x.length = \"foo\"; + // error, it\'s a number + y.length = \"foo\"; + // error, it\'s a number + z.length = \"foo\"; + + // error, it\'s a number + x.name = 123; + // error, it\'s a string + y.name = 123; + // error, it\'s a string + z.name = 123; + + // error, it\'s a string + // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` + (z.foo: number); + (z.foo: string); + } +]; + +// \`Function\` types can be bound (resulting in a \`Function\` type) +var d: Function = () => 1; +var e = (d.bind(1): Function)(); +(e: number); +(e: string); +" +`; + +exports[`test rest.js 1`] = ` +"/* regression tests */ + +function rest_array(...xs: Array): T { + return xs[0]; +} + +// Warn, singleton tuple types don\'t represent rest params +function rest_tuple(...xs: [T]): T { + return xs[0]; +} + +function rest_any(...xs: any): any { + return xs[0]; +} + +// Warn, arbitrary subtypes of an array type don\'t represent rest params +function rest_t>(...xs: T): U { + return xs[0]; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* regression tests */ + +function rest_array(...xs: Array): T { + return xs[0]; +} + +// Warn, singleton tuple types don\'t represent rest params +function rest_tuple(...xs: [T]): T { + return xs[0]; +} + +function rest_any(...xs: any): any { + return xs[0]; +} + +// Warn, arbitrary subtypes of an array type don\'t represent rest params +function rest_t>(...xs: T): U { + return xs[0]; +} +" +`; diff --git a/tests/function/apply.js b/tests/flow/function/apply.js similarity index 100% rename from tests/function/apply.js rename to tests/flow/function/apply.js diff --git a/tests/function/bind.js b/tests/flow/function/bind.js similarity index 100% rename from tests/function/bind.js rename to tests/flow/function/bind.js diff --git a/tests/function/call.js b/tests/flow/function/call.js similarity index 100% rename from tests/function/call.js rename to tests/flow/function/call.js diff --git a/tests/function/function.js b/tests/flow/function/function.js similarity index 100% rename from tests/function/function.js rename to tests/flow/function/function.js diff --git a/tests/haste_cycle/models/jsfmt.spec.js b/tests/flow/function/jsfmt.spec.js similarity index 100% rename from tests/haste_cycle/models/jsfmt.spec.js rename to tests/flow/function/jsfmt.spec.js diff --git a/tests/function/rest.js b/tests/flow/function/rest.js similarity index 100% rename from tests/function/rest.js rename to tests/flow/function/rest.js diff --git a/tests/funrec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/funrec/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/funrec/funrec.js b/tests/flow/funrec/funrec.js similarity index 100% rename from tests/funrec/funrec.js rename to tests/flow/funrec/funrec.js diff --git a/tests/haste_dupe/jsfmt.spec.js b/tests/flow/funrec/jsfmt.spec.js similarity index 100% rename from tests/haste_dupe/jsfmt.spec.js rename to tests/flow/funrec/jsfmt.spec.js diff --git a/tests/generators/__snapshots__/jsfmt.spec.js.snap b/tests/flow/generators/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/generators/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/generators/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/generators/class.js b/tests/flow/generators/class.js similarity index 100% rename from tests/generators/class.js rename to tests/flow/generators/class.js diff --git a/tests/generators/class_failure.js b/tests/flow/generators/class_failure.js similarity index 100% rename from tests/generators/class_failure.js rename to tests/flow/generators/class_failure.js diff --git a/tests/generators/generators.js b/tests/flow/generators/generators.js similarity index 100% rename from tests/generators/generators.js rename to tests/flow/generators/generators.js diff --git a/tests/ignore_package/jsfmt.spec.js b/tests/flow/generators/jsfmt.spec.js similarity index 100% rename from tests/ignore_package/jsfmt.spec.js rename to tests/flow/generators/jsfmt.spec.js diff --git a/tests/generators/return.js b/tests/flow/generators/return.js similarity index 100% rename from tests/generators/return.js rename to tests/flow/generators/return.js diff --git a/tests/generators/throw.js b/tests/flow/generators/throw.js similarity index 100% rename from tests/generators/throw.js rename to tests/flow/generators/throw.js diff --git a/tests/generators/variance.js b/tests/flow/generators/variance.js similarity index 100% rename from tests/generators/variance.js rename to tests/flow/generators/variance.js diff --git a/tests/generics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/generics/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/generics/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/generics/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/generics/generics.js b/tests/flow/generics/generics.js similarity index 100% rename from tests/generics/generics.js rename to tests/flow/generics/generics.js diff --git a/tests/immutable_methods/jsfmt.spec.js b/tests/flow/generics/jsfmt.spec.js similarity index 100% rename from tests/immutable_methods/jsfmt.spec.js rename to tests/flow/generics/jsfmt.spec.js diff --git a/tests/geolocation/__snapshots__/jsfmt.spec.js.snap b/tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/geolocation/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/geolocation/a.js b/tests/flow/geolocation/a.js similarity index 100% rename from tests/geolocation/a.js rename to tests/flow/geolocation/a.js diff --git a/tests/import_type/jsfmt.spec.js b/tests/flow/geolocation/jsfmt.spec.js similarity index 100% rename from tests/import_type/jsfmt.spec.js rename to tests/flow/geolocation/jsfmt.spec.js diff --git a/tests/get-def/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/get-def/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/get-def/example.js b/tests/flow/get-def/example.js similarity index 100% rename from tests/get-def/example.js rename to tests/flow/get-def/example.js diff --git a/tests/get-def/helpers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/get-def/helpers/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/get-def/helpers/exports_default.js b/tests/flow/get-def/helpers/exports_default.js similarity index 100% rename from tests/get-def/helpers/exports_default.js rename to tests/flow/get-def/helpers/exports_default.js diff --git a/tests/get-def/helpers/exports_named.js b/tests/flow/get-def/helpers/exports_named.js similarity index 100% rename from tests/get-def/helpers/exports_named.js rename to tests/flow/get-def/helpers/exports_named.js diff --git a/tests/import_typeof/jsfmt.spec.js b/tests/flow/get-def/helpers/jsfmt.spec.js similarity index 100% rename from tests/import_typeof/jsfmt.spec.js rename to tests/flow/get-def/helpers/jsfmt.spec.js diff --git a/tests/get-def/imports.js b/tests/flow/get-def/imports.js similarity index 100% rename from tests/get-def/imports.js rename to tests/flow/get-def/imports.js diff --git a/tests/include/foo/batman/jsfmt.spec.js b/tests/flow/get-def/jsfmt.spec.js similarity index 100% rename from tests/include/foo/batman/jsfmt.spec.js rename to tests/flow/get-def/jsfmt.spec.js diff --git a/tests/get-def/library.js b/tests/flow/get-def/library.js similarity index 100% rename from tests/get-def/library.js rename to tests/flow/get-def/library.js diff --git a/tests/get-def2/Parent.js b/tests/flow/get-def2/Parent.js similarity index 100% rename from tests/get-def2/Parent.js rename to tests/flow/get-def2/Parent.js diff --git a/tests/get-def2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/get-def2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/include/included/jsfmt.spec.js b/tests/flow/get-def2/jsfmt.spec.js similarity index 100% rename from tests/include/included/jsfmt.spec.js rename to tests/flow/get-def2/jsfmt.spec.js diff --git a/tests/get-def2/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/get-def2/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental/jsfmt.spec.js b/tests/flow/get-def2/lib/jsfmt.spec.js similarity index 100% rename from tests/incremental/jsfmt.spec.js rename to tests/flow/get-def2/lib/jsfmt.spec.js diff --git a/tests/get-def2/lib/jsx.js b/tests/flow/get-def2/lib/jsx.js similarity index 100% rename from tests/get-def2/lib/jsx.js rename to tests/flow/get-def2/lib/jsx.js diff --git a/tests/get-def2/main.js b/tests/flow/get-def2/main.js similarity index 100% rename from tests/get-def2/main.js rename to tests/flow/get-def2/main.js diff --git a/tests/get-def2/override.js b/tests/flow/get-def2/override.js similarity index 100% rename from tests/get-def2/override.js rename to tests/flow/get-def2/override.js diff --git a/tests/get-def2/react.js b/tests/flow/get-def2/react.js similarity index 100% rename from tests/get-def2/react.js rename to tests/flow/get-def2/react.js diff --git a/tests/get-def2/types.js b/tests/flow/get-def2/types.js similarity index 100% rename from tests/get-def2/types.js rename to tests/flow/get-def2/types.js diff --git a/tests/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/get-imports-and-importers/a.js b/tests/flow/get-imports-and-importers/a.js similarity index 100% rename from tests/get-imports-and-importers/a.js rename to tests/flow/get-imports-and-importers/a.js diff --git a/tests/get-imports-and-importers/b.js b/tests/flow/get-imports-and-importers/b.js similarity index 100% rename from tests/get-imports-and-importers/b.js rename to tests/flow/get-imports-and-importers/b.js diff --git a/tests/get-imports-and-importers/c.js b/tests/flow/get-imports-and-importers/c.js similarity index 100% rename from tests/get-imports-and-importers/c.js rename to tests/flow/get-imports-and-importers/c.js diff --git a/tests/incremental_basic/jsfmt.spec.js b/tests/flow/get-imports-and-importers/jsfmt.spec.js similarity index 100% rename from tests/incremental_basic/jsfmt.spec.js rename to tests/flow/get-imports-and-importers/jsfmt.spec.js diff --git a/tests/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap b/tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/getters_and_setters_disabled/getters_and_setters.js b/tests/flow/getters_and_setters_disabled/getters_and_setters.js similarity index 100% rename from tests/getters_and_setters_disabled/getters_and_setters.js rename to tests/flow/getters_and_setters_disabled/getters_and_setters.js diff --git a/tests/incremental_basic/tmp1/jsfmt.spec.js b/tests/flow/getters_and_setters_disabled/jsfmt.spec.js similarity index 100% rename from tests/incremental_basic/tmp1/jsfmt.spec.js rename to tests/flow/getters_and_setters_disabled/jsfmt.spec.js diff --git a/tests/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap b/tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/getters_and_setters_enabled/class.js b/tests/flow/getters_and_setters_enabled/class.js similarity index 100% rename from tests/getters_and_setters_enabled/class.js rename to tests/flow/getters_and_setters_enabled/class.js diff --git a/tests/incremental_basic/tmp2/jsfmt.spec.js b/tests/flow/getters_and_setters_enabled/jsfmt.spec.js similarity index 100% rename from tests/incremental_basic/tmp2/jsfmt.spec.js rename to tests/flow/getters_and_setters_enabled/jsfmt.spec.js diff --git a/tests/getters_and_setters_enabled/object.js b/tests/flow/getters_and_setters_enabled/object.js similarity index 100% rename from tests/getters_and_setters_enabled/object.js rename to tests/flow/getters_and_setters_enabled/object.js diff --git a/tests/getters_and_setters_enabled/react.js b/tests/flow/getters_and_setters_enabled/react.js similarity index 100% rename from tests/getters_and_setters_enabled/react.js rename to tests/flow/getters_and_setters_enabled/react.js diff --git a/tests/getters_and_setters_enabled/variance.js b/tests/flow/getters_and_setters_enabled/variance.js similarity index 100% rename from tests/getters_and_setters_enabled/variance.js rename to tests/flow/getters_and_setters_enabled/variance.js diff --git a/tests/haste_cycle/API.js b/tests/flow/haste_cycle/API.js similarity index 100% rename from tests/haste_cycle/API.js rename to tests/flow/haste_cycle/API.js diff --git a/tests/haste_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/haste_cycle/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_basic/tmp3/jsfmt.spec.js b/tests/flow/haste_cycle/jsfmt.spec.js similarity index 100% rename from tests/incremental_basic/tmp3/jsfmt.spec.js rename to tests/flow/haste_cycle/jsfmt.spec.js diff --git a/tests/haste_cycle/models/OpenGraphAction.js b/tests/flow/haste_cycle/models/OpenGraphAction.js similarity index 100% rename from tests/haste_cycle/models/OpenGraphAction.js rename to tests/flow/haste_cycle/models/OpenGraphAction.js diff --git a/tests/haste_cycle/models/OpenGraphObject.js b/tests/flow/haste_cycle/models/OpenGraphObject.js similarity index 100% rename from tests/haste_cycle/models/OpenGraphObject.js rename to tests/flow/haste_cycle/models/OpenGraphObject.js diff --git a/tests/haste_cycle/models/OpenGraphValueContainer.js b/tests/flow/haste_cycle/models/OpenGraphValueContainer.js similarity index 100% rename from tests/haste_cycle/models/OpenGraphValueContainer.js rename to tests/flow/haste_cycle/models/OpenGraphValueContainer.js diff --git a/tests/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_cycle/jsfmt.spec.js b/tests/flow/haste_cycle/models/jsfmt.spec.js similarity index 100% rename from tests/incremental_cycle/jsfmt.spec.js rename to tests/flow/haste_cycle/models/jsfmt.spec.js diff --git a/tests/haste_dupe/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/haste_dupe/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/haste_dupe/dupe1.js b/tests/flow/haste_dupe/dupe1.js similarity index 100% rename from tests/haste_dupe/dupe1.js rename to tests/flow/haste_dupe/dupe1.js diff --git a/tests/haste_dupe/dupe2.js b/tests/flow/haste_dupe/dupe2.js similarity index 100% rename from tests/haste_dupe/dupe2.js rename to tests/flow/haste_dupe/dupe2.js diff --git a/tests/incremental_cycle/tmp1/jsfmt.spec.js b/tests/flow/haste_dupe/jsfmt.spec.js similarity index 100% rename from tests/incremental_cycle/tmp1/jsfmt.spec.js rename to tests/flow/haste_dupe/jsfmt.spec.js diff --git a/tests/haste_dupe/requires_dupe.js b/tests/flow/haste_dupe/requires_dupe.js similarity index 100% rename from tests/haste_dupe/requires_dupe.js rename to tests/flow/haste_dupe/requires_dupe.js diff --git a/tests/ignore_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/ignore_package/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/ignore_package/foo.js b/tests/flow/ignore_package/foo.js similarity index 100% rename from tests/ignore_package/foo.js rename to tests/flow/ignore_package/foo.js diff --git a/tests/incremental_cycle/tmp2/jsfmt.spec.js b/tests/flow/ignore_package/jsfmt.spec.js similarity index 100% rename from tests/incremental_cycle/tmp2/jsfmt.spec.js rename to tests/flow/ignore_package/jsfmt.spec.js diff --git a/tests/immutable_methods/__snapshots__/jsfmt.spec.js.snap b/tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/immutable_methods/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_cycle/tmp3/jsfmt.spec.js b/tests/flow/immutable_methods/jsfmt.spec.js similarity index 100% rename from tests/incremental_cycle/tmp3/jsfmt.spec.js rename to tests/flow/immutable_methods/jsfmt.spec.js diff --git a/tests/immutable_methods/test.js b/tests/flow/immutable_methods/test.js similarity index 100% rename from tests/immutable_methods/test.js rename to tests/flow/immutable_methods/test.js diff --git a/tests/import_type/ExportCJSDefault_Class.js b/tests/flow/import_type/ExportCJSDefault_Class.js similarity index 100% rename from tests/import_type/ExportCJSDefault_Class.js rename to tests/flow/import_type/ExportCJSDefault_Class.js diff --git a/tests/import_type/ExportCJSNamed_Class.js b/tests/flow/import_type/ExportCJSNamed_Class.js similarity index 100% rename from tests/import_type/ExportCJSNamed_Class.js rename to tests/flow/import_type/ExportCJSNamed_Class.js diff --git a/tests/import_type/ExportDefault_Class.js b/tests/flow/import_type/ExportDefault_Class.js similarity index 100% rename from tests/import_type/ExportDefault_Class.js rename to tests/flow/import_type/ExportDefault_Class.js diff --git a/tests/import_type/ExportNamed_Alias.js b/tests/flow/import_type/ExportNamed_Alias.js similarity index 100% rename from tests/import_type/ExportNamed_Alias.js rename to tests/flow/import_type/ExportNamed_Alias.js diff --git a/tests/import_type/ExportNamed_Class.js b/tests/flow/import_type/ExportNamed_Class.js similarity index 100% rename from tests/import_type/ExportNamed_Class.js rename to tests/flow/import_type/ExportNamed_Class.js diff --git a/tests/import_type/ExportsANumber.js b/tests/flow/import_type/ExportsANumber.js similarity index 100% rename from tests/import_type/ExportsANumber.js rename to tests/flow/import_type/ExportsANumber.js diff --git a/tests/import_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/import_type/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/import_type/import_type.js b/tests/flow/import_type/import_type.js similarity index 100% rename from tests/import_type/import_type.js rename to tests/flow/import_type/import_type.js diff --git a/tests/import_type/issue-359.js b/tests/flow/import_type/issue-359.js similarity index 100% rename from tests/import_type/issue-359.js rename to tests/flow/import_type/issue-359.js diff --git a/tests/incremental_delete/jsfmt.spec.js b/tests/flow/import_type/jsfmt.spec.js similarity index 100% rename from tests/incremental_delete/jsfmt.spec.js rename to tests/flow/import_type/jsfmt.spec.js diff --git a/tests/import_typeof/ExportCJSDefault_Class.js b/tests/flow/import_typeof/ExportCJSDefault_Class.js similarity index 100% rename from tests/import_typeof/ExportCJSDefault_Class.js rename to tests/flow/import_typeof/ExportCJSDefault_Class.js diff --git a/tests/import_typeof/ExportCJSDefault_Number.js b/tests/flow/import_typeof/ExportCJSDefault_Number.js similarity index 100% rename from tests/import_typeof/ExportCJSDefault_Number.js rename to tests/flow/import_typeof/ExportCJSDefault_Number.js diff --git a/tests/import_typeof/ExportCJSNamed_Class.js b/tests/flow/import_typeof/ExportCJSNamed_Class.js similarity index 100% rename from tests/import_typeof/ExportCJSNamed_Class.js rename to tests/flow/import_typeof/ExportCJSNamed_Class.js diff --git a/tests/import_typeof/ExportCJSNamed_Number.js b/tests/flow/import_typeof/ExportCJSNamed_Number.js similarity index 100% rename from tests/import_typeof/ExportCJSNamed_Number.js rename to tests/flow/import_typeof/ExportCJSNamed_Number.js diff --git a/tests/import_typeof/ExportDefault_Class.js b/tests/flow/import_typeof/ExportDefault_Class.js similarity index 100% rename from tests/import_typeof/ExportDefault_Class.js rename to tests/flow/import_typeof/ExportDefault_Class.js diff --git a/tests/import_typeof/ExportDefault_Number.js b/tests/flow/import_typeof/ExportDefault_Number.js similarity index 100% rename from tests/import_typeof/ExportDefault_Number.js rename to tests/flow/import_typeof/ExportDefault_Number.js diff --git a/tests/import_typeof/ExportNamed_Alias.js b/tests/flow/import_typeof/ExportNamed_Alias.js similarity index 100% rename from tests/import_typeof/ExportNamed_Alias.js rename to tests/flow/import_typeof/ExportNamed_Alias.js diff --git a/tests/import_typeof/ExportNamed_Class.js b/tests/flow/import_typeof/ExportNamed_Class.js similarity index 100% rename from tests/import_typeof/ExportNamed_Class.js rename to tests/flow/import_typeof/ExportNamed_Class.js diff --git a/tests/import_typeof/ExportNamed_Multi.js b/tests/flow/import_typeof/ExportNamed_Multi.js similarity index 100% rename from tests/import_typeof/ExportNamed_Multi.js rename to tests/flow/import_typeof/ExportNamed_Multi.js diff --git a/tests/import_typeof/ExportNamed_Number.js b/tests/flow/import_typeof/ExportNamed_Number.js similarity index 100% rename from tests/import_typeof/ExportNamed_Number.js rename to tests/flow/import_typeof/ExportNamed_Number.js diff --git a/tests/import_typeof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/import_typeof/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/import_typeof/import_typeof.js b/tests/flow/import_typeof/import_typeof.js similarity index 100% rename from tests/import_typeof/import_typeof.js rename to tests/flow/import_typeof/import_typeof.js diff --git a/tests/incremental_duplicate_delete/jsfmt.spec.js b/tests/flow/import_typeof/jsfmt.spec.js similarity index 100% rename from tests/incremental_duplicate_delete/jsfmt.spec.js rename to tests/flow/import_typeof/jsfmt.spec.js diff --git a/tests/include/foo/batman/__snapshots__/jsfmt.spec.js.snap b/tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/include/foo/batman/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/include/foo/batman/baz.js b/tests/flow/include/foo/batman/baz.js similarity index 100% rename from tests/include/foo/batman/baz.js rename to tests/flow/include/foo/batman/baz.js diff --git a/tests/incremental_json/jsfmt.spec.js b/tests/flow/include/foo/batman/jsfmt.spec.js similarity index 100% rename from tests/incremental_json/jsfmt.spec.js rename to tests/flow/include/foo/batman/jsfmt.spec.js diff --git a/tests/include/included/__snapshots__/jsfmt.spec.js.snap b/tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/include/included/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_mixed_naming_cycle/jsfmt.spec.js b/tests/flow/include/included/jsfmt.spec.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/jsfmt.spec.js rename to tests/flow/include/included/jsfmt.spec.js diff --git a/tests/include/included/test.js b/tests/flow/include/included/test.js similarity index 100% rename from tests/include/included/test.js rename to tests/flow/include/included/test.js diff --git a/tests/incremental/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental/a.js b/tests/flow/incremental/a.js similarity index 100% rename from tests/incremental/a.js rename to tests/flow/incremental/a.js diff --git a/tests/incremental/b.js b/tests/flow/incremental/b.js similarity index 100% rename from tests/incremental/b.js rename to tests/flow/incremental/b.js diff --git a/tests/incremental/dup_a.js b/tests/flow/incremental/dup_a.js similarity index 100% rename from tests/incremental/dup_a.js rename to tests/flow/incremental/dup_a.js diff --git a/tests/incremental_mixed_naming_cycle/tmp1/jsfmt.spec.js b/tests/flow/incremental/jsfmt.spec.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/tmp1/jsfmt.spec.js rename to tests/flow/incremental/jsfmt.spec.js diff --git a/tests/incremental_basic/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_basic/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_basic/a.js b/tests/flow/incremental_basic/a.js similarity index 100% rename from tests/incremental_basic/a.js rename to tests/flow/incremental_basic/a.js diff --git a/tests/incremental_basic/b.js b/tests/flow/incremental_basic/b.js similarity index 100% rename from tests/incremental_basic/b.js rename to tests/flow/incremental_basic/b.js diff --git a/tests/incremental_basic/c.js b/tests/flow/incremental_basic/c.js similarity index 100% rename from tests/incremental_basic/c.js rename to tests/flow/incremental_basic/c.js diff --git a/tests/incremental_non_flow_move/jsfmt.spec.js b/tests/flow/incremental_basic/jsfmt.spec.js similarity index 100% rename from tests/incremental_non_flow_move/jsfmt.spec.js rename to tests/flow/incremental_basic/jsfmt.spec.js diff --git a/tests/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_basic/tmp1/b.js b/tests/flow/incremental_basic/tmp1/b.js similarity index 100% rename from tests/incremental_basic/tmp1/b.js rename to tests/flow/incremental_basic/tmp1/b.js diff --git a/tests/incremental_path/dir/jsfmt.spec.js b/tests/flow/incremental_basic/tmp1/jsfmt.spec.js similarity index 100% rename from tests/incremental_path/dir/jsfmt.spec.js rename to tests/flow/incremental_basic/tmp1/jsfmt.spec.js diff --git a/tests/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_basic/tmp2/a.js b/tests/flow/incremental_basic/tmp2/a.js similarity index 100% rename from tests/incremental_basic/tmp2/a.js rename to tests/flow/incremental_basic/tmp2/a.js diff --git a/tests/indexer/jsfmt.spec.js b/tests/flow/incremental_basic/tmp2/jsfmt.spec.js similarity index 100% rename from tests/indexer/jsfmt.spec.js rename to tests/flow/incremental_basic/tmp2/jsfmt.spec.js diff --git a/tests/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_basic/tmp3/b.js b/tests/flow/incremental_basic/tmp3/b.js similarity index 100% rename from tests/incremental_basic/tmp3/b.js rename to tests/flow/incremental_basic/tmp3/b.js diff --git a/tests/init/jsfmt.spec.js b/tests/flow/incremental_basic/tmp3/jsfmt.spec.js similarity index 100% rename from tests/init/jsfmt.spec.js rename to tests/flow/incremental_basic/tmp3/jsfmt.spec.js diff --git a/tests/incremental_cycle/A.js b/tests/flow/incremental_cycle/A.js similarity index 100% rename from tests/incremental_cycle/A.js rename to tests/flow/incremental_cycle/A.js diff --git a/tests/incremental_cycle/B.js b/tests/flow/incremental_cycle/B.js similarity index 100% rename from tests/incremental_cycle/B.js rename to tests/flow/incremental_cycle/B.js diff --git a/tests/incremental_cycle/C.js b/tests/flow/incremental_cycle/C.js similarity index 100% rename from tests/incremental_cycle/C.js rename to tests/flow/incremental_cycle/C.js diff --git a/tests/incremental_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_cycle/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/instanceof/jsfmt.spec.js b/tests/flow/incremental_cycle/jsfmt.spec.js similarity index 100% rename from tests/instanceof/jsfmt.spec.js rename to tests/flow/incremental_cycle/jsfmt.spec.js diff --git a/tests/incremental_cycle/tmp1/B.js b/tests/flow/incremental_cycle/tmp1/B.js similarity index 100% rename from tests/incremental_cycle/tmp1/B.js rename to tests/flow/incremental_cycle/tmp1/B.js diff --git a/tests/incremental_cycle/tmp1/C.js b/tests/flow/incremental_cycle/tmp1/C.js similarity index 100% rename from tests/incremental_cycle/tmp1/C.js rename to tests/flow/incremental_cycle/tmp1/C.js diff --git a/tests/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/integration/jsfmt.spec.js b/tests/flow/incremental_cycle/tmp1/jsfmt.spec.js similarity index 100% rename from tests/integration/jsfmt.spec.js rename to tests/flow/incremental_cycle/tmp1/jsfmt.spec.js diff --git a/tests/incremental_cycle/tmp2/B.js b/tests/flow/incremental_cycle/tmp2/B.js similarity index 100% rename from tests/incremental_cycle/tmp2/B.js rename to tests/flow/incremental_cycle/tmp2/B.js diff --git a/tests/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/intersection/jsfmt.spec.js b/tests/flow/incremental_cycle/tmp2/jsfmt.spec.js similarity index 100% rename from tests/intersection/jsfmt.spec.js rename to tests/flow/incremental_cycle/tmp2/jsfmt.spec.js diff --git a/tests/incremental_cycle/tmp3/B.js b/tests/flow/incremental_cycle/tmp3/B.js similarity index 100% rename from tests/incremental_cycle/tmp3/B.js rename to tests/flow/incremental_cycle/tmp3/B.js diff --git a/tests/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/intersection/lib/jsfmt.spec.js b/tests/flow/incremental_cycle/tmp3/jsfmt.spec.js similarity index 100% rename from tests/intersection/lib/jsfmt.spec.js rename to tests/flow/incremental_cycle/tmp3/jsfmt.spec.js diff --git a/tests/incremental_delete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_delete/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_delete/a.js b/tests/flow/incremental_delete/a.js similarity index 100% rename from tests/incremental_delete/a.js rename to tests/flow/incremental_delete/a.js diff --git a/tests/incremental_delete/b.js b/tests/flow/incremental_delete/b.js similarity index 100% rename from tests/incremental_delete/b.js rename to tests/flow/incremental_delete/b.js diff --git a/tests/incremental_delete/c.js b/tests/flow/incremental_delete/c.js similarity index 100% rename from tests/incremental_delete/c.js rename to tests/flow/incremental_delete/c.js diff --git a/tests/incremental_delete/dupe1.js b/tests/flow/incremental_delete/dupe1.js similarity index 100% rename from tests/incremental_delete/dupe1.js rename to tests/flow/incremental_delete/dupe1.js diff --git a/tests/incremental_delete/dupe2.js b/tests/flow/incremental_delete/dupe2.js similarity index 100% rename from tests/incremental_delete/dupe2.js rename to tests/flow/incremental_delete/dupe2.js diff --git a/tests/issues-11/jsfmt.spec.js b/tests/flow/incremental_delete/jsfmt.spec.js similarity index 100% rename from tests/issues-11/jsfmt.spec.js rename to tests/flow/incremental_delete/jsfmt.spec.js diff --git a/tests/incremental_delete/requires_dupe.js b/tests/flow/incremental_delete/requires_dupe.js similarity index 100% rename from tests/incremental_delete/requires_dupe.js rename to tests/flow/incremental_delete/requires_dupe.js diff --git a/tests/incremental_delete/requires_unchecked.js b/tests/flow/incremental_delete/requires_unchecked.js similarity index 100% rename from tests/incremental_delete/requires_unchecked.js rename to tests/flow/incremental_delete/requires_unchecked.js diff --git a/tests/incremental_delete/unchecked.js b/tests/flow/incremental_delete/unchecked.js similarity index 100% rename from tests/incremental_delete/unchecked.js rename to tests/flow/incremental_delete/unchecked.js diff --git a/tests/incremental_duplicate_delete/A.js b/tests/flow/incremental_duplicate_delete/A.js similarity index 100% rename from tests/incremental_duplicate_delete/A.js rename to tests/flow/incremental_duplicate_delete/A.js diff --git a/tests/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/iter/jsfmt.spec.js b/tests/flow/incremental_duplicate_delete/jsfmt.spec.js similarity index 100% rename from tests/iter/jsfmt.spec.js rename to tests/flow/incremental_duplicate_delete/jsfmt.spec.js diff --git a/tests/incremental_json/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_json/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/iterable/jsfmt.spec.js b/tests/flow/incremental_json/jsfmt.spec.js similarity index 100% rename from tests/iterable/jsfmt.spec.js rename to tests/flow/incremental_json/jsfmt.spec.js diff --git a/tests/incremental_json/test.js b/tests/flow/incremental_json/test.js similarity index 100% rename from tests/incremental_json/test.js rename to tests/flow/incremental_json/test.js diff --git a/tests/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_mixed_naming_cycle/a.js b/tests/flow/incremental_mixed_naming_cycle/a.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/a.js rename to tests/flow/incremental_mixed_naming_cycle/a.js diff --git a/tests/incremental_mixed_naming_cycle/b.js b/tests/flow/incremental_mixed_naming_cycle/b.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/b.js rename to tests/flow/incremental_mixed_naming_cycle/b.js diff --git a/tests/incremental_mixed_naming_cycle/c.js b/tests/flow/incremental_mixed_naming_cycle/c.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/c.js rename to tests/flow/incremental_mixed_naming_cycle/c.js diff --git a/tests/incremental_mixed_naming_cycle/d.js b/tests/flow/incremental_mixed_naming_cycle/d.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/d.js rename to tests/flow/incremental_mixed_naming_cycle/d.js diff --git a/tests/jsx_intrinsics.builtin/jsfmt.spec.js b/tests/flow/incremental_mixed_naming_cycle/jsfmt.spec.js similarity index 100% rename from tests/jsx_intrinsics.builtin/jsfmt.spec.js rename to tests/flow/incremental_mixed_naming_cycle/jsfmt.spec.js diff --git a/tests/incremental_mixed_naming_cycle/root.js b/tests/flow/incremental_mixed_naming_cycle/root.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/root.js rename to tests/flow/incremental_mixed_naming_cycle/root.js diff --git a/tests/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/jsx_intrinsics.custom/jsfmt.spec.js b/tests/flow/incremental_mixed_naming_cycle/tmp1/jsfmt.spec.js similarity index 100% rename from tests/jsx_intrinsics.custom/jsfmt.spec.js rename to tests/flow/incremental_mixed_naming_cycle/tmp1/jsfmt.spec.js diff --git a/tests/incremental_mixed_naming_cycle/tmp1/root.js b/tests/flow/incremental_mixed_naming_cycle/tmp1/root.js similarity index 100% rename from tests/incremental_mixed_naming_cycle/tmp1/root.js rename to tests/flow/incremental_mixed_naming_cycle/tmp1/root.js diff --git a/tests/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_non_flow_move/foo.js b/tests/flow/incremental_non_flow_move/foo.js similarity index 100% rename from tests/incremental_non_flow_move/foo.js rename to tests/flow/incremental_non_flow_move/foo.js diff --git a/tests/jsx_intrinsics.custom/lib/jsfmt.spec.js b/tests/flow/incremental_non_flow_move/jsfmt.spec.js similarity index 100% rename from tests/jsx_intrinsics.custom/lib/jsfmt.spec.js rename to tests/flow/incremental_non_flow_move/jsfmt.spec.js diff --git a/tests/incremental_non_flow_move/test.js b/tests/flow/incremental_non_flow_move/test.js similarity index 100% rename from tests/incremental_non_flow_move/test.js rename to tests/flow/incremental_non_flow_move/test.js diff --git a/tests/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/incremental_path/dir/a.js b/tests/flow/incremental_path/dir/a.js similarity index 100% rename from tests/incremental_path/dir/a.js rename to tests/flow/incremental_path/dir/a.js diff --git a/tests/keys/jsfmt.spec.js b/tests/flow/incremental_path/dir/jsfmt.spec.js similarity index 100% rename from tests/keys/jsfmt.spec.js rename to tests/flow/incremental_path/dir/jsfmt.spec.js diff --git a/tests/indexer/A.js b/tests/flow/indexer/A.js similarity index 100% rename from tests/indexer/A.js rename to tests/flow/indexer/A.js diff --git a/tests/indexer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/indexer/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/keyvalue/jsfmt.spec.js b/tests/flow/indexer/jsfmt.spec.js similarity index 100% rename from tests/keyvalue/jsfmt.spec.js rename to tests/flow/indexer/jsfmt.spec.js diff --git a/tests/indexer/multiple.js b/tests/flow/indexer/multiple.js similarity index 100% rename from tests/indexer/multiple.js rename to tests/flow/indexer/multiple.js diff --git a/tests/init/__snapshots__/jsfmt.spec.js.snap b/tests/flow/init/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/init/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/init/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/init/hoisted.js b/tests/flow/init/hoisted.js similarity index 100% rename from tests/init/hoisted.js rename to tests/flow/init/hoisted.js diff --git a/tests/init/hoisted2.js b/tests/flow/init/hoisted2.js similarity index 100% rename from tests/init/hoisted2.js rename to tests/flow/init/hoisted2.js diff --git a/tests/last_duplicate_property_wins/jsfmt.spec.js b/tests/flow/init/jsfmt.spec.js similarity index 100% rename from tests/last_duplicate_property_wins/jsfmt.spec.js rename to tests/flow/init/jsfmt.spec.js diff --git a/tests/init/let.js b/tests/flow/init/let.js similarity index 100% rename from tests/init/let.js rename to tests/flow/init/let.js diff --git a/tests/init/nullable-init.js b/tests/flow/init/nullable-init.js similarity index 100% rename from tests/init/nullable-init.js rename to tests/flow/init/nullable-init.js diff --git a/tests/instanceof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/instanceof/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/instanceof/instanceof.js b/tests/flow/instanceof/instanceof.js similarity index 100% rename from tests/instanceof/instanceof.js rename to tests/flow/instanceof/instanceof.js diff --git a/tests/lib/jsfmt.spec.js b/tests/flow/instanceof/jsfmt.spec.js similarity index 100% rename from tests/lib/jsfmt.spec.js rename to tests/flow/instanceof/jsfmt.spec.js diff --git a/tests/integration/__snapshots__/jsfmt.spec.js.snap b/tests/flow/integration/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/integration/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/integration/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/integration/bar.js b/tests/flow/integration/bar.js similarity index 100% rename from tests/integration/bar.js rename to tests/flow/integration/bar.js diff --git a/tests/integration/foo.js b/tests/flow/integration/foo.js similarity index 100% rename from tests/integration/foo.js rename to tests/flow/integration/foo.js diff --git a/tests/lib_interfaces/declarations/jsfmt.spec.js b/tests/flow/integration/jsfmt.spec.js similarity index 100% rename from tests/lib_interfaces/declarations/jsfmt.spec.js rename to tests/flow/integration/jsfmt.spec.js diff --git a/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap b/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..53fed2c5 --- /dev/null +++ b/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,193 @@ +exports[`test import.js 1`] = ` +"interface I { x: number } +export type J = I; // workaround for export interface +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +interface I { x: number } +export type J = I; // workaround for export interface +" +`; + +exports[`test indexer.js 1`] = ` +"// @flow + +interface Ok { + [key: string]: string; +} + +interface Bad { + [k1: string]: string; + [k2: number]: number; // error: not supported (yet) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +interface Ok { [key: string]: string } + +interface Bad { + [k1: string]: string, + [k2: number]: number /* error: not supported (yet)*/ +} +" +`; + +exports[`test interface.js 1`] = ` +"declare class C { x: number; } + +var x: string = new C().x; + +interface I { x: number; } + +var i = new I(); // error + +function testInterfaceName(o: I) { + (o.name: string); // error, name is static + (o.constructor.name: string); // ok +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +declare class C { x: number } + +var x: string = new C().x; + +interface I { x: number } + +var i = new I(); + +// error +function testInterfaceName(o: I) { + (o.name: string); + // error, name is static + (o.constructor.name: string); // ok +} +" +`; + +exports[`test test.js 1`] = ` +"interface I { y: string } +interface I_ { x: number } +interface J extends I, I_ { } +interface K extends J { } + +var k: K = { x: \"\", y: \"\" }; // error: x should be number +(k.x: string); // error: x is number +(k.y: string); + +declare class C { x: number } +declare class D extends C, Other { } // error: multiple extends +//declare class E implements I { } // parse error + +interface A { y: Y } +interface A_ { x: X } +interface B extends A, A_ { z: Z } +interface E extends B { } + +var e: E = { x: \"\", y: \"\", z: \"\" }; // error: x and z should be numbers +(e.x: string); // error: x is number +(e.y: string); +(e.z: string); // error: z is number +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +interface I { y: string } +interface I_ { x: number } +interface J extends I, I_ {} +interface K extends J {} + +var k: K = { x: \"\", y: \"\" }; +// error: x should be number +(k.x: string); +// error: x is number +(k.y: string); + +declare class C { x: number } +declare class D extends C, Other {} +// error: multiple extends +//declare class E implements I { } // parse error +interface A { y: Y } +interface A_ { x: X } +interface B extends A, A_ { z: Z } +interface E extends B {} + +var e: E = { x: \"\", y: \"\", z: \"\" }; +// error: x and z should be numbers +(e.x: string); +// error: x is number +(e.y: string); +(e.z: string); // error: z is number +" +`; + +exports[`test test2.js 1`] = ` +"import type { J } from \'./import\'; +interface K { } +interface L extends J, K { y: string } + +function foo(l: L) { l.x; l.y; l.z; } // error: z not found in L + +// interface + multiple inheritance is similar to object type + intersection +type M = { y: string } & J & { z: boolean } + +function bar(m: M) { m.x; m.y; m.z; } // OK +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +import type { J } from \"./import\"; +interface K {} +interface L extends J, K { y: string } + +function foo(l: L) { + l.x; + + l.y; + + l.z; +} + +// error: z not found in L +// interface + multiple inheritance is similar to object type + intersection +type M = { y: string } & J & { z: boolean }; + +function bar(m: M) { + m.x; + m.y; + m.z; +} // OK +" +`; + +exports[`test test3.js 1`] = ` +"interface I { x: number, y : string } +interface J { y : number } +interface K extends I, J { x: string } // error: x is number in I +function foo(k: K) { + (k.x: number); // error: x is string in K + (k.y: number); // error: y is string in I +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +interface I { x: number, y: string } +interface J { y: number } +interface K extends I, J { x: string } +// error: x is number in I +function foo(k: K) { + (k.x: number); + // error: x is string in K + (k.y: number); // error: y is string in I +} +" +`; + +exports[`test test4.js 1`] = ` +"interface I { foo(x: number): void; } +(function foo(x: number) { }: I); // error, property \`foo\` not found function + +declare class C { + bar(i: I): void; + bar(f: (x: number) => void): void; +} + +new C().bar((x: string) => { }); // error, number ~/~> string +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +interface I { foo(x: number): void } +(function foo(x: number) {}: I); + +// error, property \`foo\` not found function +declare class C { bar(i: I): void, bar(f: (x: number) => void): void } + +new C().bar((x: string) => {}); // error, number ~/~> string +" +`; diff --git a/tests/interface/import.js b/tests/flow/interface/import.js similarity index 100% rename from tests/interface/import.js rename to tests/flow/interface/import.js diff --git a/tests/interface/indexer.js b/tests/flow/interface/indexer.js similarity index 100% rename from tests/interface/indexer.js rename to tests/flow/interface/indexer.js diff --git a/tests/interface/interface.js b/tests/flow/interface/interface.js similarity index 80% rename from tests/interface/interface.js rename to tests/flow/interface/interface.js index 9d996e32..40a01e3d 100644 --- a/tests/interface/interface.js +++ b/tests/flow/interface/interface.js @@ -10,7 +10,3 @@ function testInterfaceName(o: I) { (o.name: string); // error, name is static (o.constructor.name: string); // ok } - -declare module X { - declare interface Y { x: number; } -} \ No newline at end of file diff --git a/tests/libconfig/jsfmt.spec.js b/tests/flow/interface/jsfmt.spec.js similarity index 100% rename from tests/libconfig/jsfmt.spec.js rename to tests/flow/interface/jsfmt.spec.js diff --git a/tests/interface/test.js b/tests/flow/interface/test.js similarity index 100% rename from tests/interface/test.js rename to tests/flow/interface/test.js diff --git a/tests/interface/test2.js b/tests/flow/interface/test2.js similarity index 100% rename from tests/interface/test2.js rename to tests/flow/interface/test2.js diff --git a/tests/interface/test3.js b/tests/flow/interface/test3.js similarity index 100% rename from tests/interface/test3.js rename to tests/flow/interface/test3.js diff --git a/tests/interface/test4.js b/tests/flow/interface/test4.js similarity index 100% rename from tests/interface/test4.js rename to tests/flow/interface/test4.js diff --git a/tests/intersection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/intersection/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/intersection/intersection.js b/tests/flow/intersection/intersection.js similarity index 100% rename from tests/intersection/intersection.js rename to tests/flow/intersection/intersection.js diff --git a/tests/libdef_ignored_module/jsfmt.spec.js b/tests/flow/intersection/jsfmt.spec.js similarity index 100% rename from tests/libdef_ignored_module/jsfmt.spec.js rename to tests/flow/intersection/jsfmt.spec.js diff --git a/tests/intersection/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/intersection/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/libdef_ignored_module/lib/jsfmt.spec.js b/tests/flow/intersection/lib/jsfmt.spec.js similarity index 100% rename from tests/libdef_ignored_module/lib/jsfmt.spec.js rename to tests/flow/intersection/lib/jsfmt.spec.js diff --git a/tests/intersection/lib/lib.js b/tests/flow/intersection/lib/lib.js similarity index 100% rename from tests/intersection/lib/lib.js rename to tests/flow/intersection/lib/lib.js diff --git a/tests/intersection/objassign.js b/tests/flow/intersection/objassign.js similarity index 100% rename from tests/intersection/objassign.js rename to tests/flow/intersection/objassign.js diff --git a/tests/intersection/pred.js b/tests/flow/intersection/pred.js similarity index 100% rename from tests/intersection/pred.js rename to tests/flow/intersection/pred.js diff --git a/tests/intersection/test_fun.js b/tests/flow/intersection/test_fun.js similarity index 100% rename from tests/intersection/test_fun.js rename to tests/flow/intersection/test_fun.js diff --git a/tests/intersection/test_obj.js b/tests/flow/intersection/test_obj.js similarity index 100% rename from tests/intersection/test_obj.js rename to tests/flow/intersection/test_obj.js diff --git a/tests/issues-11/__snapshots__/jsfmt.spec.js.snap b/tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/issues-11/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/issues-11/export.js b/tests/flow/issues-11/export.js similarity index 100% rename from tests/issues-11/export.js rename to tests/flow/issues-11/export.js diff --git a/tests/issues-11/import.js b/tests/flow/issues-11/import.js similarity index 100% rename from tests/issues-11/import.js rename to tests/flow/issues-11/import.js diff --git a/tests/liberr/jsfmt.spec.js b/tests/flow/issues-11/jsfmt.spec.js similarity index 100% rename from tests/liberr/jsfmt.spec.js rename to tests/flow/issues-11/jsfmt.spec.js diff --git a/tests/iter/__snapshots__/jsfmt.spec.js.snap b/tests/flow/iter/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/iter/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/iter/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/iter/iter.js b/tests/flow/iter/iter.js similarity index 100% rename from tests/iter/iter.js rename to tests/flow/iter/iter.js diff --git a/tests/liberr/libs/jsfmt.spec.js b/tests/flow/iter/jsfmt.spec.js similarity index 100% rename from tests/liberr/libs/jsfmt.spec.js rename to tests/flow/iter/jsfmt.spec.js diff --git a/tests/iterable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/iterable/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/iterable/array.js b/tests/flow/iterable/array.js similarity index 100% rename from tests/iterable/array.js rename to tests/flow/iterable/array.js diff --git a/tests/iterable/caching_bug.js b/tests/flow/iterable/caching_bug.js similarity index 100% rename from tests/iterable/caching_bug.js rename to tests/flow/iterable/caching_bug.js diff --git a/tests/iterable/iter.js b/tests/flow/iterable/iter.js similarity index 100% rename from tests/iterable/iter.js rename to tests/flow/iterable/iter.js diff --git a/tests/iterable/iterator_result.js b/tests/flow/iterable/iterator_result.js similarity index 100% rename from tests/iterable/iterator_result.js rename to tests/flow/iterable/iterator_result.js diff --git a/tests/libflow-typed/flow-typed/jsfmt.spec.js b/tests/flow/iterable/jsfmt.spec.js similarity index 100% rename from tests/libflow-typed/flow-typed/jsfmt.spec.js rename to tests/flow/iterable/jsfmt.spec.js diff --git a/tests/iterable/map.js b/tests/flow/iterable/map.js similarity index 100% rename from tests/iterable/map.js rename to tests/flow/iterable/map.js diff --git a/tests/iterable/set.js b/tests/flow/iterable/set.js similarity index 100% rename from tests/iterable/set.js rename to tests/flow/iterable/set.js diff --git a/tests/iterable/string.js b/tests/flow/iterable/string.js similarity index 100% rename from tests/iterable/string.js rename to tests/flow/iterable/string.js diff --git a/tests/iterable/variance.js b/tests/flow/iterable/variance.js similarity index 100% rename from tests/iterable/variance.js rename to tests/flow/iterable/variance.js diff --git a/tests/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/libflow-typed/jsfmt.spec.js b/tests/flow/jsx_intrinsics.builtin/jsfmt.spec.js similarity index 100% rename from tests/libflow-typed/jsfmt.spec.js rename to tests/flow/jsx_intrinsics.builtin/jsfmt.spec.js diff --git a/tests/jsx_intrinsics.builtin/main.js b/tests/flow/jsx_intrinsics.builtin/main.js similarity index 100% rename from tests/jsx_intrinsics.builtin/main.js rename to tests/flow/jsx_intrinsics.builtin/main.js diff --git a/tests/jsx_intrinsics.builtin/strings.js b/tests/flow/jsx_intrinsics.builtin/strings.js similarity index 100% rename from tests/jsx_intrinsics.builtin/strings.js rename to tests/flow/jsx_intrinsics.builtin/strings.js diff --git a/tests/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/librec/jsfmt.spec.js b/tests/flow/jsx_intrinsics.custom/jsfmt.spec.js similarity index 100% rename from tests/librec/jsfmt.spec.js rename to tests/flow/jsx_intrinsics.custom/jsfmt.spec.js diff --git a/tests/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/librec/lib/A/jsfmt.spec.js b/tests/flow/jsx_intrinsics.custom/lib/jsfmt.spec.js similarity index 100% rename from tests/librec/lib/A/jsfmt.spec.js rename to tests/flow/jsx_intrinsics.custom/lib/jsfmt.spec.js diff --git a/tests/jsx_intrinsics.custom/lib/jsx.js b/tests/flow/jsx_intrinsics.custom/lib/jsx.js similarity index 100% rename from tests/jsx_intrinsics.custom/lib/jsx.js rename to tests/flow/jsx_intrinsics.custom/lib/jsx.js diff --git a/tests/jsx_intrinsics.custom/main.js b/tests/flow/jsx_intrinsics.custom/main.js similarity index 100% rename from tests/jsx_intrinsics.custom/main.js rename to tests/flow/jsx_intrinsics.custom/main.js diff --git a/tests/jsx_intrinsics.custom/strings.js b/tests/flow/jsx_intrinsics.custom/strings.js similarity index 100% rename from tests/jsx_intrinsics.custom/strings.js rename to tests/flow/jsx_intrinsics.custom/strings.js diff --git a/tests/keys/__snapshots__/jsfmt.spec.js.snap b/tests/flow/keys/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/keys/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/keys/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/librec/lib/B/jsfmt.spec.js b/tests/flow/keys/jsfmt.spec.js similarity index 100% rename from tests/librec/lib/B/jsfmt.spec.js rename to tests/flow/keys/jsfmt.spec.js diff --git a/tests/keys/keys.js b/tests/flow/keys/keys.js similarity index 100% rename from tests/keys/keys.js rename to tests/flow/keys/keys.js diff --git a/tests/keyvalue/__snapshots__/jsfmt.spec.js.snap b/tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/keyvalue/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/line-endings/jsfmt.spec.js b/tests/flow/keyvalue/jsfmt.spec.js similarity index 100% rename from tests/line-endings/jsfmt.spec.js rename to tests/flow/keyvalue/jsfmt.spec.js diff --git a/tests/keyvalue/keyvalue.js b/tests/flow/keyvalue/keyvalue.js similarity index 100% rename from tests/keyvalue/keyvalue.js rename to tests/flow/keyvalue/keyvalue.js diff --git a/tests/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap b/tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/locals/jsfmt.spec.js b/tests/flow/last_duplicate_property_wins/jsfmt.spec.js similarity index 100% rename from tests/locals/jsfmt.spec.js rename to tests/flow/last_duplicate_property_wins/jsfmt.spec.js diff --git a/tests/last_duplicate_property_wins/test.js b/tests/flow/last_duplicate_property_wins/test.js similarity index 100% rename from tests/last_duplicate_property_wins/test.js rename to tests/flow/last_duplicate_property_wins/test.js diff --git a/tests/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/logical/jsfmt.spec.js b/tests/flow/lib/jsfmt.spec.js similarity index 100% rename from tests/logical/jsfmt.spec.js rename to tests/flow/lib/jsfmt.spec.js diff --git a/tests/lib/libtest.js b/tests/flow/lib/libtest.js similarity index 100% rename from tests/lib/libtest.js rename to tests/flow/lib/libtest.js diff --git a/tests/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap b/tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/loners/jsfmt.spec.js b/tests/flow/lib_interfaces/declarations/jsfmt.spec.js similarity index 100% rename from tests/loners/jsfmt.spec.js rename to tests/flow/lib_interfaces/declarations/jsfmt.spec.js diff --git a/tests/lib_interfaces/declarations/underscore.js b/tests/flow/lib_interfaces/declarations/underscore.js similarity index 100% rename from tests/lib_interfaces/declarations/underscore.js rename to tests/flow/lib_interfaces/declarations/underscore.js diff --git a/tests/libconfig/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/libconfig/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/method_properties/jsfmt.spec.js b/tests/flow/libconfig/jsfmt.spec.js similarity index 100% rename from tests/method_properties/jsfmt.spec.js rename to tests/flow/libconfig/jsfmt.spec.js diff --git a/tests/libconfig/libA.js b/tests/flow/libconfig/libA.js similarity index 100% rename from tests/libconfig/libA.js rename to tests/flow/libconfig/libA.js diff --git a/tests/libconfig/libB.js b/tests/flow/libconfig/libB.js similarity index 100% rename from tests/libconfig/libB.js rename to tests/flow/libconfig/libB.js diff --git a/tests/libconfig/libtest.js b/tests/flow/libconfig/libtest.js similarity index 100% rename from tests/libconfig/libtest.js rename to tests/flow/libconfig/libtest.js diff --git a/tests/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/misc/jsfmt.spec.js b/tests/flow/libdef_ignored_module/jsfmt.spec.js similarity index 100% rename from tests/misc/jsfmt.spec.js rename to tests/flow/libdef_ignored_module/jsfmt.spec.js diff --git a/tests/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/libdef_ignored_module/lib/foo.js b/tests/flow/libdef_ignored_module/lib/foo.js similarity index 100% rename from tests/libdef_ignored_module/lib/foo.js rename to tests/flow/libdef_ignored_module/lib/foo.js diff --git a/tests/missing_annotation/jsfmt.spec.js b/tests/flow/libdef_ignored_module/lib/jsfmt.spec.js similarity index 100% rename from tests/missing_annotation/jsfmt.spec.js rename to tests/flow/libdef_ignored_module/lib/jsfmt.spec.js diff --git a/tests/libdef_ignored_module/test.js b/tests/flow/libdef_ignored_module/test.js similarity index 100% rename from tests/libdef_ignored_module/test.js rename to tests/flow/libdef_ignored_module/test.js diff --git a/tests/liberr/__snapshots__/jsfmt.spec.js.snap b/tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/liberr/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/liberr/a.js b/tests/flow/liberr/a.js similarity index 100% rename from tests/liberr/a.js rename to tests/flow/liberr/a.js diff --git a/tests/modified_lib/jsfmt.spec.js b/tests/flow/liberr/jsfmt.spec.js similarity index 100% rename from tests/modified_lib/jsfmt.spec.js rename to tests/flow/liberr/jsfmt.spec.js diff --git a/tests/liberr/libs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/liberr/libs/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/modified_lib/lib/jsfmt.spec.js b/tests/flow/liberr/libs/jsfmt.spec.js similarity index 100% rename from tests/modified_lib/lib/jsfmt.spec.js rename to tests/flow/liberr/libs/jsfmt.spec.js diff --git a/tests/liberr/libs/type_error.js b/tests/flow/liberr/libs/type_error.js similarity index 100% rename from tests/liberr/libs/type_error.js rename to tests/flow/liberr/libs/type_error.js diff --git a/tests/libflow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/libflow-typed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/libflow-typed/flow-typed/dino.js b/tests/flow/libflow-typed/flow-typed/dino.js similarity index 100% rename from tests/libflow-typed/flow-typed/dino.js rename to tests/flow/libflow-typed/flow-typed/dino.js diff --git a/tests/module_not_found_errors/src/jsfmt.spec.js b/tests/flow/libflow-typed/flow-typed/jsfmt.spec.js similarity index 100% rename from tests/module_not_found_errors/src/jsfmt.spec.js rename to tests/flow/libflow-typed/flow-typed/jsfmt.spec.js diff --git a/tests/module_redirect/jsfmt.spec.js b/tests/flow/libflow-typed/jsfmt.spec.js similarity index 100% rename from tests/module_redirect/jsfmt.spec.js rename to tests/flow/libflow-typed/jsfmt.spec.js diff --git a/tests/libflow-typed/libtest.js b/tests/flow/libflow-typed/libtest.js similarity index 100% rename from tests/libflow-typed/libtest.js rename to tests/flow/libflow-typed/libtest.js diff --git a/tests/librec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/librec/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/librec/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/module_use_strict/jsfmt.spec.js b/tests/flow/librec/jsfmt.spec.js similarity index 100% rename from tests/module_use_strict/jsfmt.spec.js rename to tests/flow/librec/jsfmt.spec.js diff --git a/tests/librec/lib/A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/librec/lib/A/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/modules/jsfmt.spec.js b/tests/flow/librec/lib/A/jsfmt.spec.js similarity index 100% rename from tests/modules/jsfmt.spec.js rename to tests/flow/librec/lib/A/jsfmt.spec.js diff --git a/tests/librec/lib/A/libA.js b/tests/flow/librec/lib/A/libA.js similarity index 100% rename from tests/librec/lib/A/libA.js rename to tests/flow/librec/lib/A/libA.js diff --git a/tests/librec/lib/B/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/librec/lib/B/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_annot/jsfmt.spec.js b/tests/flow/librec/lib/B/jsfmt.spec.js similarity index 100% rename from tests/more_annot/jsfmt.spec.js rename to tests/flow/librec/lib/B/jsfmt.spec.js diff --git a/tests/librec/lib/B/libB.js b/tests/flow/librec/lib/B/libB.js similarity index 100% rename from tests/librec/lib/B/libB.js rename to tests/flow/librec/lib/B/libB.js diff --git a/tests/librec/libtest.js b/tests/flow/librec/libtest.js similarity index 100% rename from tests/librec/libtest.js rename to tests/flow/librec/libtest.js diff --git a/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..36b1b7ee --- /dev/null +++ b/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,116 @@ +exports[`test enum.js 1`] = ` +"var APIKeys = { + AGE: \'age\', + NAME: \'name\', +}; + +module.exports = APIKeys; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var APIKeys = { AGE: \"age\", NAME: \"name\" }; + +module.exports = APIKeys; +" +`; + +exports[`test enum_client.js 1`] = ` +"var APIKeys = require(\'./enum\'); +// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" + +function foo(x: $Keys) { } +foo(\"AGE\"); +foo(\"LOCATION\"); // error + +function bar(x: $Keys<{age: number}>) { } +bar(APIKeys.AGE); // not an error: APIKeys.AGE = \"age\" +bar(APIKeys.NAME); // error: since \"NAME\" is not in the smaller enum + +var object = {}; +object[APIKeys.AGE] = 123; // i.e., object.age = 123 +object[APIKeys.NAME] = \"FOO\"; // i.e., object.name = \"FOO\" + +var age:number = object[APIKeys.AGE]; +var name:number = object[APIKeys.NAME]; // error: object.name is a string + +var indices = { red: 0, green: 1, blue: 2 }; +var tuple = [42, \"hello\", false]; +var red:string = tuple[indices.red]; // error: tuple[0] is a number +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var APIKeys = require(\"./enum\"); +// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" +function foo(x: $Keys) {} +foo(\"AGE\"); +foo(\"LOCATION\"); + +// error +function bar(x: $Keys<{ age: number }>) {} +bar(APIKeys.AGE); +// not an error: APIKeys.AGE = \"age\" +bar(APIKeys.NAME); + +// error: since \"NAME\" is not in the smaller enum +var object = {}; +object[APIKeys.AGE] = 123; +// i.e., object.age = 123 +object[APIKeys.NAME] = \"FOO\"; + +// i.e., object.name = \"FOO\" +var age: number = object[APIKeys.AGE]; +var name: number = object[APIKeys.NAME]; + +// error: object.name is a string +var indices = { red: 0, green: 1, blue: 2 }; +var tuple = [42, \"hello\", false]; +var red: string = tuple[indices.red]; // error: tuple[0] is a number +" +`; + +exports[`test number.js 1`] = ` +"function test1(x: number): number { + return -x; +} + +function test2(x: string): number { + return -x; +} + +// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s +// because of the UnaryMinusT\'s, causing nontermination +function test3(x: number, flip_times: number): number { + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} +function test4(flip_times: number): number { + var x = 1; + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function test1(x: number): number { + return -x; +} + +function test2(x: string): number { + return -x; +} + +// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s +// because of the UnaryMinusT\'s, causing nontermination +function test3(x: number, flip_times: number): number { + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} +function test4(flip_times: number): number { + var x = 1; + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} +" +`; diff --git a/tests/literal/enum.js b/tests/flow/literal/enum.js similarity index 100% rename from tests/literal/enum.js rename to tests/flow/literal/enum.js diff --git a/tests/literal/enum_client.js b/tests/flow/literal/enum_client.js similarity index 100% rename from tests/literal/enum_client.js rename to tests/flow/literal/enum_client.js diff --git a/tests/more_classes/jsfmt.spec.js b/tests/flow/literal/jsfmt.spec.js similarity index 100% rename from tests/more_classes/jsfmt.spec.js rename to tests/flow/literal/jsfmt.spec.js diff --git a/tests/flow/literal/number.js b/tests/flow/literal/number.js new file mode 100644 index 00000000..1ec52991 --- /dev/null +++ b/tests/flow/literal/number.js @@ -0,0 +1,23 @@ +function test1(x: number): number { + return -x; +} + +function test2(x: string): number { + return -x; +} + +// sanity checks to make sure merging envs doesn't keep creating new NumT's +// because of the UnaryMinusT's, causing nontermination +function test3(x: number, flip_times: number): number { + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} +function test4(flip_times: number): number { + var x = 1; + for (var i = 0; i < flip_times; i++) { + x = -x; + } + return x; +} diff --git a/tests/locals/__snapshots__/jsfmt.spec.js.snap b/tests/flow/locals/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/locals/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/locals/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_generics/jsfmt.spec.js b/tests/flow/locals/jsfmt.spec.js similarity index 100% rename from tests/more_generics/jsfmt.spec.js rename to tests/flow/locals/jsfmt.spec.js diff --git a/tests/locals/lex.js b/tests/flow/locals/lex.js similarity index 100% rename from tests/locals/lex.js rename to tests/flow/locals/lex.js diff --git a/tests/locals/locals.js b/tests/flow/locals/locals.js similarity index 100% rename from tests/locals/locals.js rename to tests/flow/locals/locals.js diff --git a/tests/logical/__snapshots__/jsfmt.spec.js.snap b/tests/flow/logical/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/logical/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/logical/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_path/jsfmt.spec.js b/tests/flow/logical/jsfmt.spec.js similarity index 100% rename from tests/more_path/jsfmt.spec.js rename to tests/flow/logical/jsfmt.spec.js diff --git a/tests/logical/logical.js b/tests/flow/logical/logical.js similarity index 100% rename from tests/logical/logical.js rename to tests/flow/logical/logical.js diff --git a/tests/loners/__snapshots__/jsfmt.spec.js.snap b/tests/flow/loners/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/loners/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/loners/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_react/jsfmt.spec.js b/tests/flow/loners/jsfmt.spec.js similarity index 100% rename from tests/more_react/jsfmt.spec.js rename to tests/flow/loners/jsfmt.spec.js diff --git a/tests/loners/loners.js b/tests/flow/loners/loners.js similarity index 100% rename from tests/loners/loners.js rename to tests/flow/loners/loners.js diff --git a/tests/method_properties/__snapshots__/jsfmt.spec.js.snap b/tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/method_properties/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/method_properties/exports_optional_prop.js b/tests/flow/method_properties/exports_optional_prop.js similarity index 100% rename from tests/method_properties/exports_optional_prop.js rename to tests/flow/method_properties/exports_optional_prop.js diff --git a/tests/more_statics/jsfmt.spec.js b/tests/flow/method_properties/jsfmt.spec.js similarity index 100% rename from tests/more_statics/jsfmt.spec.js rename to tests/flow/method_properties/jsfmt.spec.js diff --git a/tests/method_properties/test.js b/tests/flow/method_properties/test.js similarity index 100% rename from tests/method_properties/test.js rename to tests/flow/method_properties/test.js diff --git a/tests/misc/A.js b/tests/flow/misc/A.js similarity index 100% rename from tests/misc/A.js rename to tests/flow/misc/A.js diff --git a/tests/misc/B.js b/tests/flow/misc/B.js similarity index 100% rename from tests/misc/B.js rename to tests/flow/misc/B.js diff --git a/tests/misc/C.js b/tests/flow/misc/C.js similarity index 100% rename from tests/misc/C.js rename to tests/flow/misc/C.js diff --git a/tests/misc/D.js b/tests/flow/misc/D.js similarity index 100% rename from tests/misc/D.js rename to tests/flow/misc/D.js diff --git a/tests/misc/E.js b/tests/flow/misc/E.js similarity index 100% rename from tests/misc/E.js rename to tests/flow/misc/E.js diff --git a/tests/misc/F.js b/tests/flow/misc/F.js similarity index 100% rename from tests/misc/F.js rename to tests/flow/misc/F.js diff --git a/tests/misc/G.js b/tests/flow/misc/G.js similarity index 100% rename from tests/misc/G.js rename to tests/flow/misc/G.js diff --git a/tests/misc/__snapshots__/jsfmt.spec.js.snap b/tests/flow/misc/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/misc/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/misc/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/name_prop/jsfmt.spec.js b/tests/flow/misc/jsfmt.spec.js similarity index 100% rename from tests/name_prop/jsfmt.spec.js rename to tests/flow/misc/jsfmt.spec.js diff --git a/tests/missing_annotation/__snapshots__/jsfmt.spec.js.snap b/tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/missing_annotation/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/missing_annotation/array.js b/tests/flow/missing_annotation/array.js similarity index 100% rename from tests/missing_annotation/array.js rename to tests/flow/missing_annotation/array.js diff --git a/tests/missing_annotation/async_return.js b/tests/flow/missing_annotation/async_return.js similarity index 100% rename from tests/missing_annotation/async_return.js rename to tests/flow/missing_annotation/async_return.js diff --git a/tests/missing_annotation/infer.js b/tests/flow/missing_annotation/infer.js similarity index 100% rename from tests/missing_annotation/infer.js rename to tests/flow/missing_annotation/infer.js diff --git a/tests/namespace/jsfmt.spec.js b/tests/flow/missing_annotation/jsfmt.spec.js similarity index 100% rename from tests/namespace/jsfmt.spec.js rename to tests/flow/missing_annotation/jsfmt.spec.js diff --git a/tests/modified_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/modified_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/new_react/fakelib/jsfmt.spec.js b/tests/flow/modified_lib/jsfmt.spec.js similarity index 100% rename from tests/new_react/fakelib/jsfmt.spec.js rename to tests/flow/modified_lib/jsfmt.spec.js diff --git a/tests/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/new_react/jsfmt.spec.js b/tests/flow/modified_lib/lib/jsfmt.spec.js similarity index 100% rename from tests/new_react/jsfmt.spec.js rename to tests/flow/modified_lib/lib/jsfmt.spec.js diff --git a/tests/modified_lib/lib/lib.js b/tests/flow/modified_lib/lib/lib.js similarity index 100% rename from tests/modified_lib/lib/lib.js rename to tests/flow/modified_lib/lib/lib.js diff --git a/tests/modified_lib/test.js b/tests/flow/modified_lib/test.js similarity index 100% rename from tests/modified_lib/test.js rename to tests/flow/modified_lib/test.js diff --git a/tests/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/module_not_found_errors/src/index.js b/tests/flow/module_not_found_errors/src/index.js similarity index 100% rename from tests/module_not_found_errors/src/index.js rename to tests/flow/module_not_found_errors/src/index.js diff --git a/tests/node_haste/external/_d3/jsfmt.spec.js b/tests/flow/module_not_found_errors/src/jsfmt.spec.js similarity index 100% rename from tests/node_haste/external/_d3/jsfmt.spec.js rename to tests/flow/module_not_found_errors/src/jsfmt.spec.js diff --git a/tests/module_redirect/A.js b/tests/flow/module_redirect/A.js similarity index 100% rename from tests/module_redirect/A.js rename to tests/flow/module_redirect/A.js diff --git a/tests/module_redirect/B.js b/tests/flow/module_redirect/B.js similarity index 100% rename from tests/module_redirect/B.js rename to tests/flow/module_redirect/B.js diff --git a/tests/module_redirect/C.js b/tests/flow/module_redirect/C.js similarity index 100% rename from tests/module_redirect/C.js rename to tests/flow/module_redirect/C.js diff --git a/tests/module_redirect/D.js b/tests/flow/module_redirect/D.js similarity index 100% rename from tests/module_redirect/D.js rename to tests/flow/module_redirect/D.js diff --git a/tests/module_redirect/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/module_redirect/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/foo/bar/jsfmt.spec.js b/tests/flow/module_redirect/jsfmt.spec.js similarity index 100% rename from tests/node_haste/foo/bar/jsfmt.spec.js rename to tests/flow/module_redirect/jsfmt.spec.js diff --git a/tests/module_use_strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/module_use_strict/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/jsfmt.spec.js b/tests/flow/module_use_strict/jsfmt.spec.js similarity index 100% rename from tests/node_haste/jsfmt.spec.js rename to tests/flow/module_use_strict/jsfmt.spec.js diff --git a/tests/module_use_strict/test.js b/tests/flow/module_use_strict/test.js similarity index 100% rename from tests/module_use_strict/test.js rename to tests/flow/module_use_strict/test.js diff --git a/tests/modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modules/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/modules/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/modules/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/modules/cli.js b/tests/flow/modules/cli.js similarity index 100% rename from tests/modules/cli.js rename to tests/flow/modules/cli.js diff --git a/tests/modules/cli2.js b/tests/flow/modules/cli2.js similarity index 100% rename from tests/modules/cli2.js rename to tests/flow/modules/cli2.js diff --git a/tests/node_haste/ws/jsfmt.spec.js b/tests/flow/modules/jsfmt.spec.js similarity index 100% rename from tests/node_haste/ws/jsfmt.spec.js rename to tests/flow/modules/jsfmt.spec.js diff --git a/tests/modules/lib.js b/tests/flow/modules/lib.js similarity index 100% rename from tests/modules/lib.js rename to tests/flow/modules/lib.js diff --git a/tests/more_annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/more_annot/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_annot/client_object.js b/tests/flow/more_annot/client_object.js similarity index 100% rename from tests/more_annot/client_object.js rename to tests/flow/more_annot/client_object.js diff --git a/tests/node_haste/ws/test/jsfmt.spec.js b/tests/flow/more_annot/jsfmt.spec.js similarity index 100% rename from tests/node_haste/ws/test/jsfmt.spec.js rename to tests/flow/more_annot/jsfmt.spec.js diff --git a/tests/more_annot/object.js b/tests/flow/more_annot/object.js similarity index 100% rename from tests/more_annot/object.js rename to tests/flow/more_annot/object.js diff --git a/tests/more_annot/proto.js b/tests/flow/more_annot/proto.js similarity index 100% rename from tests/more_annot/proto.js rename to tests/flow/more_annot/proto.js diff --git a/tests/more_annot/super.js b/tests/flow/more_annot/super.js similarity index 100% rename from tests/more_annot/super.js rename to tests/flow/more_annot/super.js diff --git a/tests/more_classes/Bar.js b/tests/flow/more_classes/Bar.js similarity index 100% rename from tests/more_classes/Bar.js rename to tests/flow/more_classes/Bar.js diff --git a/tests/more_classes/Foo.js b/tests/flow/more_classes/Foo.js similarity index 100% rename from tests/more_classes/Foo.js rename to tests/flow/more_classes/Foo.js diff --git a/tests/more_classes/Qux.js b/tests/flow/more_classes/Qux.js similarity index 100% rename from tests/more_classes/Qux.js rename to tests/flow/more_classes/Qux.js diff --git a/tests/more_classes/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/more_classes/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/root/jsfmt.spec.js b/tests/flow/more_classes/jsfmt.spec.js similarity index 100% rename from tests/node_modules_with_symlinks/root/jsfmt.spec.js rename to tests/flow/more_classes/jsfmt.spec.js diff --git a/tests/more_generics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/more_generics/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/root/symlink_lib/jsfmt.spec.js b/tests/flow/more_generics/jsfmt.spec.js similarity index 100% rename from tests/node_modules_with_symlinks/root/symlink_lib/jsfmt.spec.js rename to tests/flow/more_generics/jsfmt.spec.js diff --git a/tests/more_generics/poly.js b/tests/flow/more_generics/poly.js similarity index 100% rename from tests/more_generics/poly.js rename to tests/flow/more_generics/poly.js diff --git a/tests/more_path/Condition.js b/tests/flow/more_path/Condition.js similarity index 100% rename from tests/more_path/Condition.js rename to tests/flow/more_path/Condition.js diff --git a/tests/more_path/FlowSA.js b/tests/flow/more_path/FlowSA.js similarity index 100% rename from tests/more_path/FlowSA.js rename to tests/flow/more_path/FlowSA.js diff --git a/tests/more_path/Sigma.js b/tests/flow/more_path/Sigma.js similarity index 100% rename from tests/more_path/Sigma.js rename to tests/flow/more_path/Sigma.js diff --git a/tests/more_path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/more_path/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/symlink_lib_outside_root/jsfmt.spec.js b/tests/flow/more_path/jsfmt.spec.js similarity index 100% rename from tests/node_modules_with_symlinks/symlink_lib_outside_root/jsfmt.spec.js rename to tests/flow/more_path/jsfmt.spec.js diff --git a/tests/more_path/test.js b/tests/flow/more_path/test.js similarity index 100% rename from tests/more_path/test.js rename to tests/flow/more_path/test.js diff --git a/tests/more_react/API.react.js b/tests/flow/more_react/API.react.js similarity index 100% rename from tests/more_react/API.react.js rename to tests/flow/more_react/API.react.js diff --git a/tests/more_react/App.react.js b/tests/flow/more_react/App.react.js similarity index 100% rename from tests/more_react/App.react.js rename to tests/flow/more_react/App.react.js diff --git a/tests/more_react/JSX.js b/tests/flow/more_react/JSX.js similarity index 100% rename from tests/more_react/JSX.js rename to tests/flow/more_react/JSX.js diff --git a/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..3cdb3aa8 --- /dev/null +++ b/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,176 @@ +exports[`test API.react.js 1`] = ` +" +var app = require(\'JSX\'); + +app.setProps({y:42}); // error, y:number but foo expects string in App.react +app.setState({z:42}); // error, z:number but foo expects string in App.react + +function bar(x:number) { } +bar(app.props.children); // No error, App doesn\'t specify propTypes so anything goes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var app = require(\"JSX\"); + +app.setProps({ y: 42 }); +// error, y:number but foo expects string in App.react +app.setState({ z: 42 }); + +// error, z:number but foo expects string in App.react +function bar(x: number) {} +bar( + app.props.children +); // No error, App doesn\'t specify propTypes so anything goes +" +`; + +exports[`test App.react.js 1`] = ` +" +/** + * @providesModule App.react + * @jsx React.DOM + */ + +var React = require(\'react\'); + +// expect args to be strings +function foo(p:string,q:string):string { return p+q; } + +var App = React.createClass({ + + getDefaultProps: function(): { y: string } { + return {y:\"\"}; // infer props.y: string + }, + + getInitialState: function() { + return {z:0}; // infer state.z: number + }, + + handler: function() { + this.setState({z:42}); // ok + }, + + render: function() { + var x = this.props.x; + var y = this.props.y; + var z = this.state.z; + + //this.state; + + return ( +
+ {foo(x,y)} + {foo(z,x)} // error, since z: number +
+ ); + } + +}); + +module.exports = App; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @providesModule App.react + * @jsx React.DOM + */ + +var React = require(\"react\"); + +// expect args to be strings +function foo(p: string, q: string): string { + return p + q; +} + +var App = React.createClass({ + getDefaultProps: function(): { y: string } { + return { y: \"\" }; // infer props.y: string + }, + getInitialState: function() { + return { z: 0 }; // infer state.z: number + }, + handler: function() { + this.setState({ z: 42 }); // ok + }, + render: function() { + var x = this.props.x; + var y = this.props.y; + var z = this.state.z; + + //this.state; + return ( +
+ {foo(x, y)} + {foo(z, x)} // error, since z: number +
+ ); + } +}); + +module.exports = App; +" +`; + +exports[`test JSX.js 1`] = ` +" +/* @providesModule JSX */ + +var React = require(\'react\'); +var App = require(\'App.react\'); + +var app = + // error, y: number but foo expects string in App.react + Some text. + ; + +module.exports = app; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @providesModule JSX */ + +var React = require(\"react\"); +var App = require(\"App.react\"); + +var app = ( + + // error, y: number but foo expects string in App.react + Some text. + +); + +module.exports = app; +" +`; + +exports[`test propTypes.js 1`] = ` +"var React = require(\'React\'); + +var C = React.createClass({ + propTypes: { + title: React.PropTypes.string.isRequired, + } +}); +var D = React.createClass({ + propTypes: { + name: React.PropTypes.string.isRequired, + ...C.propTypes, + } +}); + +; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +var C = React.createClass({ + propTypes: { title: React.PropTypes.string.isRequired } +}); +var D = React.createClass({ + propTypes: { name: React.PropTypes.string.isRequired, ...C.propTypes } +}); + +; +" +`; diff --git a/tests/node_modules_without_json/jsfmt.spec.js b/tests/flow/more_react/jsfmt.spec.js similarity index 100% rename from tests/node_modules_without_json/jsfmt.spec.js rename to tests/flow/more_react/jsfmt.spec.js diff --git a/tests/more_react/propTypes.js b/tests/flow/more_react/propTypes.js similarity index 100% rename from tests/more_react/propTypes.js rename to tests/flow/more_react/propTypes.js diff --git a/tests/more_statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/more_statics/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/more_statics/class_static.js b/tests/flow/more_statics/class_static.js similarity index 100% rename from tests/more_statics/class_static.js rename to tests/flow/more_statics/class_static.js diff --git a/tests/node_tests/assert/jsfmt.spec.js b/tests/flow/more_statics/jsfmt.spec.js similarity index 100% rename from tests/node_tests/assert/jsfmt.spec.js rename to tests/flow/more_statics/jsfmt.spec.js diff --git a/tests/name_prop/__snapshots__/jsfmt.spec.js.snap b/tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/name_prop/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/name_prop/class.js b/tests/flow/name_prop/class.js similarity index 100% rename from tests/name_prop/class.js rename to tests/flow/name_prop/class.js diff --git a/tests/name_prop/function.js b/tests/flow/name_prop/function.js similarity index 100% rename from tests/name_prop/function.js rename to tests/flow/name_prop/function.js diff --git a/tests/node_tests/basic/jsfmt.spec.js b/tests/flow/name_prop/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic/jsfmt.spec.js rename to tests/flow/name_prop/jsfmt.spec.js diff --git a/tests/namespace/__snapshots__/jsfmt.spec.js.snap b/tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/namespace/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/namespace/client.js b/tests/flow/namespace/client.js similarity index 100% rename from tests/namespace/client.js rename to tests/flow/namespace/client.js diff --git a/tests/node_tests/basic_file/jsfmt.spec.js b/tests/flow/namespace/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic_file/jsfmt.spec.js rename to tests/flow/namespace/jsfmt.spec.js diff --git a/tests/namespace/namespace.js b/tests/flow/namespace/namespace.js similarity index 100% rename from tests/namespace/namespace.js rename to tests/flow/namespace/namespace.js diff --git a/tests/new_react/FeedUFI.react.js b/tests/flow/new_react/FeedUFI.react.js similarity index 100% rename from tests/new_react/FeedUFI.react.js rename to tests/flow/new_react/FeedUFI.react.js diff --git a/tests/new_react/Mixin.js b/tests/flow/new_react/Mixin.js similarity index 100% rename from tests/new_react/Mixin.js rename to tests/flow/new_react/Mixin.js diff --git a/tests/new_react/UFILikeCount.react.js b/tests/flow/new_react/UFILikeCount.react.js similarity index 100% rename from tests/new_react/UFILikeCount.react.js rename to tests/flow/new_react/UFILikeCount.react.js diff --git a/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..3a3b7a57 --- /dev/null +++ b/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,967 @@ +exports[`test FeedUFI.react.js 1`] = ` +"/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule FeedUFI.react + * @flow + */ + +\'use strict\'; + +var UFILikeCount = require(\'UFILikeCount.react\'); +var React = require(\'react\'); + +var FeedUFI = React.createClass({ + _renderLikeCount: function( + feedback: any + ) { + var props = { + className: \"\", + key: \"\", + feedback: {feedback}, + permalink: \"\", + }; + var ignored = ; + return ( + + ); + }, + + render: function(): ?React.Element { + return ( +
+ ); + } + +}); + +module.exports = FeedUFI; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule FeedUFI.react + * @flow + */ + +\"use strict\"; + +var UFILikeCount = require(\"UFILikeCount.react\"); +var React = require(\"react\"); + +var FeedUFI = React.createClass({ + _renderLikeCount: function(feedback: any) { + var props = { + className: \"\", + key: \"\", + feedback: { feedback }, + permalink: \"\" + }; + var ignored = ; + return ( + + ); + }, + render: function(): ?React.Element { + return
; + } +}); + +module.exports = FeedUFI; +" +`; + +exports[`test Mixin.js 1`] = ` +"/* @providesModule Mixin */ +module.exports = { + success: function() { } +}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @providesModule Mixin */ +module.exports = { success: function() {} }; +" +`; + +exports[`test UFILikeCount.react.js 1`] = ` +"/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule UFILikeCount.react + * @flow + */ + +\'use strict\'; + +var React = require(\'react\'); + +var UFILikeCount = React.createClass({ + propTypes: { + permalink: React.PropTypes.string, + feedback: React.PropTypes.object.isRequired + }, + + render: function(): ?React.Element { + return
; + } +}); + +module.exports = UFILikeCount; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule UFILikeCount.react + * @flow + */ + +\"use strict\"; + +var React = require(\"react\"); + +var UFILikeCount = React.createClass({ + propTypes: { + permalink: React.PropTypes.string, + feedback: React.PropTypes.object.isRequired + }, + render: function(): ?React.Element { + return
; + } +}); + +module.exports = UFILikeCount; +" +`; + +exports[`test bad_default_props.js 1`] = ` +"var React = require(\'React\'); + +type T1 = { } +type T2 = { x: number } +type T3 = { x: number, y: number } + +class C1 extends React.Component { // error +} + +class C2 extends React.Component { // OK +} + +// no need to add type arguments to React.Component +class C3 extends React.Component { // OK + static defaultProps: T1; + props: T2; +} + +class C4 extends React.Component { // OK, recommended + // no need to declare defaultProps unless necessary + props: T2; +} + +class C5 extends React.Component { // error +} + +class C6 extends React.Component { // OK, recommended + static defaultProps: T2; + props: T3; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +type T1 = {}; +type T2 = { x: number }; +type T3 = { x: number, y: number }; + +class C1 extends React.Component {} + +class C2 extends React.Component {} + +// no need to add type arguments to React.Component +class C3 extends React.Component { + // OK + static defaultProps: T1; + props: T2; +} + +class C4 extends React.Component { + // OK, recommended + // no need to declare defaultProps unless necessary + props: T2; +} + +class C5 extends React.Component {} + +class C6 extends React.Component { + // OK, recommended + static defaultProps: T2; + props: T3; +} +" +`; + +exports[`test classes.js 1`] = ` +"var React = require(\'React\'); + +type DefaultProps = { }; +type Props = { x: number }; +type State = { y: number }; + +class Foo extends React.Component { + props: Props; + state: State; + static defaultProps: DefaultProps; + + is_mounted: boolean; + + static bar(): void {} + + qux(): void { + var _: string = this.props.x; + } + + constructor(props) { + super(props); + this.state = { y: \"\" }; + } + + setState(o: { y_: string }): void { } + + componentDidMount(): void { + this.is_mounted = true; + } + + componentWillReceiveProps( + nextProps: Object, + nextContext: any + ): void { + this.qux(); + } + +} + +Foo.defaultProps = 0; +var foo: $jsx = ; + +Foo.bar(); + +var FooLegacy = React.createClass({ + is_mounted: (undefined: ?boolean), + + propTypes: { + x: React.PropTypes.number.isRequired + }, + + getDefaultProps(): DefaultProps { return {} }, + + statics: { + bar(): void {} + }, + + qux(): void { + var _: string = this.props.x; + }, + + getInitialState(): { y: string } { + return { y: \"\" }; + }, + + setState(o: { y_: string }): void { }, + + componentDidMount(): void { + this.is_mounted = true; + }, + + componentWillReceiveProps( + nextProps: Object, + nextContext: any + ): void { + this.qux(); + }, +}); + +FooLegacy.defaultProps = 0; // TODO: should be error +var foo_legacy: $jsx = ; + +FooLegacy.bar(); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +type DefaultProps = {}; +type Props = { x: number }; +type State = { y: number }; + +class Foo extends React.Component { + props: Props; + state: State; + static defaultProps: DefaultProps; + + is_mounted: boolean; + + static bar(): void {} + + qux(): void { + var _: string = this.props.x; + } + + constructor(props) { + super(props); + this.state = { y: \"\" }; + } + + setState(o: { y_: string }): void {} + + componentDidMount(): void { + this.is_mounted = true; + } + + componentWillReceiveProps(nextProps: Object, nextContext: any): void { + this.qux(); + } +} + +Foo.defaultProps = 0; +var foo: $jsx = ; + +Foo.bar(); + +var FooLegacy = React.createClass({ + is_mounted: (undefined: ?boolean), + propTypes: { x: React.PropTypes.number.isRequired }, + getDefaultProps(): DefaultProps { + return {}; + }, + statics: { bar(): void {} }, + qux(): void { + var _: string = this.props.x; + }, + getInitialState(): { y: string } { + return { y: \"\" }; + }, + setState(o: { y_: string }): void {}, + componentDidMount(): void { + this.is_mounted = true; + }, + componentWillReceiveProps(nextProps: Object, nextContext: any): void { + this.qux(); + } +}); + +FooLegacy.defaultProps = 0; +// TODO: should be error +var foo_legacy: $jsx = ; + +FooLegacy.bar(); +" +`; + +exports[`test import-react.js 1`] = ` +"/* @flow */ + +// Testing local binding of React in all kinds of ways. The only reason this +// might even be an issue is that internally, the use of JSX triggers an +// implicit require(\'react\'), so any bugs in (1) interop of CJS require and ES6 +// import (2) module re-export, as used to redirect the module name \'React\' to +// \'react\' might show up here. + +import React from \"react\"; +//import React from \"React\"; +//var React = require(\"react\"); +//var React = require(\"React\"); + +class HelloMessage extends React.Component { + props: { name: string }; +} + +; // number ~/~> string error +; // ok +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +// Testing local binding of React in all kinds of ways. The only reason this +// might even be an issue is that internally, the use of JSX triggers an +// implicit require(\'react\'), so any bugs in (1) interop of CJS require and ES6 +// import (2) module re-export, as used to redirect the module name \'React\' to +// \'react\' might show up here. + +import React from \"react\"; +//import React from \"React\"; +//var React = require(\"react\"); +//var React = require(\"React\"); +class HelloMessage extends React.Component { + props: { name: string }; +} + +; +/* number ~/~> string error*/ +; // ok +" +`; + +exports[`test new_react.js 1`] = ` +"var React = require(\'react\'); +var Mixin = require(\'Mixin\'); +var C = React.createClass({ + mixins: [Mixin], + propTypes: { + x: React.PropTypes.string.isRequired, + y: React.PropTypes.array, + z: React.PropTypes.number + }, + replaceProps(props: { }) { }, + + getDefaultProps(): { z: number } { + return { z: 0 }; + }, + getInitialState() { return 4; }, + render() { + var foo: string = this.state; + var bar: string = this.props; + var qux: string = this.props.z; + var w:number = this.props.x; + this.props.y[0]; + var len:number = this.props.x.length; + this.success(); + return
; + } + +}) + +var element = ; +var element_ = ; + +var x: number = C.displayName; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var Mixin = require(\"Mixin\"); +var C = React.createClass({ + mixins: [Mixin], + propTypes: { + x: React.PropTypes.string.isRequired, + y: React.PropTypes.array, + z: React.PropTypes.number + }, + replaceProps(props: {}) {}, + getDefaultProps(): { z: number } { + return { z: 0 }; + }, + getInitialState() { + return 4; + }, + render() { + var foo: string = this.state; + var bar: string = this.props; + var qux: string = this.props.z; + var w: number = this.props.x; + this.props.y[0]; + var len: number = this.props.x.length; + this.success(); + return
; + } +}); + +var element = ; +var element_ = ; + +var x: number = C.displayName; +" +`; + +exports[`test propTypes.js 1`] = ` +"var React = require(\'react\'); +var PropTypes = React.PropTypes; + +var C = React.createClass({ + propTypes: { + statistics: PropTypes.arrayOf(PropTypes.shape({ + label: PropTypes.string.isRequired, + value: PropTypes.number, + })).isRequired, + } +}); + +; // error (label is required, value not required) + +var props: Array<{label: string, value?: number}> = [ + {}, + {label:\"\",value:undefined}, +]; // error (same as ^) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var PropTypes = React.PropTypes; + +var C = React.createClass({ + propTypes: { + statistics: PropTypes.arrayOf( + PropTypes.shape({ + label: PropTypes.string.isRequired, + value: PropTypes.number + }) + ).isRequired + } +}); + +; + +// error (label is required, value not required) +var props: Array<{ label: string, value?: number }> = [ + {}, + { label: \"\", value: undefined } +]; // error (same as ^) +" +`; + +exports[`test props.js 1`] = ` +"var React = require(\'react\'); +var TestProps = React.createClass({ + + propTypes: { + x: React.PropTypes.string, + z: React.PropTypes.number + }, + + getDefaultProps: function() { + return {x: \'\', y: 0} + }, + + test: function() { + var a: number = this.props.x; // error + var b: string = this.props.y; // error + var c: string = this.props.z; // error + } +}); + +var element = ; // 3 errors + +(element: $jsx<*>); +(element: $jsx); +var FooProps = React.createClass({ + propTypes: { w: React.PropTypes.string.isRequired } +}); +(element: $jsx); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var TestProps = React.createClass({ + propTypes: { x: React.PropTypes.string, z: React.PropTypes.number }, + getDefaultProps: function() { + return { x: \"\", y: 0 }; + }, + test: function() { + var a: number = this.props.x; + // error + var b: string = this.props.y; + // error + var c: string = this.props.z; // error + } +}); + +var element = ; + +// 3 errors +(element: $jsx<*>); +(element: $jsx); +var FooProps = React.createClass({ + propTypes: { w: React.PropTypes.string.isRequired } +}); +(element: $jsx); +" +`; + +exports[`test props2.js 1`] = ` +"var React = require(\'react\'); +var C = React.createClass({ + propTypes: { + foo: React.PropTypes.string.isRequired, + bar: React.PropTypes.string.isRequired, + } +}); +var D = React.createClass({ + getInitialState: function(): { bar: number } { + return { bar: 0 }; + }, + render: function() { + var obj = { bar: 0 }; + var s: string = this.state.bar; + return ; + } +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var C = React.createClass({ + propTypes: { + foo: React.PropTypes.string.isRequired, + bar: React.PropTypes.string.isRequired + } +}); +var D = React.createClass({ + getInitialState: function(): { bar: number } { + return { bar: 0 }; + }, + render: function() { + var obj = { bar: 0 }; + var s: string = this.state.bar; + return ; + } +}); +" +`; + +exports[`test props3.js 1`] = ` +"var React = require(\'react\'); +var TestProps = React.createClass({ + // Do something illegal inside of propTypes and make sure Flow notices + propTypes: { + arr: React.PropTypes.array, + arr_rec: React.PropTypes.array.isRequired, + bool: React.PropTypes.bool, + bool_rec: React.PropTypes.bool.isRequired, + func: React.PropTypes.func, + func_rec: React.PropTypes.func.isRequired, + number: React.PropTypes.number, + number_rec: React.PropTypes.number.isRequired, + object: React.PropTypes.object, + object_rec: React.PropTypes.object.isRequired, + string: React.PropTypes.string, + string_rec: React.PropTypes.string.isRequired, + + any: React.PropTypes.any, + any_rec: React.PropTypes.any.isRequired, + element: React.PropTypes.element, + element_rec: React.PropTypes.element.isRequired, + node: React.PropTypes.node, + node_rec: React.PropTypes.node.isRequired, + + arrayOf: React.PropTypes.arrayOf(React.PropTypes.string), + arrayOf_rec: React.PropTypes.arrayOf(React.PropTypes.string).isRequired, + instanceOf: React.PropTypes.instanceOf(Object), + instanceOf_rec: React.PropTypes.instanceOf(Object).isRequired, + objectOf: React.PropTypes.objectOf(React.PropTypes.string), + objectOf_rec: React.PropTypes.objectOf(React.PropTypes.string).isRequired, + oneOf: React.PropTypes.oneOf([\"yes\", \"no\"]), + oneOf_rec: React.PropTypes.oneOf([\"yes\", \"no\"]).isRequired, + oneOfType: React.PropTypes.oneOfType( + [React.PropTypes.string, React.PropTypes.number] + ), + oneOfType_rec: React.PropTypes.oneOfType( + [React.PropTypes.string, React.PropTypes.number] + ).isRequired, + shape: React.PropTypes.shape({ + foo: React.PropTypes.string, + bar: React.PropTypes.number, + }), + shape_rec: React.PropTypes.shape({ + foo: React.PropTypes.string, + bar: React.PropTypes.number, + }).isRequired, + + // And do something bad here + bad_one: React.PropTypes.imaginaryType, + bad_two: React.PropTypes.string.inRequired, + }, +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var TestProps = React.createClass({ + // Do something illegal inside of propTypes and make sure Flow notices + propTypes: { + arr: React.PropTypes.array, + arr_rec: React.PropTypes.array.isRequired, + bool: React.PropTypes.bool, + bool_rec: React.PropTypes.bool.isRequired, + func: React.PropTypes.func, + func_rec: React.PropTypes.func.isRequired, + number: React.PropTypes.number, + number_rec: React.PropTypes.number.isRequired, + object: React.PropTypes.object, + object_rec: React.PropTypes.object.isRequired, + string: React.PropTypes.string, + string_rec: React.PropTypes.string.isRequired, + any: React.PropTypes.any, + any_rec: React.PropTypes.any.isRequired, + element: React.PropTypes.element, + element_rec: React.PropTypes.element.isRequired, + node: React.PropTypes.node, + node_rec: React.PropTypes.node.isRequired, + arrayOf: React.PropTypes.arrayOf(React.PropTypes.string), + arrayOf_rec: React.PropTypes.arrayOf(React.PropTypes.string).isRequired, + instanceOf: React.PropTypes.instanceOf(Object), + instanceOf_rec: React.PropTypes.instanceOf(Object).isRequired, + objectOf: React.PropTypes.objectOf(React.PropTypes.string), + objectOf_rec: React.PropTypes.objectOf(React.PropTypes.string).isRequired, + oneOf: React.PropTypes.oneOf([\"yes\", \"no\"]), + oneOf_rec: React.PropTypes.oneOf([\"yes\", \"no\"]).isRequired, + oneOfType: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number + ]), + oneOfType_rec: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number + ]).isRequired, + shape: React.PropTypes.shape({ + foo: React.PropTypes.string, + bar: React.PropTypes.number + }), + shape_rec: React.PropTypes.shape({ + foo: React.PropTypes.string, + bar: React.PropTypes.number + }).isRequired, + // And do something bad here + bad_one: React.PropTypes.imaginaryType, + bad_two: React.PropTypes.string.inRequired + } +}); +" +`; + +exports[`test props4.js 1`] = ` +"// @flow + +import React from \"React\"; + +class JDiv extends React.Component { + // static defaultProps: { }; + props: { + id: string + }; +} + +// Should be a type error (\'id\' takes a string, not a number..) +; + +class Example extends React.Component { + props: { bar: string }; + + render() { + return
{this.props.bar}
+ } +} + +React.render( + , + document.body +); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +import React from \"React\"; + +class JDiv extends React.Component { + // static defaultProps: { }; + props: { id: string }; +} + +/* Should be a type error (\'id\' takes a string, not a number..)*/ +; + +class Example extends React.Component { + props: { bar: string }; + + render() { + return
{this.props.bar}
; + } +} + +React.render(, document.body); +" +`; + +exports[`test props5.js 1`] = ` +"var React = require(\'React\'); + +var C = React.createClass({ + getDefaultProps: function() { + return { x: 0 }; + } +}); + +module.exports = C; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +var C = React.createClass({ + getDefaultProps: function() { + return { x: 0 }; + } +}); + +module.exports = C; +" +`; + +exports[`test state.js 1`] = ` +"/* @flow */ + +var React = require(\'react\'); + +type State = { + bar: ?{ qux: string; }; +}; + +var ReactClass = React.createClass({ + getInitialState: function():State { + return { bar: null }; + }, + + render: function(): any { + // Any state access here seems to make state any + this.state; + return ( +
+ {this.state.bar.qux} +
+ ); + } +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +var React = require(\"react\"); + +type State = { bar: ?{ qux: string } }; + +var ReactClass = React.createClass({ + getInitialState: function(): State { + return { bar: null }; + }, + render: function(): any { + // Any state access here seems to make state any + this.state; + return ( +
+ {this.state.bar.qux} +
+ ); + } +}); +" +`; + +exports[`test state2.js 1`] = ` +"// @flow + +var React = require(\'react\'); + +type FooState = { + key: ?Object; +}; + +var Comp = React.createClass({ + getInitialState: function(): FooState { + return { + key: null, // this used to cause a missing annotation error + }; + } +}); + +module.exports = Comp; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +var React = require(\"react\"); + +type FooState = { key: ?Object }; + +var Comp = React.createClass({ + getInitialState: function(): FooState { + return { + // this used to cause a missing annotation error + key: null + }; + } +}); + +module.exports = Comp; +" +`; + +exports[`test state3.js 1`] = ` +"var React = require(\'react\'); +var TestState = React.createClass({ + + getInitialState: function(): { x: string; } { + return { + x: \'\' + } + }, + + test: function() { + var a: number = this.state.x; // error + + this.setState({ + x: false // error + }) + } + +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"react\"); +var TestState = React.createClass({ + getInitialState: function(): { x: string } { + return { x: \"\" }; + }, + test: function() { + var a: number = this.state.x; + + // error + this.setState({ + // error + x: false + }); + } +}); +" +`; + +exports[`test state4.js 1`] = ` +"var React = require(\'React\'); + +var C = React.createClass({ + getInitialState: function() { + return { x: 0 }; + }, + + render() { + this.setState({ y: 0 }); + return
{this.state.z}
+ } + +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +var C = React.createClass({ + getInitialState: function() { + return { x: 0 }; + }, + render() { + this.setState({ y: 0 }); + return
{this.state.z}
; + } +}); +" +`; + +exports[`test state5.js 1`] = ` +"var React = require(\'React\'); + +class C extends React.Component { + foo(): number { + return this.state.x; // error: need to declare type of state + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +var React = require(\"React\"); + +class C extends React.Component { + foo(): number { + return this.state.x; // error: need to declare type of state + } +} +" +`; diff --git a/tests/new_react/bad_default_props.js b/tests/flow/new_react/bad_default_props.js similarity index 100% rename from tests/new_react/bad_default_props.js rename to tests/flow/new_react/bad_default_props.js diff --git a/tests/new_react/classes.js b/tests/flow/new_react/classes.js similarity index 100% rename from tests/new_react/classes.js rename to tests/flow/new_react/classes.js diff --git a/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..afd9ad15 --- /dev/null +++ b/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,17 @@ +exports[`test type_aliases.js 1`] = ` +"declare var $React: $Exports<\'react\'>; // fake import +// Strawman: revised definition of $jsx (alternatively, React.Element). +// Using bounded poly to specify a constraint on a type parameter, and +// existentials to elide type arguments. +type _ReactElement, C: $React.Component> = $React.Element; +type $jsx = _ReactElement<*, *, *, C>; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +declare var $React: $Exports<\"react\">; +// fake import +// Strawman: revised definition of $jsx (alternatively, React.Element). +// Using bounded poly to specify a constraint on a type parameter, and +// existentials to elide type arguments. +type _ReactElement, C: $React.Component> = $React.Element; +type $jsx = _ReactElement<*, *, *, C>; +" +`; diff --git a/tests/node_tests/basic_node_modules/jsfmt.spec.js b/tests/flow/new_react/fakelib/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic_node_modules/jsfmt.spec.js rename to tests/flow/new_react/fakelib/jsfmt.spec.js diff --git a/tests/new_react/fakelib/type_aliases.js b/tests/flow/new_react/fakelib/type_aliases.js similarity index 100% rename from tests/new_react/fakelib/type_aliases.js rename to tests/flow/new_react/fakelib/type_aliases.js diff --git a/tests/new_react/import-react.js b/tests/flow/new_react/import-react.js similarity index 100% rename from tests/new_react/import-react.js rename to tests/flow/new_react/import-react.js diff --git a/tests/node_tests/basic_node_modules_with_path/jsfmt.spec.js b/tests/flow/new_react/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic_node_modules_with_path/jsfmt.spec.js rename to tests/flow/new_react/jsfmt.spec.js diff --git a/tests/new_react/new_react.js b/tests/flow/new_react/new_react.js similarity index 100% rename from tests/new_react/new_react.js rename to tests/flow/new_react/new_react.js diff --git a/tests/new_react/propTypes.js b/tests/flow/new_react/propTypes.js similarity index 100% rename from tests/new_react/propTypes.js rename to tests/flow/new_react/propTypes.js diff --git a/tests/new_react/props.js b/tests/flow/new_react/props.js similarity index 100% rename from tests/new_react/props.js rename to tests/flow/new_react/props.js diff --git a/tests/new_react/props2.js b/tests/flow/new_react/props2.js similarity index 100% rename from tests/new_react/props2.js rename to tests/flow/new_react/props2.js diff --git a/tests/new_react/props3.js b/tests/flow/new_react/props3.js similarity index 100% rename from tests/new_react/props3.js rename to tests/flow/new_react/props3.js diff --git a/tests/new_react/props4.js b/tests/flow/new_react/props4.js similarity index 100% rename from tests/new_react/props4.js rename to tests/flow/new_react/props4.js diff --git a/tests/new_react/props5.js b/tests/flow/new_react/props5.js similarity index 100% rename from tests/new_react/props5.js rename to tests/flow/new_react/props5.js diff --git a/tests/new_react/state.js b/tests/flow/new_react/state.js similarity index 100% rename from tests/new_react/state.js rename to tests/flow/new_react/state.js diff --git a/tests/new_react/state2.js b/tests/flow/new_react/state2.js similarity index 100% rename from tests/new_react/state2.js rename to tests/flow/new_react/state2.js diff --git a/tests/new_react/state3.js b/tests/flow/new_react/state3.js similarity index 100% rename from tests/new_react/state3.js rename to tests/flow/new_react/state3.js diff --git a/tests/new_react/state4.js b/tests/flow/new_react/state4.js similarity index 100% rename from tests/new_react/state4.js rename to tests/flow/new_react/state4.js diff --git a/tests/new_react/state5.js b/tests/flow/new_react/state5.js similarity index 100% rename from tests/new_react/state5.js rename to tests/flow/new_react/state5.js diff --git a/tests/node_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/client.js b/tests/flow/node_haste/client.js similarity index 100% rename from tests/node_haste/client.js rename to tests/flow/node_haste/client.js diff --git a/tests/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_package/bar_lib/jsfmt.spec.js b/tests/flow/node_haste/external/_d3/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic_package/bar_lib/jsfmt.spec.js rename to tests/flow/node_haste/external/_d3/jsfmt.spec.js diff --git a/tests/node_haste/external/_d3/min.js b/tests/flow/node_haste/external/_d3/min.js similarity index 100% rename from tests/node_haste/external/_d3/min.js rename to tests/flow/node_haste/external/_d3/min.js diff --git a/tests/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/foo/bar/client.js b/tests/flow/node_haste/foo/bar/client.js similarity index 100% rename from tests/node_haste/foo/bar/client.js rename to tests/flow/node_haste/foo/bar/client.js diff --git a/tests/node_tests/basic_package/jsfmt.spec.js b/tests/flow/node_haste/foo/bar/jsfmt.spec.js similarity index 100% rename from tests/node_tests/basic_package/jsfmt.spec.js rename to tests/flow/node_haste/foo/bar/jsfmt.spec.js diff --git a/tests/node_tests/buffer/jsfmt.spec.js b/tests/flow/node_haste/jsfmt.spec.js similarity index 100% rename from tests/node_tests/buffer/jsfmt.spec.js rename to tests/flow/node_haste/jsfmt.spec.js diff --git a/tests/node_haste/md5.js b/tests/flow/node_haste/md5.js similarity index 100% rename from tests/node_haste/md5.js rename to tests/flow/node_haste/md5.js diff --git a/tests/node_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_haste/ws/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/ws/index.js b/tests/flow/node_haste/ws/index.js similarity index 100% rename from tests/node_haste/ws/index.js rename to tests/flow/node_haste/ws/index.js diff --git a/tests/node_tests/child_process/jsfmt.spec.js b/tests/flow/node_haste/ws/jsfmt.spec.js similarity index 100% rename from tests/node_tests/child_process/jsfmt.spec.js rename to tests/flow/node_haste/ws/jsfmt.spec.js diff --git a/tests/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_haste/ws/test/client.js b/tests/flow/node_haste/ws/test/client.js similarity index 100% rename from tests/node_haste/ws/test/client.js rename to tests/flow/node_haste/ws/test/client.js diff --git a/tests/node_tests/crypto/jsfmt.spec.js b/tests/flow/node_haste/ws/test/jsfmt.spec.js similarity index 100% rename from tests/node_tests/crypto/jsfmt.spec.js rename to tests/flow/node_haste/ws/test/jsfmt.spec.js diff --git a/tests/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/root/foo.js b/tests/flow/node_modules_with_symlinks/root/foo.js similarity index 100% rename from tests/node_modules_with_symlinks/root/foo.js rename to tests/flow/node_modules_with_symlinks/root/foo.js diff --git a/tests/node_tests/fs/jsfmt.spec.js b/tests/flow/node_modules_with_symlinks/root/jsfmt.spec.js similarity index 100% rename from tests/node_tests/fs/jsfmt.spec.js rename to tests/flow/node_modules_with_symlinks/root/jsfmt.spec.js diff --git a/tests/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/root/symlink_lib/index.js b/tests/flow/node_modules_with_symlinks/root/symlink_lib/index.js similarity index 100% rename from tests/node_modules_with_symlinks/root/symlink_lib/index.js rename to tests/flow/node_modules_with_symlinks/root/symlink_lib/index.js diff --git a/tests/node_tests/json_file/jsfmt.spec.js b/tests/flow/node_modules_with_symlinks/root/symlink_lib/jsfmt.spec.js similarity index 100% rename from tests/node_tests/json_file/jsfmt.spec.js rename to tests/flow/node_modules_with_symlinks/root/symlink_lib/jsfmt.spec.js diff --git a/tests/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_modules_with_symlinks/symlink_lib_outside_root/index.js b/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/index.js similarity index 100% rename from tests/node_modules_with_symlinks/symlink_lib_outside_root/index.js rename to tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/index.js diff --git a/tests/node_tests/json_file/package2/jsfmt.spec.js b/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/jsfmt.spec.js similarity index 100% rename from tests/node_tests/json_file/package2/jsfmt.spec.js rename to tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/jsfmt.spec.js diff --git a/tests/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/os/jsfmt.spec.js b/tests/flow/node_modules_without_json/jsfmt.spec.js similarity index 100% rename from tests/node_tests/os/jsfmt.spec.js rename to tests/flow/node_modules_without_json/jsfmt.spec.js diff --git a/tests/node_modules_without_json/test.js b/tests/flow/node_modules_without_json/test.js similarity index 100% rename from tests/node_modules_without_json/test.js rename to tests/flow/node_modules_without_json/test.js diff --git a/tests/node_tests/assert/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/assert/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/assert/assert.js b/tests/flow/node_tests/assert/assert.js similarity index 100% rename from tests/node_tests/assert/assert.js rename to tests/flow/node_tests/assert/assert.js diff --git a/tests/node_tests/package_file/bar_lib/jsfmt.spec.js b/tests/flow/node_tests/assert/jsfmt.spec.js similarity index 100% rename from tests/node_tests/package_file/bar_lib/jsfmt.spec.js rename to tests/flow/node_tests/assert/jsfmt.spec.js diff --git a/tests/node_tests/basic/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic/bar.js b/tests/flow/node_tests/basic/bar.js similarity index 100% rename from tests/node_tests/basic/bar.js rename to tests/flow/node_tests/basic/bar.js diff --git a/tests/node_tests/basic/foo.js b/tests/flow/node_tests/basic/foo.js similarity index 100% rename from tests/node_tests/basic/foo.js rename to tests/flow/node_tests/basic/foo.js diff --git a/tests/node_tests/package_file/jsfmt.spec.js b/tests/flow/node_tests/basic/jsfmt.spec.js similarity index 100% rename from tests/node_tests/package_file/jsfmt.spec.js rename to tests/flow/node_tests/basic/jsfmt.spec.js diff --git a/tests/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_file/bar.js b/tests/flow/node_tests/basic_file/bar.js similarity index 100% rename from tests/node_tests/basic_file/bar.js rename to tests/flow/node_tests/basic_file/bar.js diff --git a/tests/node_tests/basic_file/foo.js b/tests/flow/node_tests/basic_file/foo.js similarity index 100% rename from tests/node_tests/basic_file/foo.js rename to tests/flow/node_tests/basic_file/foo.js diff --git a/tests/node_tests/package_file_node_modules/foo/jsfmt.spec.js b/tests/flow/node_tests/basic_file/jsfmt.spec.js similarity index 100% rename from tests/node_tests/package_file_node_modules/foo/jsfmt.spec.js rename to tests/flow/node_tests/basic_file/jsfmt.spec.js diff --git a/tests/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_node_modules/foo.js b/tests/flow/node_tests/basic_node_modules/foo.js similarity index 100% rename from tests/node_tests/basic_node_modules/foo.js rename to tests/flow/node_tests/basic_node_modules/foo.js diff --git a/tests/node_tests/path_node_modules/jsfmt.spec.js b/tests/flow/node_tests/basic_node_modules/jsfmt.spec.js similarity index 100% rename from tests/node_tests/path_node_modules/jsfmt.spec.js rename to tests/flow/node_tests/basic_node_modules/jsfmt.spec.js diff --git a/tests/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_node_modules_with_path/foo.js b/tests/flow/node_tests/basic_node_modules_with_path/foo.js similarity index 100% rename from tests/node_tests/basic_node_modules_with_path/foo.js rename to tests/flow/node_tests/basic_node_modules_with_path/foo.js diff --git a/tests/node_tests/path_node_modules_with_short_main/jsfmt.spec.js b/tests/flow/node_tests/basic_node_modules_with_path/jsfmt.spec.js similarity index 100% rename from tests/node_tests/path_node_modules_with_short_main/jsfmt.spec.js rename to tests/flow/node_tests/basic_node_modules_with_path/jsfmt.spec.js diff --git a/tests/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/basic_package/bar_lib/bar.js b/tests/flow/node_tests/basic_package/bar_lib/bar.js similarity index 100% rename from tests/node_tests/basic_package/bar_lib/bar.js rename to tests/flow/node_tests/basic_package/bar_lib/bar.js diff --git a/tests/node_tests/path_node_modules_without_main/jsfmt.spec.js b/tests/flow/node_tests/basic_package/bar_lib/jsfmt.spec.js similarity index 100% rename from tests/node_tests/path_node_modules_without_main/jsfmt.spec.js rename to tests/flow/node_tests/basic_package/bar_lib/jsfmt.spec.js diff --git a/tests/node_tests/basic_package/foo.js b/tests/flow/node_tests/basic_package/foo.js similarity index 100% rename from tests/node_tests/basic_package/foo.js rename to tests/flow/node_tests/basic_package/foo.js diff --git a/tests/node_tests/path_package/jsfmt.spec.js b/tests/flow/node_tests/basic_package/jsfmt.spec.js similarity index 100% rename from tests/node_tests/path_package/jsfmt.spec.js rename to tests/flow/node_tests/basic_package/jsfmt.spec.js diff --git a/tests/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/buffer/buffer.js b/tests/flow/node_tests/buffer/buffer.js similarity index 100% rename from tests/node_tests/buffer/buffer.js rename to tests/flow/node_tests/buffer/buffer.js diff --git a/tests/node_tests/stream/jsfmt.spec.js b/tests/flow/node_tests/buffer/jsfmt.spec.js similarity index 100% rename from tests/node_tests/stream/jsfmt.spec.js rename to tests/flow/node_tests/buffer/jsfmt.spec.js diff --git a/tests/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/child_process/exec.js b/tests/flow/node_tests/child_process/exec.js similarity index 100% rename from tests/node_tests/child_process/exec.js rename to tests/flow/node_tests/child_process/exec.js diff --git a/tests/node_tests/child_process/execFile.js b/tests/flow/node_tests/child_process/execFile.js similarity index 100% rename from tests/node_tests/child_process/execFile.js rename to tests/flow/node_tests/child_process/execFile.js diff --git a/tests/node_tests/child_process/execSync.js b/tests/flow/node_tests/child_process/execSync.js similarity index 100% rename from tests/node_tests/child_process/execSync.js rename to tests/flow/node_tests/child_process/execSync.js diff --git a/tests/node_tests/timers/jsfmt.spec.js b/tests/flow/node_tests/child_process/jsfmt.spec.js similarity index 100% rename from tests/node_tests/timers/jsfmt.spec.js rename to tests/flow/node_tests/child_process/jsfmt.spec.js diff --git a/tests/node_tests/child_process/spawn.js b/tests/flow/node_tests/child_process/spawn.js similarity index 100% rename from tests/node_tests/child_process/spawn.js rename to tests/flow/node_tests/child_process/spawn.js diff --git a/tests/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/crypto/crypto.js b/tests/flow/node_tests/crypto/crypto.js similarity index 100% rename from tests/node_tests/crypto/crypto.js rename to tests/flow/node_tests/crypto/crypto.js diff --git a/tests/node_tests/url/jsfmt.spec.js b/tests/flow/node_tests/crypto/jsfmt.spec.js similarity index 100% rename from tests/node_tests/url/jsfmt.spec.js rename to tests/flow/node_tests/crypto/jsfmt.spec.js diff --git a/tests/node_tests/fs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/fs/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/fs/fs.js b/tests/flow/node_tests/fs/fs.js similarity index 100% rename from tests/node_tests/fs/fs.js rename to tests/flow/node_tests/fs/fs.js diff --git a/tests/nullable/jsfmt.spec.js b/tests/flow/node_tests/fs/jsfmt.spec.js similarity index 100% rename from tests/nullable/jsfmt.spec.js rename to tests/flow/node_tests/fs/jsfmt.spec.js diff --git a/tests/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/number_constants/jsfmt.spec.js b/tests/flow/node_tests/json_file/jsfmt.spec.js similarity index 100% rename from tests/number_constants/jsfmt.spec.js rename to tests/flow/node_tests/json_file/jsfmt.spec.js diff --git a/tests/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/json_file/package2/index.js b/tests/flow/node_tests/json_file/package2/index.js similarity index 100% rename from tests/node_tests/json_file/package2/index.js rename to tests/flow/node_tests/json_file/package2/index.js diff --git a/tests/object-method/jsfmt.spec.js b/tests/flow/node_tests/json_file/package2/jsfmt.spec.js similarity index 100% rename from tests/object-method/jsfmt.spec.js rename to tests/flow/node_tests/json_file/package2/jsfmt.spec.js diff --git a/tests/node_tests/json_file/test.js b/tests/flow/node_tests/json_file/test.js similarity index 100% rename from tests/node_tests/json_file/test.js rename to tests/flow/node_tests/json_file/test.js diff --git a/tests/node_tests/os/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/os/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/object_annot/jsfmt.spec.js b/tests/flow/node_tests/os/jsfmt.spec.js similarity index 100% rename from tests/object_annot/jsfmt.spec.js rename to tests/flow/node_tests/os/jsfmt.spec.js diff --git a/tests/node_tests/os/userInfo.js b/tests/flow/node_tests/os/userInfo.js similarity index 100% rename from tests/node_tests/os/userInfo.js rename to tests/flow/node_tests/os/userInfo.js diff --git a/tests/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/package_file/bar_lib.js b/tests/flow/node_tests/package_file/bar_lib.js similarity index 100% rename from tests/node_tests/package_file/bar_lib.js rename to tests/flow/node_tests/package_file/bar_lib.js diff --git a/tests/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/package_file/bar_lib/bar.js b/tests/flow/node_tests/package_file/bar_lib/bar.js similarity index 100% rename from tests/node_tests/package_file/bar_lib/bar.js rename to tests/flow/node_tests/package_file/bar_lib/bar.js diff --git a/tests/object_api/jsfmt.spec.js b/tests/flow/node_tests/package_file/bar_lib/jsfmt.spec.js similarity index 100% rename from tests/object_api/jsfmt.spec.js rename to tests/flow/node_tests/package_file/bar_lib/jsfmt.spec.js diff --git a/tests/node_tests/package_file/foo.js b/tests/flow/node_tests/package_file/foo.js similarity index 100% rename from tests/node_tests/package_file/foo.js rename to tests/flow/node_tests/package_file/foo.js diff --git a/tests/object_assign/jsfmt.spec.js b/tests/flow/node_tests/package_file/jsfmt.spec.js similarity index 100% rename from tests/object_assign/jsfmt.spec.js rename to tests/flow/node_tests/package_file/jsfmt.spec.js diff --git a/tests/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/package_file_node_modules/foo/foo.js b/tests/flow/node_tests/package_file_node_modules/foo/foo.js similarity index 100% rename from tests/node_tests/package_file_node_modules/foo/foo.js rename to tests/flow/node_tests/package_file_node_modules/foo/foo.js diff --git a/tests/object_freeze/jsfmt.spec.js b/tests/flow/node_tests/package_file_node_modules/foo/jsfmt.spec.js similarity index 100% rename from tests/object_freeze/jsfmt.spec.js rename to tests/flow/node_tests/package_file_node_modules/foo/jsfmt.spec.js diff --git a/tests/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/path_node_modules/foo.js b/tests/flow/node_tests/path_node_modules/foo.js similarity index 100% rename from tests/node_tests/path_node_modules/foo.js rename to tests/flow/node_tests/path_node_modules/foo.js diff --git a/tests/object_is/jsfmt.spec.js b/tests/flow/node_tests/path_node_modules/jsfmt.spec.js similarity index 100% rename from tests/object_is/jsfmt.spec.js rename to tests/flow/node_tests/path_node_modules/jsfmt.spec.js diff --git a/tests/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/path_node_modules_with_short_main/foo.js b/tests/flow/node_tests/path_node_modules_with_short_main/foo.js similarity index 100% rename from tests/node_tests/path_node_modules_with_short_main/foo.js rename to tests/flow/node_tests/path_node_modules_with_short_main/foo.js diff --git a/tests/objmap/jsfmt.spec.js b/tests/flow/node_tests/path_node_modules_with_short_main/jsfmt.spec.js similarity index 100% rename from tests/objmap/jsfmt.spec.js rename to tests/flow/node_tests/path_node_modules_with_short_main/jsfmt.spec.js diff --git a/tests/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/path_node_modules_without_main/foo.js b/tests/flow/node_tests/path_node_modules_without_main/foo.js similarity index 100% rename from tests/node_tests/path_node_modules_without_main/foo.js rename to tests/flow/node_tests/path_node_modules_without_main/foo.js diff --git a/tests/optional/jsfmt.spec.js b/tests/flow/node_tests/path_node_modules_without_main/jsfmt.spec.js similarity index 100% rename from tests/optional/jsfmt.spec.js rename to tests/flow/node_tests/path_node_modules_without_main/jsfmt.spec.js diff --git a/tests/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/node_tests/path_package/foo.js b/tests/flow/node_tests/path_package/foo.js similarity index 100% rename from tests/node_tests/path_package/foo.js rename to tests/flow/node_tests/path_package/foo.js diff --git a/tests/optional_props/jsfmt.spec.js b/tests/flow/node_tests/path_package/jsfmt.spec.js similarity index 100% rename from tests/optional_props/jsfmt.spec.js rename to tests/flow/node_tests/path_package/jsfmt.spec.js diff --git a/tests/node_tests/stream/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/stream/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/overload/jsfmt.spec.js b/tests/flow/node_tests/stream/jsfmt.spec.js similarity index 100% rename from tests/overload/jsfmt.spec.js rename to tests/flow/node_tests/stream/jsfmt.spec.js diff --git a/tests/node_tests/stream/stream.js b/tests/flow/node_tests/stream/stream.js similarity index 100% rename from tests/node_tests/stream/stream.js rename to tests/flow/node_tests/stream/stream.js diff --git a/tests/node_tests/timers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/timers/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/overload/lib/jsfmt.spec.js b/tests/flow/node_tests/timers/jsfmt.spec.js similarity index 100% rename from tests/overload/lib/jsfmt.spec.js rename to tests/flow/node_tests/timers/jsfmt.spec.js diff --git a/tests/node_tests/timers/timers.js b/tests/flow/node_tests/timers/timers.js similarity index 100% rename from tests/node_tests/timers/timers.js rename to tests/flow/node_tests/timers/timers.js diff --git a/tests/node_tests/url/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/node_tests/url/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/parse/jsfmt.spec.js b/tests/flow/node_tests/url/jsfmt.spec.js similarity index 100% rename from tests/parse/jsfmt.spec.js rename to tests/flow/node_tests/url/jsfmt.spec.js diff --git a/tests/node_tests/url/url.js b/tests/flow/node_tests/url/url.js similarity index 100% rename from tests/node_tests/url/url.js rename to tests/flow/node_tests/url/url.js diff --git a/tests/nullable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/nullable/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/parse_error_haste/jsfmt.spec.js b/tests/flow/nullable/jsfmt.spec.js similarity index 100% rename from tests/parse_error_haste/jsfmt.spec.js rename to tests/flow/nullable/jsfmt.spec.js diff --git a/tests/nullable/maybe.js b/tests/flow/nullable/maybe.js similarity index 100% rename from tests/nullable/maybe.js rename to tests/flow/nullable/maybe.js diff --git a/tests/nullable/nullable.js b/tests/flow/nullable/nullable.js similarity index 100% rename from tests/nullable/nullable.js rename to tests/flow/nullable/nullable.js diff --git a/tests/nullable/simple_nullable.js b/tests/flow/nullable/simple_nullable.js similarity index 100% rename from tests/nullable/simple_nullable.js rename to tests/flow/nullable/simple_nullable.js diff --git a/tests/number_constants/__snapshots__/jsfmt.spec.js.snap b/tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/number_constants/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/parse_error_node/jsfmt.spec.js b/tests/flow/number_constants/jsfmt.spec.js similarity index 100% rename from tests/parse_error_node/jsfmt.spec.js rename to tests/flow/number_constants/jsfmt.spec.js diff --git a/tests/number_constants/number_constants.js b/tests/flow/number_constants/number_constants.js similarity index 100% rename from tests/number_constants/number_constants.js rename to tests/flow/number_constants/number_constants.js diff --git a/tests/object-method/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object-method/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/object-method/id.js b/tests/flow/object-method/id.js similarity index 100% rename from tests/object-method/id.js rename to tests/flow/object-method/id.js diff --git a/tests/path/jsfmt.spec.js b/tests/flow/object-method/jsfmt.spec.js similarity index 100% rename from tests/path/jsfmt.spec.js rename to tests/flow/object-method/jsfmt.spec.js diff --git a/tests/object-method/subtype.js b/tests/flow/object-method/subtype.js similarity index 100% rename from tests/object-method/subtype.js rename to tests/flow/object-method/subtype.js diff --git a/tests/object-method/test.js b/tests/flow/object-method/test.js similarity index 100% rename from tests/object-method/test.js rename to tests/flow/object-method/test.js diff --git a/tests/object-method/test2.js b/tests/flow/object-method/test2.js similarity index 100% rename from tests/object-method/test2.js rename to tests/flow/object-method/test2.js diff --git a/tests/object-method/test3.js b/tests/flow/object-method/test3.js similarity index 100% rename from tests/object-method/test3.js rename to tests/flow/object-method/test3.js diff --git a/tests/object_annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object_annot/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/plsummit/jsfmt.spec.js b/tests/flow/object_annot/jsfmt.spec.js similarity index 100% rename from tests/plsummit/jsfmt.spec.js rename to tests/flow/object_annot/jsfmt.spec.js diff --git a/tests/object_annot/test.js b/tests/flow/object_annot/test.js similarity index 100% rename from tests/object_annot/test.js rename to tests/flow/object_annot/test.js diff --git a/tests/object_api/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object_api/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/object_api/a.js b/tests/flow/object_api/a.js similarity index 100% rename from tests/object_api/a.js rename to tests/flow/object_api/a.js diff --git a/tests/object_api/b.js b/tests/flow/object_api/b.js similarity index 100% rename from tests/object_api/b.js rename to tests/flow/object_api/b.js diff --git a/tests/object_api/c.js b/tests/flow/object_api/c.js similarity index 100% rename from tests/object_api/c.js rename to tests/flow/object_api/c.js diff --git a/tests/poly/jsfmt.spec.js b/tests/flow/object_api/jsfmt.spec.js similarity index 100% rename from tests/poly/jsfmt.spec.js rename to tests/flow/object_api/jsfmt.spec.js diff --git a/tests/object_api/object_assign.js b/tests/flow/object_api/object_assign.js similarity index 100% rename from tests/object_api/object_assign.js rename to tests/flow/object_api/object_assign.js diff --git a/tests/object_api/object_create.js b/tests/flow/object_api/object_create.js similarity index 100% rename from tests/object_api/object_create.js rename to tests/flow/object_api/object_create.js diff --git a/tests/object_api/object_getprototypeof.js b/tests/flow/object_api/object_getprototypeof.js similarity index 100% rename from tests/object_api/object_getprototypeof.js rename to tests/flow/object_api/object_getprototypeof.js diff --git a/tests/object_api/object_keys.js b/tests/flow/object_api/object_keys.js similarity index 100% rename from tests/object_api/object_keys.js rename to tests/flow/object_api/object_keys.js diff --git a/tests/object_api/object_missing.js b/tests/flow/object_api/object_missing.js similarity index 100% rename from tests/object_api/object_missing.js rename to tests/flow/object_api/object_missing.js diff --git a/tests/object_api/object_prototype.js b/tests/flow/object_api/object_prototype.js similarity index 100% rename from tests/object_api/object_prototype.js rename to tests/flow/object_api/object_prototype.js diff --git a/tests/object_assign/A.js b/tests/flow/object_assign/A.js similarity index 100% rename from tests/object_assign/A.js rename to tests/flow/object_assign/A.js diff --git a/tests/object_assign/B.js b/tests/flow/object_assign/B.js similarity index 100% rename from tests/object_assign/B.js rename to tests/flow/object_assign/B.js diff --git a/tests/object_assign/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object_assign/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/object_assign/apply.js b/tests/flow/object_assign/apply.js similarity index 100% rename from tests/object_assign/apply.js rename to tests/flow/object_assign/apply.js diff --git a/tests/poly_class_export/jsfmt.spec.js b/tests/flow/object_assign/jsfmt.spec.js similarity index 100% rename from tests/poly_class_export/jsfmt.spec.js rename to tests/flow/object_assign/jsfmt.spec.js diff --git a/tests/object_assign/non_objects.js b/tests/flow/object_assign/non_objects.js similarity index 100% rename from tests/object_assign/non_objects.js rename to tests/flow/object_assign/non_objects.js diff --git a/tests/object_assign/undefined.js b/tests/flow/object_assign/undefined.js similarity index 100% rename from tests/object_assign/undefined.js rename to tests/flow/object_assign/undefined.js diff --git a/tests/object_freeze/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object_freeze/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/poly_overload/decls/jsfmt.spec.js b/tests/flow/object_freeze/jsfmt.spec.js similarity index 100% rename from tests/poly_overload/decls/jsfmt.spec.js rename to tests/flow/object_freeze/jsfmt.spec.js diff --git a/tests/object_freeze/object_freeze.js b/tests/flow/object_freeze/object_freeze.js similarity index 100% rename from tests/object_freeze/object_freeze.js rename to tests/flow/object_freeze/object_freeze.js diff --git a/tests/object_is/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/object_is/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/predicates-abstract/jsfmt.spec.js b/tests/flow/object_is/jsfmt.spec.js similarity index 100% rename from tests/predicates-abstract/jsfmt.spec.js rename to tests/flow/object_is/jsfmt.spec.js diff --git a/tests/object_is/object_is.js b/tests/flow/object_is/object_is.js similarity index 100% rename from tests/object_is/object_is.js rename to tests/flow/object_is/object_is.js diff --git a/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap b/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..74d07ce1 --- /dev/null +++ b/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,155 @@ +exports[`test conversion.js 1`] = ` +"/* @flow */ + +(Object({foo: \'bar\'}): {foo: string}); +(Object(\"123\"): String); +(Object(123): Number); +(Object(true): Boolean); +(Object(null): {}); +(Object(undefined): {}); +(Object(void(0)): {}); +(Object(undefined): Number); // error + +var x = Object(null); +x.foo = \"bar\"; + +var y = Object(\"123\"); +(y.charAt(0): string); + +var z = Object(123); // error (next line makes this not match any signatures) +(z.charAt(0): string); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +(Object({ foo: \"bar\" }): { foo: string }); +(Object(\"123\"): String); +(Object(123): Number); +(Object(true): Boolean); +(Object(null): {}); +(Object(undefined): {}); +(Object(void 0): {}); +(Object(undefined): Number); + +// error +var x = Object(null); +x.foo = \"bar\"; + +var y = Object(\"123\"); +(y.charAt(0): string); + +var z = Object(123); +// error (next line makes this not match any signatures) +(z.charAt(0): string); +" +`; + +exports[`test objects.js 1`] = ` +"/* @flow */ + +var x : {\'123\': string, bar: string} = {\'123\': \'val\', bar: \'bar\'}; +(x.foo : string); // error, key doesn\'t exist +(x[\'foo\'] : string); // error, key doesn\'t exist +(x[123] : boolean); // TODO: use the number\'s value to error here +(x.bar: boolean); // error, string !~> boolean +(x[\'123\'] : boolean); // error, string !~> boolean +x[\'123\'] = false; // error, boolean !~> string +x[123] = false; // TODO: use the number\'s value to error here +x[\'foo\'+\'bar\'] = \'derp\'; // ok since we can\'t tell +(x[\`foo\`]: string); // error, key doesn\'t exist + +var y : {foo: string} = {foo: \'bar\'}; +y[\'foo\'] = 123; // error, number !~> string +y[\'bar\'] = \'abc\'; // error, property not found + +(y[\'hasOwnProperty\']: string); // error, prototype method is not a string +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +var x: { \"123\": string, bar: string } = { \"123\": \"val\", bar: \"bar\" }; +(x.foo: string); +// error, key doesn\'t exist +(x[\"foo\"]: string); +// error, key doesn\'t exist +(x[123]: boolean); +// TODO: use the number\'s value to error here +(x.bar: boolean); +// error, string !~> boolean +(x[\"123\"]: boolean); +// error, string !~> boolean +x[\"123\"] = false; +// error, boolean !~> string +x[123] = false; +// TODO: use the number\'s value to error here +x[\"foo\" + \"bar\"] = \"derp\"; +// ok since we can\'t tell +(x[\`foo\`]: string); + +// error, key doesn\'t exist +var y: { foo: string } = { foo: \"bar\" }; +y[\"foo\"] = 123; +// error, number !~> string +y[\"bar\"] = \"abc\"; + +// error, property not found +(y[\"hasOwnProperty\"]: string); // error, prototype method is not a string +" +`; + +exports[`test unaliased_assign.js 1`] = ` +"/** + * test handling of unaliased value assignment. + * + * An unaliased object rvalue may be assigned to a supertype lvalue, + * because later widening mutations on the rvalue can\'t break assumptions + * made by other lvalues. + * + * However, upon assignment the rvalue must take on the type of the + * lvalue, to avoid both false positives and false negatives + * (unsoundness), as shown below. + * + * @flow + */ + +var glob: { x: string } = { x: \"hey\" }; + +function assign_then_alias() { + var obj: { x: string | number }; + obj = { x: \"hey\" }; + glob = obj; // error: subsequent assignment might make glob.x a number +} + +function assign_then_widen() { + var obj: { x: string | number }; + obj = { x: \"hey\" }; + obj.x = 10; // ok, by lvalue\'s given type +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * test handling of unaliased value assignment. + * + * An unaliased object rvalue may be assigned to a supertype lvalue, + * because later widening mutations on the rvalue can\'t break assumptions + * made by other lvalues. + * + * However, upon assignment the rvalue must take on the type of the + * lvalue, to avoid both false positives and false negatives + * (unsoundness), as shown below. + * + * @flow + */ + +var glob: { x: string } = { x: \"hey\" }; + +function assign_then_alias() { + var obj: { x: string | number }; + obj = { x: \"hey\" }; + glob = obj; // error: subsequent assignment might make glob.x a number +} + +function assign_then_widen() { + var obj: { x: string | number }; + obj = { x: \"hey\" }; + obj.x = 10; // ok, by lvalue\'s given type +} +" +`; diff --git a/tests/objects/conversion.js b/tests/flow/objects/conversion.js similarity index 100% rename from tests/objects/conversion.js rename to tests/flow/objects/conversion.js diff --git a/tests/predicates-declared/jsfmt.spec.js b/tests/flow/objects/jsfmt.spec.js similarity index 100% rename from tests/predicates-declared/jsfmt.spec.js rename to tests/flow/objects/jsfmt.spec.js diff --git a/tests/objects/objects.js b/tests/flow/objects/objects.js similarity index 100% rename from tests/objects/objects.js rename to tests/flow/objects/objects.js diff --git a/tests/objects/unaliased_assign.js b/tests/flow/objects/unaliased_assign.js similarity index 100% rename from tests/objects/unaliased_assign.js rename to tests/flow/objects/unaliased_assign.js diff --git a/tests/objmap/__snapshots__/jsfmt.spec.js.snap b/tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/objmap/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/predicates-inferred/jsfmt.spec.js b/tests/flow/objmap/jsfmt.spec.js similarity index 100% rename from tests/predicates-inferred/jsfmt.spec.js rename to tests/flow/objmap/jsfmt.spec.js diff --git a/tests/objmap/objmap.js b/tests/flow/objmap/objmap.js similarity index 100% rename from tests/objmap/objmap.js rename to tests/flow/objmap/objmap.js diff --git a/tests/optional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/optional/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/optional/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/optional/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/optional/client_optional.js b/tests/flow/optional/client_optional.js similarity index 100% rename from tests/optional/client_optional.js rename to tests/flow/optional/client_optional.js diff --git a/tests/optional/default.js b/tests/flow/optional/default.js similarity index 100% rename from tests/optional/default.js rename to tests/flow/optional/default.js diff --git a/tests/optional/generic.js b/tests/flow/optional/generic.js similarity index 100% rename from tests/optional/generic.js rename to tests/flow/optional/generic.js diff --git a/tests/predicates-parsing/jsfmt.spec.js b/tests/flow/optional/jsfmt.spec.js similarity index 100% rename from tests/predicates-parsing/jsfmt.spec.js rename to tests/flow/optional/jsfmt.spec.js diff --git a/tests/optional/maybe.js b/tests/flow/optional/maybe.js similarity index 100% rename from tests/optional/maybe.js rename to tests/flow/optional/maybe.js diff --git a/tests/optional/nullable.js b/tests/flow/optional/nullable.js similarity index 100% rename from tests/optional/nullable.js rename to tests/flow/optional/nullable.js diff --git a/tests/optional/optional.js b/tests/flow/optional/optional.js similarity index 100% rename from tests/optional/optional.js rename to tests/flow/optional/optional.js diff --git a/tests/optional/optional_param.js b/tests/flow/optional/optional_param.js similarity index 100% rename from tests/optional/optional_param.js rename to tests/flow/optional/optional_param.js diff --git a/tests/optional/optional_param2.js b/tests/flow/optional/optional_param2.js similarity index 100% rename from tests/optional/optional_param2.js rename to tests/flow/optional/optional_param2.js diff --git a/tests/optional/optional_param3.js b/tests/flow/optional/optional_param3.js similarity index 100% rename from tests/optional/optional_param3.js rename to tests/flow/optional/optional_param3.js diff --git a/tests/optional/optional_param4.js b/tests/flow/optional/optional_param4.js similarity index 100% rename from tests/optional/optional_param4.js rename to tests/flow/optional/optional_param4.js diff --git a/tests/optional/undefined.js b/tests/flow/optional/undefined.js similarity index 100% rename from tests/optional/undefined.js rename to tests/flow/optional/undefined.js diff --git a/tests/optional/undefined2.js b/tests/flow/optional/undefined2.js similarity index 100% rename from tests/optional/undefined2.js rename to tests/flow/optional/undefined2.js diff --git a/tests/optional_props/__snapshots__/jsfmt.spec.js.snap b/tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/optional_props/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/prettier/jsfmt.spec.js b/tests/flow/optional_props/jsfmt.spec.js similarity index 100% rename from tests/prettier/jsfmt.spec.js rename to tests/flow/optional_props/jsfmt.spec.js diff --git a/tests/optional_props/test.js b/tests/flow/optional_props/test.js similarity index 100% rename from tests/optional_props/test.js rename to tests/flow/optional_props/test.js diff --git a/tests/optional_props/test2.js b/tests/flow/optional_props/test2.js similarity index 100% rename from tests/optional_props/test2.js rename to tests/flow/optional_props/test2.js diff --git a/tests/optional_props/test3.js b/tests/flow/optional_props/test3.js similarity index 100% rename from tests/optional_props/test3.js rename to tests/flow/optional_props/test3.js diff --git a/tests/optional_props/test3_failure.js b/tests/flow/optional_props/test3_failure.js similarity index 100% rename from tests/optional_props/test3_failure.js rename to tests/flow/optional_props/test3_failure.js diff --git a/tests/overload/__snapshots__/jsfmt.spec.js.snap b/tests/flow/overload/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/overload/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/overload/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/private/jsfmt.spec.js b/tests/flow/overload/jsfmt.spec.js similarity index 100% rename from tests/private/jsfmt.spec.js rename to tests/flow/overload/jsfmt.spec.js diff --git a/tests/overload/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/overload/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/promises/jsfmt.spec.js b/tests/flow/overload/lib/jsfmt.spec.js similarity index 100% rename from tests/promises/jsfmt.spec.js rename to tests/flow/overload/lib/jsfmt.spec.js diff --git a/tests/overload/lib/lib.js b/tests/flow/overload/lib/lib.js similarity index 100% rename from tests/overload/lib/lib.js rename to tests/flow/overload/lib/lib.js diff --git a/tests/overload/overload.js b/tests/flow/overload/overload.js similarity index 100% rename from tests/overload/overload.js rename to tests/flow/overload/overload.js diff --git a/tests/overload/test.js b/tests/flow/overload/test.js similarity index 100% rename from tests/overload/test.js rename to tests/flow/overload/test.js diff --git a/tests/overload/test2.js b/tests/flow/overload/test2.js similarity index 100% rename from tests/overload/test2.js rename to tests/flow/overload/test2.js diff --git a/tests/overload/test3.js b/tests/flow/overload/test3.js similarity index 100% rename from tests/overload/test3.js rename to tests/flow/overload/test3.js diff --git a/tests/overload/union.js b/tests/flow/overload/union.js similarity index 100% rename from tests/overload/union.js rename to tests/flow/overload/union.js diff --git a/tests/parse/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/parse/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/parse/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/pure_component/jsfmt.spec.js b/tests/flow/parse/jsfmt.spec.js similarity index 100% rename from tests/pure_component/jsfmt.spec.js rename to tests/flow/parse/jsfmt.spec.js diff --git a/tests/parse/no_parse_error.js b/tests/flow/parse/no_parse_error.js similarity index 100% rename from tests/parse/no_parse_error.js rename to tests/flow/parse/no_parse_error.js diff --git a/tests/parse_error_haste/Client.js b/tests/flow/parse_error_haste/Client.js similarity index 100% rename from tests/parse_error_haste/Client.js rename to tests/flow/parse_error_haste/Client.js diff --git a/tests/parse_error_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/parse_error_haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/qualified/jsfmt.spec.js b/tests/flow/parse_error_haste/jsfmt.spec.js similarity index 100% rename from tests/qualified/jsfmt.spec.js rename to tests/flow/parse_error_haste/jsfmt.spec.js diff --git a/tests/parse_error_node/Client.js b/tests/flow/parse_error_node/Client.js similarity index 100% rename from tests/parse_error_node/Client.js rename to tests/flow/parse_error_node/Client.js diff --git a/tests/parse_error_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/parse_error_node/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/react/jsfmt.spec.js b/tests/flow/parse_error_node/jsfmt.spec.js similarity index 100% rename from tests/react/jsfmt.spec.js rename to tests/flow/parse_error_node/jsfmt.spec.js diff --git a/tests/path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/path/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/path/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/path/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/react_functional/jsfmt.spec.js b/tests/flow/path/jsfmt.spec.js similarity index 100% rename from tests/react_functional/jsfmt.spec.js rename to tests/flow/path/jsfmt.spec.js diff --git a/tests/path/while.js b/tests/flow/path/while.js similarity index 100% rename from tests/path/while.js rename to tests/flow/path/while.js diff --git a/tests/plsummit/__snapshots__/jsfmt.spec.js.snap b/tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/plsummit/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/plsummit/arrays.js b/tests/flow/plsummit/arrays.js similarity index 100% rename from tests/plsummit/arrays.js rename to tests/flow/plsummit/arrays.js diff --git a/tests/plsummit/export_class.js b/tests/flow/plsummit/export_class.js similarity index 100% rename from tests/plsummit/export_class.js rename to tests/flow/plsummit/export_class.js diff --git a/tests/plsummit/generics.js b/tests/flow/plsummit/generics.js similarity index 100% rename from tests/plsummit/generics.js rename to tests/flow/plsummit/generics.js diff --git a/tests/plsummit/import_class.js b/tests/flow/plsummit/import_class.js similarity index 100% rename from tests/plsummit/import_class.js rename to tests/flow/plsummit/import_class.js diff --git a/tests/react_modules/jsfmt.spec.js b/tests/flow/plsummit/jsfmt.spec.js similarity index 100% rename from tests/react_modules/jsfmt.spec.js rename to tests/flow/plsummit/jsfmt.spec.js diff --git a/tests/plsummit/locals.js b/tests/flow/plsummit/locals.js similarity index 100% rename from tests/plsummit/locals.js rename to tests/flow/plsummit/locals.js diff --git a/tests/plsummit/objects.js b/tests/flow/plsummit/objects.js similarity index 100% rename from tests/plsummit/objects.js rename to tests/flow/plsummit/objects.js diff --git a/tests/poly/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/poly/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/poly/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/poly/annot.js b/tests/flow/poly/annot.js similarity index 100% rename from tests/poly/annot.js rename to tests/flow/poly/annot.js diff --git a/tests/poly/implicit_bounded_instantiation.js b/tests/flow/poly/implicit_bounded_instantiation.js similarity index 100% rename from tests/poly/implicit_bounded_instantiation.js rename to tests/flow/poly/implicit_bounded_instantiation.js diff --git a/tests/poly/issue-1029.js b/tests/flow/poly/issue-1029.js similarity index 100% rename from tests/poly/issue-1029.js rename to tests/flow/poly/issue-1029.js diff --git a/tests/rec/jsfmt.spec.js b/tests/flow/poly/jsfmt.spec.js similarity index 100% rename from tests/rec/jsfmt.spec.js rename to tests/flow/poly/jsfmt.spec.js diff --git a/tests/poly/poly.js b/tests/flow/poly/poly.js similarity index 100% rename from tests/poly/poly.js rename to tests/flow/poly/poly.js diff --git a/tests/poly/test.js b/tests/flow/poly/test.js similarity index 100% rename from tests/poly/test.js rename to tests/flow/poly/test.js diff --git a/tests/poly_class_export/A.js b/tests/flow/poly_class_export/A.js similarity index 100% rename from tests/poly_class_export/A.js rename to tests/flow/poly_class_export/A.js diff --git a/tests/poly_class_export/B.js b/tests/flow/poly_class_export/B.js similarity index 100% rename from tests/poly_class_export/B.js rename to tests/flow/poly_class_export/B.js diff --git a/tests/poly_class_export/C.js b/tests/flow/poly_class_export/C.js similarity index 100% rename from tests/poly_class_export/C.js rename to tests/flow/poly_class_export/C.js diff --git a/tests/poly_class_export/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/poly_class_export/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck-haste/jsfmt.spec.js b/tests/flow/poly_class_export/jsfmt.spec.js similarity index 100% rename from tests/recheck-haste/jsfmt.spec.js rename to tests/flow/poly_class_export/jsfmt.spec.js diff --git a/tests/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck-haste/tmp1A/jsfmt.spec.js b/tests/flow/poly_overload/decls/jsfmt.spec.js similarity index 100% rename from tests/recheck-haste/tmp1A/jsfmt.spec.js rename to tests/flow/poly_overload/decls/jsfmt.spec.js diff --git a/tests/poly_overload/decls/typescript-deferred.js b/tests/flow/poly_overload/decls/typescript-deferred.js similarity index 100% rename from tests/poly_overload/decls/typescript-deferred.js rename to tests/flow/poly_overload/decls/typescript-deferred.js diff --git a/tests/predicates-abstract/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/predicates-abstract/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/predicates-abstract/filter-union.js b/tests/flow/predicates-abstract/filter-union.js similarity index 100% rename from tests/predicates-abstract/filter-union.js rename to tests/flow/predicates-abstract/filter-union.js diff --git a/tests/predicates-abstract/filter.js b/tests/flow/predicates-abstract/filter.js similarity index 100% rename from tests/predicates-abstract/filter.js rename to tests/flow/predicates-abstract/filter.js diff --git a/tests/recheck-haste/tmp2A/jsfmt.spec.js b/tests/flow/predicates-abstract/jsfmt.spec.js similarity index 100% rename from tests/recheck-haste/tmp2A/jsfmt.spec.js rename to tests/flow/predicates-abstract/jsfmt.spec.js diff --git a/tests/predicates-abstract/refine.js b/tests/flow/predicates-abstract/refine.js similarity index 100% rename from tests/predicates-abstract/refine.js rename to tests/flow/predicates-abstract/refine.js diff --git a/tests/predicates-abstract/sanity-filter-union.js b/tests/flow/predicates-abstract/sanity-filter-union.js similarity index 100% rename from tests/predicates-abstract/sanity-filter-union.js rename to tests/flow/predicates-abstract/sanity-filter-union.js diff --git a/tests/predicates-abstract/sanity-filter.js b/tests/flow/predicates-abstract/sanity-filter.js similarity index 100% rename from tests/predicates-abstract/sanity-filter.js rename to tests/flow/predicates-abstract/sanity-filter.js diff --git a/tests/predicates-abstract/sanity-refine.js b/tests/flow/predicates-abstract/sanity-refine.js similarity index 100% rename from tests/predicates-abstract/sanity-refine.js rename to tests/flow/predicates-abstract/sanity-refine.js diff --git a/tests/predicates-declared/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/predicates-declared/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/predicates-declared/function-bind.js b/tests/flow/predicates-declared/function-bind.js similarity index 100% rename from tests/predicates-declared/function-bind.js rename to tests/flow/predicates-declared/function-bind.js diff --git a/tests/predicates-declared/function-union.js b/tests/flow/predicates-declared/function-union.js similarity index 100% rename from tests/predicates-declared/function-union.js rename to tests/flow/predicates-declared/function-union.js diff --git a/tests/predicates-declared/is-string-decl.js b/tests/flow/predicates-declared/is-string-decl.js similarity index 100% rename from tests/predicates-declared/is-string-decl.js rename to tests/flow/predicates-declared/is-string-decl.js diff --git a/tests/recheck/jsfmt.spec.js b/tests/flow/predicates-declared/jsfmt.spec.js similarity index 100% rename from tests/recheck/jsfmt.spec.js rename to tests/flow/predicates-declared/jsfmt.spec.js diff --git a/tests/predicates-declared/logical-or.js b/tests/flow/predicates-declared/logical-or.js similarity index 100% rename from tests/predicates-declared/logical-or.js rename to tests/flow/predicates-declared/logical-or.js diff --git a/tests/predicates-declared/object-invariant.js b/tests/flow/predicates-declared/object-invariant.js similarity index 100% rename from tests/predicates-declared/object-invariant.js rename to tests/flow/predicates-declared/object-invariant.js diff --git a/tests/predicates-declared/orig-string-tag-check.js b/tests/flow/predicates-declared/orig-string-tag-check.js similarity index 100% rename from tests/predicates-declared/orig-string-tag-check.js rename to tests/flow/predicates-declared/orig-string-tag-check.js diff --git a/tests/predicates-declared/sanity-fall-through.js b/tests/flow/predicates-declared/sanity-fall-through.js similarity index 100% rename from tests/predicates-declared/sanity-fall-through.js rename to tests/flow/predicates-declared/sanity-fall-through.js diff --git a/tests/predicates-declared/sanity-invalid-calls.js b/tests/flow/predicates-declared/sanity-invalid-calls.js similarity index 100% rename from tests/predicates-declared/sanity-invalid-calls.js rename to tests/flow/predicates-declared/sanity-invalid-calls.js diff --git a/tests/predicates-declared/sanity-is-string-bug.js b/tests/flow/predicates-declared/sanity-is-string-bug.js similarity index 100% rename from tests/predicates-declared/sanity-is-string-bug.js rename to tests/flow/predicates-declared/sanity-is-string-bug.js diff --git a/tests/predicates-declared/sanity-parameter-mismatch.js b/tests/flow/predicates-declared/sanity-parameter-mismatch.js similarity index 100% rename from tests/predicates-declared/sanity-parameter-mismatch.js rename to tests/flow/predicates-declared/sanity-parameter-mismatch.js diff --git a/tests/predicates-declared/sanity-pred-with-body.js b/tests/flow/predicates-declared/sanity-pred-with-body.js similarity index 100% rename from tests/predicates-declared/sanity-pred-with-body.js rename to tests/flow/predicates-declared/sanity-pred-with-body.js diff --git a/tests/predicates-declared/sanity-return-type.js b/tests/flow/predicates-declared/sanity-return-type.js similarity index 100% rename from tests/predicates-declared/sanity-return-type.js rename to tests/flow/predicates-declared/sanity-return-type.js diff --git a/tests/predicates-inferred/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/predicates-inferred/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1a/jsfmt.spec.js b/tests/flow/predicates-inferred/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1a/jsfmt.spec.js rename to tests/flow/predicates-inferred/jsfmt.spec.js diff --git a/tests/predicates-inferred/sanity-multi-params.js b/tests/flow/predicates-inferred/sanity-multi-params.js similarity index 100% rename from tests/predicates-inferred/sanity-multi-params.js rename to tests/flow/predicates-inferred/sanity-multi-params.js diff --git a/tests/predicates-inferred/sanity-ordering.js b/tests/flow/predicates-inferred/sanity-ordering.js similarity index 100% rename from tests/predicates-inferred/sanity-ordering.js rename to tests/flow/predicates-inferred/sanity-ordering.js diff --git a/tests/predicates-inferred/sanity-unbound-var.js b/tests/flow/predicates-inferred/sanity-unbound-var.js similarity index 100% rename from tests/predicates-inferred/sanity-unbound-var.js rename to tests/flow/predicates-inferred/sanity-unbound-var.js diff --git a/tests/predicates-inferred/sanity.js b/tests/flow/predicates-inferred/sanity.js similarity index 100% rename from tests/predicates-inferred/sanity.js rename to tests/flow/predicates-inferred/sanity.js diff --git a/tests/predicates-inferred/simple-predicate-func-post.js b/tests/flow/predicates-inferred/simple-predicate-func-post.js similarity index 100% rename from tests/predicates-inferred/simple-predicate-func-post.js rename to tests/flow/predicates-inferred/simple-predicate-func-post.js diff --git a/tests/predicates-inferred/simple-predicate-func.js b/tests/flow/predicates-inferred/simple-predicate-func.js similarity index 100% rename from tests/predicates-inferred/simple-predicate-func.js rename to tests/flow/predicates-inferred/simple-predicate-func.js diff --git a/tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/predicates-parsing/fail-0.js b/tests/flow/predicates-parsing/fail-0.js similarity index 100% rename from tests/predicates-parsing/fail-0.js rename to tests/flow/predicates-parsing/fail-0.js diff --git a/tests/predicates-parsing/fail-1.js b/tests/flow/predicates-parsing/fail-1.js similarity index 100% rename from tests/predicates-parsing/fail-1.js rename to tests/flow/predicates-parsing/fail-1.js diff --git a/tests/predicates-parsing/fail-2.js b/tests/flow/predicates-parsing/fail-2.js similarity index 100% rename from tests/predicates-parsing/fail-2.js rename to tests/flow/predicates-parsing/fail-2.js diff --git a/tests/predicates-parsing/fail-3.js b/tests/flow/predicates-parsing/fail-3.js similarity index 100% rename from tests/predicates-parsing/fail-3.js rename to tests/flow/predicates-parsing/fail-3.js diff --git a/tests/recheck/tmp1b/jsfmt.spec.js b/tests/flow/predicates-parsing/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1b/jsfmt.spec.js rename to tests/flow/predicates-parsing/jsfmt.spec.js diff --git a/tests/predicates-parsing/pass.js b/tests/flow/predicates-parsing/pass.js similarity index 100% rename from tests/predicates-parsing/pass.js rename to tests/flow/predicates-parsing/pass.js diff --git a/tests/private/__snapshots__/jsfmt.spec.js.snap b/tests/flow/private/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/private/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/private/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1c/jsfmt.spec.js b/tests/flow/private/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1c/jsfmt.spec.js rename to tests/flow/private/jsfmt.spec.js diff --git a/tests/private/private.js b/tests/flow/private/private.js similarity index 100% rename from tests/private/private.js rename to tests/flow/private/private.js diff --git a/tests/promises/__snapshots__/jsfmt.spec.js.snap b/tests/flow/promises/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/promises/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/promises/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/promises/all.js b/tests/flow/promises/all.js similarity index 100% rename from tests/promises/all.js rename to tests/flow/promises/all.js diff --git a/tests/promises/covariance.js b/tests/flow/promises/covariance.js similarity index 100% rename from tests/promises/covariance.js rename to tests/flow/promises/covariance.js diff --git a/tests/recheck/tmp1d/jsfmt.spec.js b/tests/flow/promises/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1d/jsfmt.spec.js rename to tests/flow/promises/jsfmt.spec.js diff --git a/tests/promises/promise.js b/tests/flow/promises/promise.js similarity index 100% rename from tests/promises/promise.js rename to tests/flow/promises/promise.js diff --git a/tests/promises/resolve_global.js b/tests/flow/promises/resolve_global.js similarity index 100% rename from tests/promises/resolve_global.js rename to tests/flow/promises/resolve_global.js diff --git a/tests/promises/resolve_void.js b/tests/flow/promises/resolve_void.js similarity index 100% rename from tests/promises/resolve_void.js rename to tests/flow/promises/resolve_void.js diff --git a/tests/pure_component/__snapshots__/jsfmt.spec.js.snap b/tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/pure_component/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1e/jsfmt.spec.js b/tests/flow/pure_component/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1e/jsfmt.spec.js rename to tests/flow/pure_component/jsfmt.spec.js diff --git a/tests/pure_component/test.js b/tests/flow/pure_component/test.js similarity index 100% rename from tests/pure_component/test.js rename to tests/flow/pure_component/test.js diff --git a/tests/qualified/__snapshots__/jsfmt.spec.js.snap b/tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/qualified/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1f/jsfmt.spec.js b/tests/flow/qualified/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1f/jsfmt.spec.js rename to tests/flow/qualified/jsfmt.spec.js diff --git a/tests/qualified/qualified.js b/tests/flow/qualified/qualified.js similarity index 100% rename from tests/qualified/qualified.js rename to tests/flow/qualified/qualified.js diff --git a/tests/react/ArityError.react.js b/tests/flow/react/ArityError.react.js similarity index 100% rename from tests/react/ArityError.react.js rename to tests/flow/react/ArityError.react.js diff --git a/tests/react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/react/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/react/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/react/createElementRequiredProp_string.js b/tests/flow/react/createElementRequiredProp_string.js similarity index 100% rename from tests/react/createElementRequiredProp_string.js rename to tests/flow/react/createElementRequiredProp_string.js diff --git a/tests/react/createElement_string.js b/tests/flow/react/createElement_string.js similarity index 100% rename from tests/react/createElement_string.js rename to tests/flow/react/createElement_string.js diff --git a/tests/react/import_react.js b/tests/flow/react/import_react.js similarity index 100% rename from tests/react/import_react.js rename to tests/flow/react/import_react.js diff --git a/tests/recheck/tmp1g/jsfmt.spec.js b/tests/flow/react/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1g/jsfmt.spec.js rename to tests/flow/react/jsfmt.spec.js diff --git a/tests/react/jsx_spread.js b/tests/flow/react/jsx_spread.js similarity index 100% rename from tests/react/jsx_spread.js rename to tests/flow/react/jsx_spread.js diff --git a/tests/react/proptype_arrayOf.js b/tests/flow/react/proptype_arrayOf.js similarity index 100% rename from tests/react/proptype_arrayOf.js rename to tests/flow/react/proptype_arrayOf.js diff --git a/tests/react/proptype_func.js b/tests/flow/react/proptype_func.js similarity index 100% rename from tests/react/proptype_func.js rename to tests/flow/react/proptype_func.js diff --git a/tests/react/proptype_missing.js b/tests/flow/react/proptype_missing.js similarity index 100% rename from tests/react/proptype_missing.js rename to tests/flow/react/proptype_missing.js diff --git a/tests/react/proptype_object.js b/tests/flow/react/proptype_object.js similarity index 100% rename from tests/react/proptype_object.js rename to tests/flow/react/proptype_object.js diff --git a/tests/react/proptype_objectOf.js b/tests/flow/react/proptype_objectOf.js similarity index 100% rename from tests/react/proptype_objectOf.js rename to tests/flow/react/proptype_objectOf.js diff --git a/tests/react/proptype_oneOf.js b/tests/flow/react/proptype_oneOf.js similarity index 100% rename from tests/react/proptype_oneOf.js rename to tests/flow/react/proptype_oneOf.js diff --git a/tests/react/proptype_oneOfType.js b/tests/flow/react/proptype_oneOfType.js similarity index 100% rename from tests/react/proptype_oneOfType.js rename to tests/flow/react/proptype_oneOfType.js diff --git a/tests/react_functional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/react_functional/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1h/jsfmt.spec.js b/tests/flow/react_functional/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp1h/jsfmt.spec.js rename to tests/flow/react_functional/jsfmt.spec.js diff --git a/tests/react_functional/test.js b/tests/flow/react_functional/test.js similarity index 100% rename from tests/react_functional/test.js rename to tests/flow/react_functional/test.js diff --git a/tests/react_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/react_modules/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/react_modules/createclass-callsite.js b/tests/flow/react_modules/createclass-callsite.js similarity index 100% rename from tests/react_modules/createclass-callsite.js rename to tests/flow/react_modules/createclass-callsite.js diff --git a/tests/react_modules/createclass-module.js b/tests/flow/react_modules/createclass-module.js similarity index 100% rename from tests/react_modules/createclass-module.js rename to tests/flow/react_modules/createclass-module.js diff --git a/tests/react_modules/es6class-types-callsite.js b/tests/flow/react_modules/es6class-types-callsite.js similarity index 100% rename from tests/react_modules/es6class-types-callsite.js rename to tests/flow/react_modules/es6class-types-callsite.js diff --git a/tests/react_modules/es6class-types-module.js b/tests/flow/react_modules/es6class-types-module.js similarity index 100% rename from tests/react_modules/es6class-types-module.js rename to tests/flow/react_modules/es6class-types-module.js diff --git a/tests/recheck/tmp2a/jsfmt.spec.js b/tests/flow/react_modules/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp2a/jsfmt.spec.js rename to tests/flow/react_modules/jsfmt.spec.js diff --git a/tests/rec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/rec/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/rec/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/rec/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/rec/issue-1228.js b/tests/flow/rec/issue-1228.js similarity index 100% rename from tests/rec/issue-1228.js rename to tests/flow/rec/issue-1228.js diff --git a/tests/rec/issue-598.js b/tests/flow/rec/issue-598.js similarity index 100% rename from tests/rec/issue-598.js rename to tests/flow/rec/issue-598.js diff --git a/tests/recheck/tmp2b/jsfmt.spec.js b/tests/flow/rec/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp2b/jsfmt.spec.js rename to tests/flow/rec/jsfmt.spec.js diff --git a/tests/rec/test.js b/tests/flow/rec/test.js similarity index 100% rename from tests/rec/test.js rename to tests/flow/rec/test.js diff --git a/tests/rec/test2.js b/tests/flow/rec/test2.js similarity index 100% rename from tests/rec/test2.js rename to tests/flow/rec/test2.js diff --git a/tests/rec/test3.js b/tests/flow/rec/test3.js similarity index 100% rename from tests/rec/test3.js rename to tests/flow/rec/test3.js diff --git a/tests/rec/test4.js b/tests/flow/rec/test4.js similarity index 100% rename from tests/rec/test4.js rename to tests/flow/rec/test4.js diff --git a/tests/rec/test5.js b/tests/flow/rec/test5.js similarity index 100% rename from tests/rec/test5.js rename to tests/flow/rec/test5.js diff --git a/tests/recheck-haste/A1.js b/tests/flow/recheck-haste/A1.js similarity index 100% rename from tests/recheck-haste/A1.js rename to tests/flow/recheck-haste/A1.js diff --git a/tests/recheck-haste/A3.js b/tests/flow/recheck-haste/A3.js similarity index 100% rename from tests/recheck-haste/A3.js rename to tests/flow/recheck-haste/A3.js diff --git a/tests/recheck-haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck-haste/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2c/jsfmt.spec.js b/tests/flow/recheck-haste/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp2c/jsfmt.spec.js rename to tests/flow/recheck-haste/jsfmt.spec.js diff --git a/tests/recheck-haste/tmp1A/A2.js b/tests/flow/recheck-haste/tmp1A/A2.js similarity index 100% rename from tests/recheck-haste/tmp1A/A2.js rename to tests/flow/recheck-haste/tmp1A/A2.js diff --git a/tests/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2e/jsfmt.spec.js b/tests/flow/recheck-haste/tmp1A/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp2e/jsfmt.spec.js rename to tests/flow/recheck-haste/tmp1A/jsfmt.spec.js diff --git a/tests/recheck-haste/tmp2A/A3.js b/tests/flow/recheck-haste/tmp2A/A3.js similarity index 100% rename from tests/recheck-haste/tmp2A/A3.js rename to tests/flow/recheck-haste/tmp2A/A3.js diff --git a/tests/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2f/jsfmt.spec.js b/tests/flow/recheck-haste/tmp2A/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp2f/jsfmt.spec.js rename to tests/flow/recheck-haste/tmp2A/jsfmt.spec.js diff --git a/tests/recheck/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/a1.js b/tests/flow/recheck/a1.js similarity index 100% rename from tests/recheck/a1.js rename to tests/flow/recheck/a1.js diff --git a/tests/recheck/a2.js b/tests/flow/recheck/a2.js similarity index 100% rename from tests/recheck/a2.js rename to tests/flow/recheck/a2.js diff --git a/tests/recheck/a3.js b/tests/flow/recheck/a3.js similarity index 100% rename from tests/recheck/a3.js rename to tests/flow/recheck/a3.js diff --git a/tests/recheck/b0.js b/tests/flow/recheck/b0.js similarity index 100% rename from tests/recheck/b0.js rename to tests/flow/recheck/b0.js diff --git a/tests/recheck/b1.js b/tests/flow/recheck/b1.js similarity index 100% rename from tests/recheck/b1.js rename to tests/flow/recheck/b1.js diff --git a/tests/recheck/b2.js b/tests/flow/recheck/b2.js similarity index 100% rename from tests/recheck/b2.js rename to tests/flow/recheck/b2.js diff --git a/tests/recheck/b3.js b/tests/flow/recheck/b3.js similarity index 100% rename from tests/recheck/b3.js rename to tests/flow/recheck/b3.js diff --git a/tests/recheck/c1.js b/tests/flow/recheck/c1.js similarity index 100% rename from tests/recheck/c1.js rename to tests/flow/recheck/c1.js diff --git a/tests/recheck/c2.js b/tests/flow/recheck/c2.js similarity index 100% rename from tests/recheck/c2.js rename to tests/flow/recheck/c2.js diff --git a/tests/recheck/c3.js b/tests/flow/recheck/c3.js similarity index 100% rename from tests/recheck/c3.js rename to tests/flow/recheck/c3.js diff --git a/tests/recheck/d1.js b/tests/flow/recheck/d1.js similarity index 100% rename from tests/recheck/d1.js rename to tests/flow/recheck/d1.js diff --git a/tests/recheck/d2.js b/tests/flow/recheck/d2.js similarity index 100% rename from tests/recheck/d2.js rename to tests/flow/recheck/d2.js diff --git a/tests/recheck/e1.js b/tests/flow/recheck/e1.js similarity index 100% rename from tests/recheck/e1.js rename to tests/flow/recheck/e1.js diff --git a/tests/recheck/e2.js b/tests/flow/recheck/e2.js similarity index 100% rename from tests/recheck/e2.js rename to tests/flow/recheck/e2.js diff --git a/tests/recheck/f1.js b/tests/flow/recheck/f1.js similarity index 100% rename from tests/recheck/f1.js rename to tests/flow/recheck/f1.js diff --git a/tests/recheck/f2.js b/tests/flow/recheck/f2.js similarity index 100% rename from tests/recheck/f2.js rename to tests/flow/recheck/f2.js diff --git a/tests/recheck/g1.js b/tests/flow/recheck/g1.js similarity index 100% rename from tests/recheck/g1.js rename to tests/flow/recheck/g1.js diff --git a/tests/recheck/g2.js b/tests/flow/recheck/g2.js similarity index 100% rename from tests/recheck/g2.js rename to tests/flow/recheck/g2.js diff --git a/tests/recheck/g3.js b/tests/flow/recheck/g3.js similarity index 100% rename from tests/recheck/g3.js rename to tests/flow/recheck/g3.js diff --git a/tests/recheck/h1.js b/tests/flow/recheck/h1.js similarity index 100% rename from tests/recheck/h1.js rename to tests/flow/recheck/h1.js diff --git a/tests/recheck/h2.js b/tests/flow/recheck/h2.js similarity index 100% rename from tests/recheck/h2.js rename to tests/flow/recheck/h2.js diff --git a/tests/recheck/tmp3e/jsfmt.spec.js b/tests/flow/recheck/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp3e/jsfmt.spec.js rename to tests/flow/recheck/jsfmt.spec.js diff --git a/tests/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1a/a1.js b/tests/flow/recheck/tmp1a/a1.js similarity index 100% rename from tests/recheck/tmp1a/a1.js rename to tests/flow/recheck/tmp1a/a1.js diff --git a/tests/recheck/tmp3f/jsfmt.spec.js b/tests/flow/recheck/tmp1a/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp3f/jsfmt.spec.js rename to tests/flow/recheck/tmp1a/jsfmt.spec.js diff --git a/tests/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1b/b1.js b/tests/flow/recheck/tmp1b/b1.js similarity index 100% rename from tests/recheck/tmp1b/b1.js rename to tests/flow/recheck/tmp1b/b1.js diff --git a/tests/recheck/tmp4f/jsfmt.spec.js b/tests/flow/recheck/tmp1b/jsfmt.spec.js similarity index 100% rename from tests/recheck/tmp4f/jsfmt.spec.js rename to tests/flow/recheck/tmp1b/jsfmt.spec.js diff --git a/tests/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1c/c2.js b/tests/flow/recheck/tmp1c/c2.js similarity index 100% rename from tests/recheck/tmp1c/c2.js rename to tests/flow/recheck/tmp1c/c2.js diff --git a/tests/record/jsfmt.spec.js b/tests/flow/recheck/tmp1c/jsfmt.spec.js similarity index 100% rename from tests/record/jsfmt.spec.js rename to tests/flow/recheck/tmp1c/jsfmt.spec.js diff --git a/tests/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1d/d1.js b/tests/flow/recheck/tmp1d/d1.js similarity index 100% rename from tests/recheck/tmp1d/d1.js rename to tests/flow/recheck/tmp1d/d1.js diff --git a/tests/refi/jsfmt.spec.js b/tests/flow/recheck/tmp1d/jsfmt.spec.js similarity index 100% rename from tests/refi/jsfmt.spec.js rename to tests/flow/recheck/tmp1d/jsfmt.spec.js diff --git a/tests/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1e/e2.js b/tests/flow/recheck/tmp1e/e2.js similarity index 100% rename from tests/recheck/tmp1e/e2.js rename to tests/flow/recheck/tmp1e/e2.js diff --git a/tests/refinements/jsfmt.spec.js b/tests/flow/recheck/tmp1e/jsfmt.spec.js similarity index 100% rename from tests/refinements/jsfmt.spec.js rename to tests/flow/recheck/tmp1e/jsfmt.spec.js diff --git a/tests/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1f/f1.js b/tests/flow/recheck/tmp1f/f1.js similarity index 100% rename from tests/recheck/tmp1f/f1.js rename to tests/flow/recheck/tmp1f/f1.js diff --git a/tests/reflection/jsfmt.spec.js b/tests/flow/recheck/tmp1f/jsfmt.spec.js similarity index 100% rename from tests/reflection/jsfmt.spec.js rename to tests/flow/recheck/tmp1f/jsfmt.spec.js diff --git a/tests/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1g/g1.js b/tests/flow/recheck/tmp1g/g1.js similarity index 100% rename from tests/recheck/tmp1g/g1.js rename to tests/flow/recheck/tmp1g/g1.js diff --git a/tests/regexp/jsfmt.spec.js b/tests/flow/recheck/tmp1g/jsfmt.spec.js similarity index 100% rename from tests/regexp/jsfmt.spec.js rename to tests/flow/recheck/tmp1g/jsfmt.spec.js diff --git a/tests/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp1h/h1.js b/tests/flow/recheck/tmp1h/h1.js similarity index 100% rename from tests/recheck/tmp1h/h1.js rename to tests/flow/recheck/tmp1h/h1.js diff --git a/tests/replace/jsfmt.spec.js b/tests/flow/recheck/tmp1h/jsfmt.spec.js similarity index 100% rename from tests/replace/jsfmt.spec.js rename to tests/flow/recheck/tmp1h/jsfmt.spec.js diff --git a/tests/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2a/a1.js b/tests/flow/recheck/tmp2a/a1.js similarity index 100% rename from tests/recheck/tmp2a/a1.js rename to tests/flow/recheck/tmp2a/a1.js diff --git a/tests/require/jsfmt.spec.js b/tests/flow/recheck/tmp2a/jsfmt.spec.js similarity index 100% rename from tests/require/jsfmt.spec.js rename to tests/flow/recheck/tmp2a/jsfmt.spec.js diff --git a/tests/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2b/b0.js b/tests/flow/recheck/tmp2b/b0.js similarity index 100% rename from tests/recheck/tmp2b/b0.js rename to tests/flow/recheck/tmp2b/b0.js diff --git a/tests/requireLazy/jsfmt.spec.js b/tests/flow/recheck/tmp2b/jsfmt.spec.js similarity index 100% rename from tests/requireLazy/jsfmt.spec.js rename to tests/flow/recheck/tmp2b/jsfmt.spec.js diff --git a/tests/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2c/c1.js b/tests/flow/recheck/tmp2c/c1.js similarity index 100% rename from tests/recheck/tmp2c/c1.js rename to tests/flow/recheck/tmp2c/c1.js diff --git a/tests/return/jsfmt.spec.js b/tests/flow/recheck/tmp2c/jsfmt.spec.js similarity index 100% rename from tests/return/jsfmt.spec.js rename to tests/flow/recheck/tmp2c/jsfmt.spec.js diff --git a/tests/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2e/e1.js b/tests/flow/recheck/tmp2e/e1.js similarity index 100% rename from tests/recheck/tmp2e/e1.js rename to tests/flow/recheck/tmp2e/e1.js diff --git a/tests/return_new/jsfmt.spec.js b/tests/flow/recheck/tmp2e/jsfmt.spec.js similarity index 100% rename from tests/return_new/jsfmt.spec.js rename to tests/flow/recheck/tmp2e/jsfmt.spec.js diff --git a/tests/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp2f/f1.js b/tests/flow/recheck/tmp2f/f1.js similarity index 100% rename from tests/recheck/tmp2f/f1.js rename to tests/flow/recheck/tmp2f/f1.js diff --git a/tests/seal/jsfmt.spec.js b/tests/flow/recheck/tmp2f/jsfmt.spec.js similarity index 100% rename from tests/seal/jsfmt.spec.js rename to tests/flow/recheck/tmp2f/jsfmt.spec.js diff --git a/tests/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp3e/e1.js b/tests/flow/recheck/tmp3e/e1.js similarity index 100% rename from tests/recheck/tmp3e/e1.js rename to tests/flow/recheck/tmp3e/e1.js diff --git a/tests/recheck/tmp3e/e2.js b/tests/flow/recheck/tmp3e/e2.js similarity index 100% rename from tests/recheck/tmp3e/e2.js rename to tests/flow/recheck/tmp3e/e2.js diff --git a/tests/sealed/jsfmt.spec.js b/tests/flow/recheck/tmp3e/jsfmt.spec.js similarity index 100% rename from tests/sealed/jsfmt.spec.js rename to tests/flow/recheck/tmp3e/jsfmt.spec.js diff --git a/tests/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp3f/f1.js b/tests/flow/recheck/tmp3f/f1.js similarity index 100% rename from tests/recheck/tmp3f/f1.js rename to tests/flow/recheck/tmp3f/f1.js diff --git a/tests/sealed_objects/jsfmt.spec.js b/tests/flow/recheck/tmp3f/jsfmt.spec.js similarity index 100% rename from tests/sealed_objects/jsfmt.spec.js rename to tests/flow/recheck/tmp3f/jsfmt.spec.js diff --git a/tests/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/recheck/tmp4f/f1.js b/tests/flow/recheck/tmp4f/f1.js similarity index 100% rename from tests/recheck/tmp4f/f1.js rename to tests/flow/recheck/tmp4f/f1.js diff --git a/tests/shape/jsfmt.spec.js b/tests/flow/recheck/tmp4f/jsfmt.spec.js similarity index 100% rename from tests/shape/jsfmt.spec.js rename to tests/flow/recheck/tmp4f/jsfmt.spec.js diff --git a/tests/record/__snapshots__/jsfmt.spec.js.snap b/tests/flow/record/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/record/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/record/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/simple_arrays/jsfmt.spec.js b/tests/flow/record/jsfmt.spec.js similarity index 100% rename from tests/simple_arrays/jsfmt.spec.js rename to tests/flow/record/jsfmt.spec.js diff --git a/tests/record/test.js b/tests/flow/record/test.js similarity index 100% rename from tests/record/test.js rename to tests/flow/record/test.js diff --git a/tests/refi/__snapshots__/jsfmt.spec.js.snap b/tests/flow/refi/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/refi/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/refi/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/refi/bound.js b/tests/flow/refi/bound.js similarity index 100% rename from tests/refi/bound.js rename to tests/flow/refi/bound.js diff --git a/tests/refi/heap.js b/tests/flow/refi/heap.js similarity index 100% rename from tests/refi/heap.js rename to tests/flow/refi/heap.js diff --git a/tests/singleton/jsfmt.spec.js b/tests/flow/refi/jsfmt.spec.js similarity index 100% rename from tests/singleton/jsfmt.spec.js rename to tests/flow/refi/jsfmt.spec.js diff --git a/tests/refi/lex.js b/tests/flow/refi/lex.js similarity index 100% rename from tests/refi/lex.js rename to tests/flow/refi/lex.js diff --git a/tests/refi/local.js b/tests/flow/refi/local.js similarity index 100% rename from tests/refi/local.js rename to tests/flow/refi/local.js diff --git a/tests/refi/null_tests.js b/tests/flow/refi/null_tests.js similarity index 100% rename from tests/refi/null_tests.js rename to tests/flow/refi/null_tests.js diff --git a/tests/refi/switch.js b/tests/flow/refi/switch.js similarity index 100% rename from tests/refi/switch.js rename to tests/flow/refi/switch.js diff --git a/tests/refi/typeof_tests.js b/tests/flow/refi/typeof_tests.js similarity index 100% rename from tests/refi/typeof_tests.js rename to tests/flow/refi/typeof_tests.js diff --git a/tests/refi/undef_tests.js b/tests/flow/refi/undef_tests.js similarity index 100% rename from tests/refi/undef_tests.js rename to tests/flow/refi/undef_tests.js diff --git a/tests/refi/void_tests.js b/tests/flow/refi/void_tests.js similarity index 100% rename from tests/refi/void_tests.js rename to tests/flow/refi/void_tests.js diff --git a/tests/refinements/__snapshots__/jsfmt.spec.js.snap b/tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/refinements/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/refinements/assignment.js b/tests/flow/refinements/assignment.js similarity index 100% rename from tests/refinements/assignment.js rename to tests/flow/refinements/assignment.js diff --git a/tests/refinements/ast_node.js b/tests/flow/refinements/ast_node.js similarity index 100% rename from tests/refinements/ast_node.js rename to tests/flow/refinements/ast_node.js diff --git a/tests/refinements/bool.js b/tests/flow/refinements/bool.js similarity index 100% rename from tests/refinements/bool.js rename to tests/flow/refinements/bool.js diff --git a/tests/refinements/computed_string_literal.js b/tests/flow/refinements/computed_string_literal.js similarity index 100% rename from tests/refinements/computed_string_literal.js rename to tests/flow/refinements/computed_string_literal.js diff --git a/tests/refinements/cond_prop.js b/tests/flow/refinements/cond_prop.js similarity index 100% rename from tests/refinements/cond_prop.js rename to tests/flow/refinements/cond_prop.js diff --git a/tests/refinements/constants.js b/tests/flow/refinements/constants.js similarity index 100% rename from tests/refinements/constants.js rename to tests/flow/refinements/constants.js diff --git a/tests/refinements/eq.js b/tests/flow/refinements/eq.js similarity index 100% rename from tests/refinements/eq.js rename to tests/flow/refinements/eq.js diff --git a/tests/refinements/exists.js b/tests/flow/refinements/exists.js similarity index 100% rename from tests/refinements/exists.js rename to tests/flow/refinements/exists.js diff --git a/tests/refinements/func_call.js b/tests/flow/refinements/func_call.js similarity index 100% rename from tests/refinements/func_call.js rename to tests/flow/refinements/func_call.js diff --git a/tests/refinements/hasOwnProperty.js b/tests/flow/refinements/hasOwnProperty.js similarity index 100% rename from tests/refinements/hasOwnProperty.js rename to tests/flow/refinements/hasOwnProperty.js diff --git a/tests/refinements/heap_defassign.js b/tests/flow/refinements/heap_defassign.js similarity index 100% rename from tests/refinements/heap_defassign.js rename to tests/flow/refinements/heap_defassign.js diff --git a/tests/spread/jsfmt.spec.js b/tests/flow/refinements/jsfmt.spec.js similarity index 100% rename from tests/spread/jsfmt.spec.js rename to tests/flow/refinements/jsfmt.spec.js diff --git a/tests/refinements/lib.js b/tests/flow/refinements/lib.js similarity index 100% rename from tests/refinements/lib.js rename to tests/flow/refinements/lib.js diff --git a/tests/refinements/missing-property-cond.js b/tests/flow/refinements/missing-property-cond.js similarity index 100% rename from tests/refinements/missing-property-cond.js rename to tests/flow/refinements/missing-property-cond.js diff --git a/tests/refinements/mixed.js b/tests/flow/refinements/mixed.js similarity index 100% rename from tests/refinements/mixed.js rename to tests/flow/refinements/mixed.js diff --git a/tests/refinements/node1.js b/tests/flow/refinements/node1.js similarity index 100% rename from tests/refinements/node1.js rename to tests/flow/refinements/node1.js diff --git a/tests/refinements/not.js b/tests/flow/refinements/not.js similarity index 100% rename from tests/refinements/not.js rename to tests/flow/refinements/not.js diff --git a/tests/refinements/null.js b/tests/flow/refinements/null.js similarity index 100% rename from tests/refinements/null.js rename to tests/flow/refinements/null.js diff --git a/tests/refinements/number.js b/tests/flow/refinements/number.js similarity index 100% rename from tests/refinements/number.js rename to tests/flow/refinements/number.js diff --git a/tests/refinements/property.js b/tests/flow/refinements/property.js similarity index 100% rename from tests/refinements/property.js rename to tests/flow/refinements/property.js diff --git a/tests/refinements/refinements.js b/tests/flow/refinements/refinements.js similarity index 100% rename from tests/refinements/refinements.js rename to tests/flow/refinements/refinements.js diff --git a/tests/refinements/string.js b/tests/flow/refinements/string.js similarity index 100% rename from tests/refinements/string.js rename to tests/flow/refinements/string.js diff --git a/tests/refinements/super_member.js b/tests/flow/refinements/super_member.js similarity index 100% rename from tests/refinements/super_member.js rename to tests/flow/refinements/super_member.js diff --git a/tests/refinements/switch.js b/tests/flow/refinements/switch.js similarity index 100% rename from tests/refinements/switch.js rename to tests/flow/refinements/switch.js diff --git a/tests/refinements/tagged_union.js b/tests/flow/refinements/tagged_union.js similarity index 100% rename from tests/refinements/tagged_union.js rename to tests/flow/refinements/tagged_union.js diff --git a/tests/refinements/tagged_union_import.js b/tests/flow/refinements/tagged_union_import.js similarity index 100% rename from tests/refinements/tagged_union_import.js rename to tests/flow/refinements/tagged_union_import.js diff --git a/tests/refinements/typeof.js b/tests/flow/refinements/typeof.js similarity index 100% rename from tests/refinements/typeof.js rename to tests/flow/refinements/typeof.js diff --git a/tests/refinements/undef.js b/tests/flow/refinements/undef.js similarity index 100% rename from tests/refinements/undef.js rename to tests/flow/refinements/undef.js diff --git a/tests/refinements/union.js b/tests/flow/refinements/union.js similarity index 100% rename from tests/refinements/union.js rename to tests/flow/refinements/union.js diff --git a/tests/refinements/void.js b/tests/flow/refinements/void.js similarity index 100% rename from tests/refinements/void.js rename to tests/flow/refinements/void.js diff --git a/tests/reflection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/reflection/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/static_overload/jsfmt.spec.js b/tests/flow/reflection/jsfmt.spec.js similarity index 100% rename from tests/static_overload/jsfmt.spec.js rename to tests/flow/reflection/jsfmt.spec.js diff --git a/tests/reflection/type.js b/tests/flow/reflection/type.js similarity index 100% rename from tests/reflection/type.js rename to tests/flow/reflection/type.js diff --git a/tests/regexp/__snapshots__/jsfmt.spec.js.snap b/tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/regexp/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/static_overload/lib/jsfmt.spec.js b/tests/flow/regexp/jsfmt.spec.js similarity index 100% rename from tests/static_overload/lib/jsfmt.spec.js rename to tests/flow/regexp/jsfmt.spec.js diff --git a/tests/regexp/regexp.js b/tests/flow/regexp/regexp.js similarity index 100% rename from tests/regexp/regexp.js rename to tests/flow/regexp/regexp.js diff --git a/tests/replace/__snapshots__/jsfmt.spec.js.snap b/tests/flow/replace/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/replace/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/replace/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/statics/jsfmt.spec.js b/tests/flow/replace/jsfmt.spec.js similarity index 100% rename from tests/statics/jsfmt.spec.js rename to tests/flow/replace/jsfmt.spec.js diff --git a/tests/replace/test.js b/tests/flow/replace/test.js similarity index 100% rename from tests/replace/test.js rename to tests/flow/replace/test.js diff --git a/tests/require/B.js b/tests/flow/require/B.js similarity index 100% rename from tests/require/B.js rename to tests/flow/require/B.js diff --git a/tests/require/C.js b/tests/flow/require/C.js similarity index 100% rename from tests/require/C.js rename to tests/flow/require/C.js diff --git a/tests/require/E.js b/tests/flow/require/E.js similarity index 100% rename from tests/require/E.js rename to tests/flow/require/E.js diff --git a/tests/require/ProvidesModuleA.js b/tests/flow/require/ProvidesModuleA.js similarity index 100% rename from tests/require/ProvidesModuleA.js rename to tests/flow/require/ProvidesModuleA.js diff --git a/tests/require/ProvidesModuleD.js b/tests/flow/require/ProvidesModuleD.js similarity index 100% rename from tests/require/ProvidesModuleD.js rename to tests/flow/require/ProvidesModuleD.js diff --git a/tests/require/__snapshots__/jsfmt.spec.js.snap b/tests/flow/require/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/require/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/require/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/strict/jsfmt.spec.js b/tests/flow/require/jsfmt.spec.js similarity index 100% rename from tests/strict/jsfmt.spec.js rename to tests/flow/require/jsfmt.spec.js diff --git a/tests/require/not_builtin_require.js b/tests/flow/require/not_builtin_require.js similarity index 100% rename from tests/require/not_builtin_require.js rename to tests/flow/require/not_builtin_require.js diff --git a/tests/require/not_builtin_require2.js b/tests/flow/require/not_builtin_require2.js similarity index 100% rename from tests/require/not_builtin_require2.js rename to tests/flow/require/not_builtin_require2.js diff --git a/tests/require/require.js b/tests/flow/require/require.js similarity index 100% rename from tests/require/require.js rename to tests/flow/require/require.js diff --git a/tests/requireLazy/A.js b/tests/flow/requireLazy/A.js similarity index 100% rename from tests/requireLazy/A.js rename to tests/flow/requireLazy/A.js diff --git a/tests/requireLazy/B.js b/tests/flow/requireLazy/B.js similarity index 100% rename from tests/requireLazy/B.js rename to tests/flow/requireLazy/B.js diff --git a/tests/requireLazy/__snapshots__/jsfmt.spec.js.snap b/tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/requireLazy/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/strict_requires/jsfmt.spec.js b/tests/flow/requireLazy/jsfmt.spec.js similarity index 100% rename from tests/strict_requires/jsfmt.spec.js rename to tests/flow/requireLazy/jsfmt.spec.js diff --git a/tests/requireLazy/requireLazy.js b/tests/flow/requireLazy/requireLazy.js similarity index 100% rename from tests/requireLazy/requireLazy.js rename to tests/flow/requireLazy/requireLazy.js diff --git a/tests/return/__snapshots__/jsfmt.spec.js.snap b/tests/flow/return/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/return/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/return/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/return/function_return.js b/tests/flow/return/function_return.js similarity index 100% rename from tests/return/function_return.js rename to tests/flow/return/function_return.js diff --git a/tests/structural_subtyping/jsfmt.spec.js b/tests/flow/return/jsfmt.spec.js similarity index 100% rename from tests/structural_subtyping/jsfmt.spec.js rename to tests/flow/return/jsfmt.spec.js diff --git a/tests/return/void.js b/tests/flow/return/void.js similarity index 100% rename from tests/return/void.js rename to tests/flow/return/void.js diff --git a/tests/return_new/__snapshots__/jsfmt.spec.js.snap b/tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/return_new/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/suggest/jsfmt.spec.js b/tests/flow/return_new/jsfmt.spec.js similarity index 100% rename from tests/suggest/jsfmt.spec.js rename to tests/flow/return_new/jsfmt.spec.js diff --git a/tests/return_new/test.js b/tests/flow/return_new/test.js similarity index 100% rename from tests/return_new/test.js rename to tests/flow/return_new/test.js diff --git a/tests/return_new/test2.js b/tests/flow/return_new/test2.js similarity index 100% rename from tests/return_new/test2.js rename to tests/flow/return_new/test2.js diff --git a/tests/seal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/seal/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/seal/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/seal/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/seal/imp.js b/tests/flow/seal/imp.js similarity index 100% rename from tests/seal/imp.js rename to tests/flow/seal/imp.js diff --git a/tests/super/jsfmt.spec.js b/tests/flow/seal/jsfmt.spec.js similarity index 100% rename from tests/super/jsfmt.spec.js rename to tests/flow/seal/jsfmt.spec.js diff --git a/tests/seal/obj_annot.js b/tests/flow/seal/obj_annot.js similarity index 100% rename from tests/seal/obj_annot.js rename to tests/flow/seal/obj_annot.js diff --git a/tests/sealed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/sealed/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/sealed/function.js b/tests/flow/sealed/function.js similarity index 100% rename from tests/sealed/function.js rename to tests/flow/sealed/function.js diff --git a/tests/suppress/jsfmt.spec.js b/tests/flow/sealed/jsfmt.spec.js similarity index 100% rename from tests/suppress/jsfmt.spec.js rename to tests/flow/sealed/jsfmt.spec.js diff --git a/tests/sealed/proto.js b/tests/flow/sealed/proto.js similarity index 100% rename from tests/sealed/proto.js rename to tests/flow/sealed/proto.js diff --git a/tests/sealed/sealed.js b/tests/flow/sealed/sealed.js similarity index 100% rename from tests/sealed/sealed.js rename to tests/flow/sealed/sealed.js diff --git a/tests/sealed_objects/__snapshots__/jsfmt.spec.js.snap b/tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/sealed_objects/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/suppress_incremental/jsfmt.spec.js b/tests/flow/sealed_objects/jsfmt.spec.js similarity index 100% rename from tests/suppress_incremental/jsfmt.spec.js rename to tests/flow/sealed_objects/jsfmt.spec.js diff --git a/tests/sealed_objects/test.js b/tests/flow/sealed_objects/test.js similarity index 100% rename from tests/sealed_objects/test.js rename to tests/flow/sealed_objects/test.js diff --git a/tests/shape/__snapshots__/jsfmt.spec.js.snap b/tests/flow/shape/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/shape/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/shape/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/suppress_traces/jsfmt.spec.js b/tests/flow/shape/jsfmt.spec.js similarity index 100% rename from tests/suppress_traces/jsfmt.spec.js rename to tests/flow/shape/jsfmt.spec.js diff --git a/tests/shape/test.js b/tests/flow/shape/test.js similarity index 100% rename from tests/shape/test.js rename to tests/flow/shape/test.js diff --git a/tests/simple_arrays/__snapshots__/jsfmt.spec.js.snap b/tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/simple_arrays/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/simple_arrays/array.js b/tests/flow/simple_arrays/array.js similarity index 100% rename from tests/simple_arrays/array.js rename to tests/flow/simple_arrays/array.js diff --git a/tests/simple_arrays/array2.js b/tests/flow/simple_arrays/array2.js similarity index 100% rename from tests/simple_arrays/array2.js rename to tests/flow/simple_arrays/array2.js diff --git a/tests/symbol/jsfmt.spec.js b/tests/flow/simple_arrays/jsfmt.spec.js similarity index 100% rename from tests/symbol/jsfmt.spec.js rename to tests/flow/simple_arrays/jsfmt.spec.js diff --git a/tests/singleton/__snapshots__/jsfmt.spec.js.snap b/tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/singleton/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/singleton/boolean.js b/tests/flow/singleton/boolean.js similarity index 100% rename from tests/singleton/boolean.js rename to tests/flow/singleton/boolean.js diff --git a/tests/symlink/jsfmt.spec.js b/tests/flow/singleton/jsfmt.spec.js similarity index 100% rename from tests/symlink/jsfmt.spec.js rename to tests/flow/singleton/jsfmt.spec.js diff --git a/tests/singleton/number.js b/tests/flow/singleton/number.js similarity index 100% rename from tests/singleton/number.js rename to tests/flow/singleton/number.js diff --git a/tests/singleton/string.js b/tests/flow/singleton/string.js similarity index 100% rename from tests/singleton/string.js rename to tests/flow/singleton/string.js diff --git a/tests/spread/__snapshots__/jsfmt.spec.js.snap b/tests/flow/spread/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/spread/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/spread/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/tagged-unions/jsfmt.spec.js b/tests/flow/spread/jsfmt.spec.js similarity index 100% rename from tests/tagged-unions/jsfmt.spec.js rename to tests/flow/spread/jsfmt.spec.js diff --git a/tests/spread/test.js b/tests/flow/spread/test.js similarity index 100% rename from tests/spread/test.js rename to tests/flow/spread/test.js diff --git a/tests/spread/test2.js b/tests/flow/spread/test2.js similarity index 100% rename from tests/spread/test2.js rename to tests/flow/spread/test2.js diff --git a/tests/spread/test3.js b/tests/flow/spread/test3.js similarity index 100% rename from tests/spread/test3.js rename to tests/flow/spread/test3.js diff --git a/tests/spread/test4.js b/tests/flow/spread/test4.js similarity index 100% rename from tests/spread/test4.js rename to tests/flow/spread/test4.js diff --git a/tests/spread/test5.js b/tests/flow/spread/test5.js similarity index 100% rename from tests/spread/test5.js rename to tests/flow/spread/test5.js diff --git a/tests/spread/test6.js b/tests/flow/spread/test6.js similarity index 100% rename from tests/spread/test6.js rename to tests/flow/spread/test6.js diff --git a/tests/spread/test7.js b/tests/flow/spread/test7.js similarity index 100% rename from tests/spread/test7.js rename to tests/flow/spread/test7.js diff --git a/tests/static_overload/__snapshots__/jsfmt.spec.js.snap b/tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/static_overload/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/taint/jsfmt.spec.js b/tests/flow/static_overload/jsfmt.spec.js similarity index 100% rename from tests/taint/jsfmt.spec.js rename to tests/flow/static_overload/jsfmt.spec.js diff --git a/tests/static_overload/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/static_overload/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/this/jsfmt.spec.js b/tests/flow/static_overload/lib/jsfmt.spec.js similarity index 100% rename from tests/this/jsfmt.spec.js rename to tests/flow/static_overload/lib/jsfmt.spec.js diff --git a/tests/static_overload/lib/lib.js b/tests/flow/static_overload/lib/lib.js similarity index 100% rename from tests/static_overload/lib/lib.js rename to tests/flow/static_overload/lib/lib.js diff --git a/tests/static_overload/test.js b/tests/flow/static_overload/test.js similarity index 100% rename from tests/static_overload/test.js rename to tests/flow/static_overload/test.js diff --git a/tests/statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/statics/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/statics/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/statics/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/statics/class_statics.js b/tests/flow/statics/class_statics.js similarity index 100% rename from tests/statics/class_statics.js rename to tests/flow/statics/class_statics.js diff --git a/tests/statics/funstatics.js b/tests/flow/statics/funstatics.js similarity index 100% rename from tests/statics/funstatics.js rename to tests/flow/statics/funstatics.js diff --git a/tests/this_ctor/jsfmt.spec.js b/tests/flow/statics/jsfmt.spec.js similarity index 100% rename from tests/this_ctor/jsfmt.spec.js rename to tests/flow/statics/jsfmt.spec.js diff --git a/tests/strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/strict/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/strict/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/strict/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/strict/annot.js b/tests/flow/strict/annot.js similarity index 100% rename from tests/strict/annot.js rename to tests/flow/strict/annot.js diff --git a/tests/strict/fun.js b/tests/flow/strict/fun.js similarity index 100% rename from tests/strict/fun.js rename to tests/flow/strict/fun.js diff --git a/tests/this_type/jsfmt.spec.js b/tests/flow/strict/jsfmt.spec.js similarity index 100% rename from tests/this_type/jsfmt.spec.js rename to tests/flow/strict/jsfmt.spec.js diff --git a/tests/strict/obj.js b/tests/flow/strict/obj.js similarity index 100% rename from tests/strict/obj.js rename to tests/flow/strict/obj.js diff --git a/tests/strict_requires/A.js b/tests/flow/strict_requires/A.js similarity index 100% rename from tests/strict_requires/A.js rename to tests/flow/strict_requires/A.js diff --git a/tests/strict_requires/B.js b/tests/flow/strict_requires/B.js similarity index 100% rename from tests/strict_requires/B.js rename to tests/flow/strict_requires/B.js diff --git a/tests/strict_requires/C.js b/tests/flow/strict_requires/C.js similarity index 100% rename from tests/strict_requires/C.js rename to tests/flow/strict_requires/C.js diff --git a/tests/strict_requires/D.js b/tests/flow/strict_requires/D.js similarity index 100% rename from tests/strict_requires/D.js rename to tests/flow/strict_requires/D.js diff --git a/tests/strict_requires/__snapshots__/jsfmt.spec.js.snap b/tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/strict_requires/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/this_type/lib/jsfmt.spec.js b/tests/flow/strict_requires/jsfmt.spec.js similarity index 100% rename from tests/this_type/lib/jsfmt.spec.js rename to tests/flow/strict_requires/jsfmt.spec.js diff --git a/tests/structural_subtyping/__snapshots__/jsfmt.spec.js.snap b/tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/structural_subtyping/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/structural_subtyping/builtin.js b/tests/flow/structural_subtyping/builtin.js similarity index 100% rename from tests/structural_subtyping/builtin.js rename to tests/flow/structural_subtyping/builtin.js diff --git a/tests/structural_subtyping/class.js b/tests/flow/structural_subtyping/class.js similarity index 100% rename from tests/structural_subtyping/class.js rename to tests/flow/structural_subtyping/class.js diff --git a/tests/throw/jsfmt.spec.js b/tests/flow/structural_subtyping/jsfmt.spec.js similarity index 100% rename from tests/throw/jsfmt.spec.js rename to tests/flow/structural_subtyping/jsfmt.spec.js diff --git a/tests/structural_subtyping/obj.js b/tests/flow/structural_subtyping/obj.js similarity index 100% rename from tests/structural_subtyping/obj.js rename to tests/flow/structural_subtyping/obj.js diff --git a/tests/structural_subtyping/optional.js b/tests/flow/structural_subtyping/optional.js similarity index 100% rename from tests/structural_subtyping/optional.js rename to tests/flow/structural_subtyping/optional.js diff --git a/tests/suggest/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/suggest/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/traces/jsfmt.spec.js b/tests/flow/suggest/jsfmt.spec.js similarity index 100% rename from tests/traces/jsfmt.spec.js rename to tests/flow/suggest/jsfmt.spec.js diff --git a/tests/suggest/lib.js b/tests/flow/suggest/lib.js similarity index 100% rename from tests/suggest/lib.js rename to tests/flow/suggest/lib.js diff --git a/tests/suggest/suggest.js b/tests/flow/suggest/suggest.js similarity index 100% rename from tests/suggest/suggest.js rename to tests/flow/suggest/suggest.js diff --git a/tests/super/__snapshots__/jsfmt.spec.js.snap b/tests/flow/super/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/super/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/super/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/super/constructor.js b/tests/flow/super/constructor.js similarity index 100% rename from tests/super/constructor.js rename to tests/flow/super/constructor.js diff --git a/tests/super/import.js b/tests/flow/super/import.js similarity index 100% rename from tests/super/import.js rename to tests/flow/super/import.js diff --git a/tests/traits/jsfmt.spec.js b/tests/flow/super/jsfmt.spec.js similarity index 100% rename from tests/traits/jsfmt.spec.js rename to tests/flow/super/jsfmt.spec.js diff --git a/tests/super/super.js b/tests/flow/super/super.js similarity index 100% rename from tests/super/super.js rename to tests/flow/super/super.js diff --git a/tests/super/test.js b/tests/flow/super/test.js similarity index 100% rename from tests/super/test.js rename to tests/flow/super/test.js diff --git a/tests/suppress/A.js b/tests/flow/suppress/A.js similarity index 100% rename from tests/suppress/A.js rename to tests/flow/suppress/A.js diff --git a/tests/suppress/B.js b/tests/flow/suppress/B.js similarity index 100% rename from tests/suppress/B.js rename to tests/flow/suppress/B.js diff --git a/tests/suppress/C.js b/tests/flow/suppress/C.js similarity index 100% rename from tests/suppress/C.js rename to tests/flow/suppress/C.js diff --git a/tests/suppress/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/suppress/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/try/jsfmt.spec.js b/tests/flow/suppress/jsfmt.spec.js similarity index 100% rename from tests/try/jsfmt.spec.js rename to tests/flow/suppress/jsfmt.spec.js diff --git a/tests/suppress/lib.js b/tests/flow/suppress/lib.js similarity index 100% rename from tests/suppress/lib.js rename to tests/flow/suppress/lib.js diff --git a/tests/suppress_incremental/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/suppress_incremental/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/tuples/jsfmt.spec.js b/tests/flow/suppress_incremental/jsfmt.spec.js similarity index 100% rename from tests/tuples/jsfmt.spec.js rename to tests/flow/suppress_incremental/jsfmt.spec.js diff --git a/tests/suppress_incremental/test.js b/tests/flow/suppress_incremental/test.js similarity index 100% rename from tests/suppress_incremental/test.js rename to tests/flow/suppress_incremental/test.js diff --git a/tests/suppress_traces/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/suppress_traces/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type-at-pos/jsfmt.spec.js b/tests/flow/suppress_traces/jsfmt.spec.js similarity index 100% rename from tests/type-at-pos/jsfmt.spec.js rename to tests/flow/suppress_traces/jsfmt.spec.js diff --git a/tests/suppress_traces/traces.js b/tests/flow/suppress_traces/traces.js similarity index 100% rename from tests/suppress_traces/traces.js rename to tests/flow/suppress_traces/traces.js diff --git a/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap b/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..60b9dc0f --- /dev/null +++ b/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,405 @@ +exports[`test more_switch.js 1`] = ` +"/* @flow */ + +function foo(x): number { + switch (x) { + case 0: + case 1: return 1; + default: throw new Error(\'hi\'); + } +} + +function bar(x) { + switch (x) { + case 0: break; + default: return; + } + 1; +} + +function baz(x): number { + switch (x) { + case 0: break; + case 1: return 1; + default: throw new Error(\'hi\'); + } + return 2; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +function foo(x): number { + switch (x) { + case 0: + case 1: + return 1; + default: + throw new Error(\"hi\"); + } +} + +function bar(x) { + switch (x) { + case 0: + break; + default: + return; + } + 1; +} + +function baz(x): number { + switch (x) { + case 0: + break; + case 1: + return 1; + default: + throw new Error(\"hi\"); + } + return 2; +} +" +`; + +exports[`test switch.js 1`] = ` +"/** + * @flow + */ +function foo( +): number { + switch (\'foo\') { + case \'foo\': + return 1; + } + return 2; +} + +function bar() { + switch (\'bar\') { + case \'bar\': + break; + default: + break; + } +} + +function qux(b) { + var x = b? 0: \"\"; + switch(\'qux\') { + case \'\': + x = 0; + case \'qux\': + x = x*x; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @flow + */ +function foo(): number { + switch (\"foo\") { + case \"foo\": + return 1; + } + return 2; +} + +function bar() { + switch (\"bar\") { + case \"bar\": + break; + default: + break; + } +} + +function qux(b) { + var x = b ? 0 : \"\"; + switch (\"qux\") { + case \"\": + x = 0; + case \"qux\": + x = x * x; + } +} +" +`; + +exports[`test switch_default_fallthrough.js 1`] = ` +"/** + * @flow + */ +function foo(x : mixed): string { + var a = \"\"; + var b = \"\"; + + switch (x) { + case \"foo\": + a = 0; + default: + b = 0; + } + + // a is now string | number + (a : string); // error, string | number ~/> string + (a : number); // error, string | number ~/> number + + // b is now number + (b : number); // ok + return b; // error, number ~/> string +} + +function baz(x: mixed): number { + var a = \"\"; + var b = \"\"; + + switch (x) { + case \"baz\": + a = 0; + break; + case \"bar\": + a = \"\"; + default: + b = 0; + } + + // a is now string | number + (a : string); // error, string | number ~/> string + (a : number); // error, string | number ~/> number + + // b is now string | number + (b : string); // error, string | number ~/> string + (b : number); // error, string | number ~/> number + + return a+b; // error, string ~/> number +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @flow + */ +function foo(x: mixed): string { + var a = \"\"; + var b = \"\"; + + switch (x) { + case \"foo\": + a = 0; + default: + b = 0; + } + + // a is now string | number + (a: string); + // error, string | number ~/> string + (a: number); + + // error, string | number ~/> number + // b is now number + (b: number); + // ok + return b; // error, number ~/> string +} + +function baz(x: mixed): number { + var a = \"\"; + var b = \"\"; + + switch (x) { + case \"baz\": + a = 0; + break; + case \"bar\": + a = \"\"; + default: + b = 0; + } + + // a is now string | number + (a: string); + // error, string | number ~/> string + (a: number); + + // error, string | number ~/> number + // b is now string | number + (b: string); + // error, string | number ~/> string + (b: number); + + // error, string | number ~/> number + return a + b; // error, string ~/> number +} +" +`; + +exports[`test trailing_cases.js 1`] = ` +"/** + * trailing cases are allowed - spot checks that we handle them as usual + * @flow + */ +function f1(i) { + var x; + + switch (i) { + case 0: + x = 0; + break; + case 1: + x = 1; + break; + default: + x = -1; + break; + case 2: + x = \"2\"; + break; + } + + var y:number = x; // error, number | string ~/> number +} + +function f2(i) { + var x; + + switch (i) { + case 0: + case 1: + default: + x = 1; + break; + case 2: + // does not fall through default + } + + var y:number = x; // error, number | uninitialized ~/> number +} + +function f3(i) { + var x; + + switch (i) { + case 0: + case 1: + default: + // falls through to subsequent cases + case 2: + x = 1; + } + + var y:number = x; // no error +} + +function foo(x): number { + switch (x) { + case 0: + default: throw new Error(\'hi\'); + case 1: return 1; + } +} + +function bar(x) { + switch (x) { + default: return; + case 0: break; + } + 1; +} + +function baz(x): number { + switch (x) { + case 0: break; + default: throw new Error(\'hi\'); + case 1: return 1; + } + return 2; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * trailing cases are allowed - spot checks that we handle them as usual + * @flow + */ +function f1(i) { + var x; + + switch (i) { + case 0: + x = 0; + break; + case 1: + x = 1; + break; + default: + x = -1; + break; + case 2: + x = \"2\"; + break; + } + + var y: number = x; // error, number | string ~/> number +} + +function f2(i) { + var x; + + switch (i) { + case 0: + case 1: + default: + x = 1; + break; + // does not fall through default + case 2: + } + + var y: number = x; // error, number | uninitialized ~/> number +} + +function f3(i) { + var x; + + switch (i) { + case 0: + case 1: + default: + // falls through to subsequent cases + case 2: + x = 1; + } + + var y: number = x; // no error +} + +function foo(x): number { + switch (x) { + case 0: + default: + throw new Error(\"hi\"); + case 1: + return 1; + } +} + +function bar(x) { + switch (x) { + default: + return; + case 0: + break; + } + 1; +} + +function baz(x): number { + switch (x) { + case 0: + break; + default: + throw new Error(\"hi\"); + case 1: + return 1; + } + return 2; +} +" +`; diff --git a/tests/type-destructors/jsfmt.spec.js b/tests/flow/switch/jsfmt.spec.js similarity index 100% rename from tests/type-destructors/jsfmt.spec.js rename to tests/flow/switch/jsfmt.spec.js diff --git a/tests/switch/more_switch.js b/tests/flow/switch/more_switch.js similarity index 100% rename from tests/switch/more_switch.js rename to tests/flow/switch/more_switch.js diff --git a/tests/switch/switch.js b/tests/flow/switch/switch.js similarity index 100% rename from tests/switch/switch.js rename to tests/flow/switch/switch.js diff --git a/tests/switch/switch_default_fallthrough.js b/tests/flow/switch/switch_default_fallthrough.js similarity index 100% rename from tests/switch/switch_default_fallthrough.js rename to tests/flow/switch/switch_default_fallthrough.js diff --git a/tests/switch/trailing_cases.js b/tests/flow/switch/trailing_cases.js similarity index 100% rename from tests/switch/trailing_cases.js rename to tests/flow/switch/trailing_cases.js diff --git a/tests/symbol/__snapshots__/jsfmt.spec.js.snap b/tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/symbol/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type-printer/jsfmt.spec.js b/tests/flow/symbol/jsfmt.spec.js similarity index 100% rename from tests/type-printer/jsfmt.spec.js rename to tests/flow/symbol/jsfmt.spec.js diff --git a/tests/symbol/symbol.js b/tests/flow/symbol/symbol.js similarity index 100% rename from tests/symbol/symbol.js rename to tests/flow/symbol/symbol.js diff --git a/tests/symlink/__snapshots__/jsfmt.spec.js.snap b/tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/symlink/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/symlink/bar.js b/tests/flow/symlink/bar.js similarity index 100% rename from tests/symlink/bar.js rename to tests/flow/symlink/bar.js diff --git a/tests/symlink/foo.js b/tests/flow/symlink/foo.js similarity index 100% rename from tests/symlink/foo.js rename to tests/flow/symlink/foo.js diff --git a/tests/type_args_nonstrict/jsfmt.spec.js b/tests/flow/symlink/jsfmt.spec.js similarity index 100% rename from tests/type_args_nonstrict/jsfmt.spec.js rename to tests/flow/symlink/jsfmt.spec.js diff --git a/tests/symlink/qux.js b/tests/flow/symlink/qux.js similarity index 100% rename from tests/symlink/qux.js rename to tests/flow/symlink/qux.js diff --git a/tests/tagged-unions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/tagged-unions/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/tagged-unions/classes.js b/tests/flow/tagged-unions/classes.js similarity index 100% rename from tests/tagged-unions/classes.js rename to tests/flow/tagged-unions/classes.js diff --git a/tests/tagged-unions/interfaces-neg.js b/tests/flow/tagged-unions/interfaces-neg.js similarity index 100% rename from tests/tagged-unions/interfaces-neg.js rename to tests/flow/tagged-unions/interfaces-neg.js diff --git a/tests/tagged-unions/interfaces-pos.js b/tests/flow/tagged-unions/interfaces-pos.js similarity index 100% rename from tests/tagged-unions/interfaces-pos.js rename to tests/flow/tagged-unions/interfaces-pos.js diff --git a/tests/type_args_strict/jsfmt.spec.js b/tests/flow/tagged-unions/jsfmt.spec.js similarity index 100% rename from tests/type_args_strict/jsfmt.spec.js rename to tests/flow/tagged-unions/jsfmt.spec.js diff --git a/tests/tagged-unions/type-decls-neg.js b/tests/flow/tagged-unions/type-decls-neg.js similarity index 100% rename from tests/tagged-unions/type-decls-neg.js rename to tests/flow/tagged-unions/type-decls-neg.js diff --git a/tests/tagged-unions/type-decls-pos.js b/tests/flow/tagged-unions/type-decls-pos.js similarity index 100% rename from tests/tagged-unions/type-decls-pos.js rename to tests/flow/tagged-unions/type-decls-pos.js diff --git a/tests/taint/__snapshots__/jsfmt.spec.js.snap b/tests/flow/taint/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/taint/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/taint/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/taint/adder.js b/tests/flow/taint/adder.js similarity index 100% rename from tests/taint/adder.js rename to tests/flow/taint/adder.js diff --git a/tests/taint/any_object.js b/tests/flow/taint/any_object.js similarity index 100% rename from tests/taint/any_object.js rename to tests/flow/taint/any_object.js diff --git a/tests/taint/call-object-property.js b/tests/flow/taint/call-object-property.js similarity index 100% rename from tests/taint/call-object-property.js rename to tests/flow/taint/call-object-property.js diff --git a/tests/taint/comparator.js b/tests/flow/taint/comparator.js similarity index 100% rename from tests/taint/comparator.js rename to tests/flow/taint/comparator.js diff --git a/tests/taint/function.js b/tests/flow/taint/function.js similarity index 100% rename from tests/taint/function.js rename to tests/flow/taint/function.js diff --git a/tests/taint/globals.js b/tests/flow/taint/globals.js similarity index 100% rename from tests/taint/globals.js rename to tests/flow/taint/globals.js diff --git a/tests/type_only_vars/jsfmt.spec.js b/tests/flow/taint/jsfmt.spec.js similarity index 100% rename from tests/type_only_vars/jsfmt.spec.js rename to tests/flow/taint/jsfmt.spec.js diff --git a/tests/taint/lib.js b/tests/flow/taint/lib.js similarity index 100% rename from tests/taint/lib.js rename to tests/flow/taint/lib.js diff --git a/tests/taint/taint1.js b/tests/flow/taint/taint1.js similarity index 100% rename from tests/taint/taint1.js rename to tests/flow/taint/taint1.js diff --git a/tests/taint/taint2.js b/tests/flow/taint/taint2.js similarity index 100% rename from tests/taint/taint2.js rename to tests/flow/taint/taint2.js diff --git a/tests/taint/taint3.js b/tests/flow/taint/taint3.js similarity index 100% rename from tests/taint/taint3.js rename to tests/flow/taint/taint3.js diff --git a/tests/taint/taint4.js b/tests/flow/taint/taint4.js similarity index 100% rename from tests/taint/taint4.js rename to tests/flow/taint/taint4.js diff --git a/tests/taint/use-types.js b/tests/flow/taint/use-types.js similarity index 100% rename from tests/taint/use-types.js rename to tests/flow/taint/use-types.js diff --git a/tests/flow/template/__snapshots__/jsfmt.spec.js.snap b/tests/flow/template/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..7d6584fb --- /dev/null +++ b/tests/flow/template/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,79 @@ +exports[`test template.js 1`] = ` +"/* @flow */ + +(\`foo\`: string); // ok +(\`bar\`: \'bar\'); // ok +(\`baz\`: number); // error + +\`foo \${123} bar\`; // ok, number can be appended to string +\`foo \${{bar: 123}} baz\`; // error, object can\'t be appended + +let tests = [ + function(x: string) { + \`foo \${x}\`; // ok + \`\${x} bar\`; // ok + \`foo \${\'bar\'} \${x}\`; // ok + }, + function(x: number) { + \`foo \${x}\`; // ok + \`\${x} bar\`; // ok + \`foo \${\'bar\'} \${x}\`; // ok + }, + function(x: boolean) { + \`foo \${x}\`; // error + \`\${x} bar\`; // error + \`foo \${\'bar\'} \${x}\`; // error + }, + function(x: mixed) { + \`foo \${x}\`; // error + \`\${x} bar\`; // error + \`foo \${\'bar\'} \${x}\`; // error + }, +]; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +(\`foo\`: string); +// ok +(\`bar\`: \"bar\"); +// ok +(\`baz\`: number); + +// error +\`foo \${123} bar\`; +// ok, number can be appended to string +\`foo \${{ bar: 123 }} baz\`; + +// error, object can\'t be appended +let tests = [ + function(x: string) { + \`foo \${x}\`; + // ok + \`\${x} bar\`; + // ok + \`foo \${\"bar\"} \${x}\`; // ok + }, + function(x: number) { + \`foo \${x}\`; + // ok + \`\${x} bar\`; + // ok + \`foo \${\"bar\"} \${x}\`; // ok + }, + function(x: boolean) { + \`foo \${x}\`; + // error + \`\${x} bar\`; + // error + \`foo \${\"bar\"} \${x}\`; // error + }, + function(x: mixed) { + \`foo \${x}\`; + // error + \`\${x} bar\`; + // error + \`foo \${\"bar\"} \${x}\`; // error + } +]; +" +`; diff --git a/tests/type_param_defaults/jsfmt.spec.js b/tests/flow/template/jsfmt.spec.js similarity index 100% rename from tests/type_param_defaults/jsfmt.spec.js rename to tests/flow/template/jsfmt.spec.js diff --git a/tests/template/template.js b/tests/flow/template/template.js similarity index 100% rename from tests/template/template.js rename to tests/flow/template/template.js diff --git a/tests/this/This.js b/tests/flow/this/This.js similarity index 100% rename from tests/this/This.js rename to tests/flow/this/This.js diff --git a/tests/this/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/this/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/this/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/this/arrows.js b/tests/flow/this/arrows.js similarity index 100% rename from tests/this/arrows.js rename to tests/flow/this/arrows.js diff --git a/tests/type_param_scope/jsfmt.spec.js b/tests/flow/this/jsfmt.spec.js similarity index 100% rename from tests/type_param_scope/jsfmt.spec.js rename to tests/flow/this/jsfmt.spec.js diff --git a/tests/this_ctor/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/this_ctor/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type_param_variance/jsfmt.spec.js b/tests/flow/this_ctor/jsfmt.spec.js similarity index 100% rename from tests/type_param_variance/jsfmt.spec.js rename to tests/flow/this_ctor/jsfmt.spec.js diff --git a/tests/this_ctor/test.js b/tests/flow/this_ctor/test.js similarity index 100% rename from tests/this_ctor/test.js rename to tests/flow/this_ctor/test.js diff --git a/tests/this_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/this_type/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/this_type/class_expr.js b/tests/flow/this_type/class_expr.js similarity index 100% rename from tests/this_type/class_expr.js rename to tests/flow/this_type/class_expr.js diff --git a/tests/this_type/contra.js b/tests/flow/this_type/contra.js similarity index 100% rename from tests/this_type/contra.js rename to tests/flow/this_type/contra.js diff --git a/tests/this_type/export.js b/tests/flow/this_type/export.js similarity index 100% rename from tests/this_type/export.js rename to tests/flow/this_type/export.js diff --git a/tests/this_type/generics.js b/tests/flow/this_type/generics.js similarity index 100% rename from tests/this_type/generics.js rename to tests/flow/this_type/generics.js diff --git a/tests/this_type/import.js b/tests/flow/this_type/import.js similarity index 100% rename from tests/this_type/import.js rename to tests/flow/this_type/import.js diff --git a/tests/this_type/interface.js b/tests/flow/this_type/interface.js similarity index 100% rename from tests/this_type/interface.js rename to tests/flow/this_type/interface.js diff --git a/tests/type_param_variance2/jsfmt.spec.js b/tests/flow/this_type/jsfmt.spec.js similarity index 100% rename from tests/type_param_variance2/jsfmt.spec.js rename to tests/flow/this_type/jsfmt.spec.js diff --git a/tests/this_type/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/this_type/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/this_type/lib/decl.js b/tests/flow/this_type/lib/decl.js similarity index 100% rename from tests/this_type/lib/decl.js rename to tests/flow/this_type/lib/decl.js diff --git a/tests/type_param_variance2/libs/jsfmt.spec.js b/tests/flow/this_type/lib/jsfmt.spec.js similarity index 100% rename from tests/type_param_variance2/libs/jsfmt.spec.js rename to tests/flow/this_type/lib/jsfmt.spec.js diff --git a/tests/this_type/lib_client.js b/tests/flow/this_type/lib_client.js similarity index 100% rename from tests/this_type/lib_client.js rename to tests/flow/this_type/lib_client.js diff --git a/tests/this_type/self.js b/tests/flow/this_type/self.js similarity index 100% rename from tests/this_type/self.js rename to tests/flow/this_type/self.js diff --git a/tests/this_type/statics.js b/tests/flow/this_type/statics.js similarity index 100% rename from tests/this_type/statics.js rename to tests/flow/this_type/statics.js diff --git a/tests/this_type/test.js b/tests/flow/this_type/test.js similarity index 100% rename from tests/this_type/test.js rename to tests/flow/this_type/test.js diff --git a/tests/throw/__snapshots__/jsfmt.spec.js.snap b/tests/flow/throw/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/throw/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/throw/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/typeapp_perf/jsfmt.spec.js b/tests/flow/throw/jsfmt.spec.js similarity index 100% rename from tests/typeapp_perf/jsfmt.spec.js rename to tests/flow/throw/jsfmt.spec.js diff --git a/tests/throw/test.js b/tests/flow/throw/test.js similarity index 100% rename from tests/throw/test.js rename to tests/flow/throw/test.js diff --git a/tests/traces/Traces.js b/tests/flow/traces/Traces.js similarity index 100% rename from tests/traces/Traces.js rename to tests/flow/traces/Traces.js diff --git a/tests/traces/Traces2.js b/tests/flow/traces/Traces2.js similarity index 100% rename from tests/traces/Traces2.js rename to tests/flow/traces/Traces2.js diff --git a/tests/traces/__snapshots__/jsfmt.spec.js.snap b/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/traces/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/traces/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/typecast/jsfmt.spec.js b/tests/flow/traces/jsfmt.spec.js similarity index 100% rename from tests/typecast/jsfmt.spec.js rename to tests/flow/traces/jsfmt.spec.js diff --git a/tests/traits/__snapshots__/jsfmt.spec.js.snap b/tests/flow/traits/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/traits/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/traits/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/typeof/jsfmt.spec.js b/tests/flow/traits/jsfmt.spec.js similarity index 100% rename from tests/typeof/jsfmt.spec.js rename to tests/flow/traits/jsfmt.spec.js diff --git a/tests/traits/test.js b/tests/flow/traits/test.js similarity index 100% rename from tests/traits/test.js rename to tests/flow/traits/test.js diff --git a/tests/traits/test2.js b/tests/flow/traits/test2.js similarity index 100% rename from tests/traits/test2.js rename to tests/flow/traits/test2.js diff --git a/tests/try/__snapshots__/jsfmt.spec.js.snap b/tests/flow/try/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/try/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/try/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/try/abnormals.js b/tests/flow/try/abnormals.js similarity index 100% rename from tests/try/abnormals.js rename to tests/flow/try/abnormals.js diff --git a/tests/try/init.js b/tests/flow/try/init.js similarity index 100% rename from tests/try/init.js rename to tests/flow/try/init.js diff --git a/tests/unchecked_haste_module_vs_lib/jsfmt.spec.js b/tests/flow/try/jsfmt.spec.js similarity index 100% rename from tests/unchecked_haste_module_vs_lib/jsfmt.spec.js rename to tests/flow/try/jsfmt.spec.js diff --git a/tests/try/return.js b/tests/flow/try/return.js similarity index 100% rename from tests/try/return.js rename to tests/flow/try/return.js diff --git a/tests/try/test.js b/tests/flow/try/test.js similarity index 100% rename from tests/try/test.js rename to tests/flow/try/test.js diff --git a/tests/tuples/__snapshots__/jsfmt.spec.js.snap b/tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/tuples/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/tuples/array.js b/tests/flow/tuples/array.js similarity index 100% rename from tests/tuples/array.js rename to tests/flow/tuples/array.js diff --git a/tests/unchecked_node_module_vs_lib/jsfmt.spec.js b/tests/flow/tuples/jsfmt.spec.js similarity index 100% rename from tests/unchecked_node_module_vs_lib/jsfmt.spec.js rename to tests/flow/tuples/jsfmt.spec.js diff --git a/tests/tuples/optional.js b/tests/flow/tuples/optional.js similarity index 100% rename from tests/tuples/optional.js rename to tests/flow/tuples/optional.js diff --git a/tests/tuples/too-few.js b/tests/flow/tuples/too-few.js similarity index 100% rename from tests/tuples/too-few.js rename to tests/flow/tuples/too-few.js diff --git a/tests/tuples/tuples.js b/tests/flow/tuples/tuples.js similarity index 100% rename from tests/tuples/tuples.js rename to tests/flow/tuples/tuples.js diff --git a/tests/type-at-pos/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type-at-pos/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type-at-pos/destructuring.js b/tests/flow/type-at-pos/destructuring.js similarity index 100% rename from tests/type-at-pos/destructuring.js rename to tests/flow/type-at-pos/destructuring.js diff --git a/tests/type-at-pos/function_expressions.js b/tests/flow/type-at-pos/function_expressions.js similarity index 100% rename from tests/type-at-pos/function_expressions.js rename to tests/flow/type-at-pos/function_expressions.js diff --git a/tests/type-at-pos/generics.js b/tests/flow/type-at-pos/generics.js similarity index 100% rename from tests/type-at-pos/generics.js rename to tests/flow/type-at-pos/generics.js diff --git a/tests/type-at-pos/import.js b/tests/flow/type-at-pos/import.js similarity index 100% rename from tests/type-at-pos/import.js rename to tests/flow/type-at-pos/import.js diff --git a/tests/undefined/jsfmt.spec.js b/tests/flow/type-at-pos/jsfmt.spec.js similarity index 100% rename from tests/undefined/jsfmt.spec.js rename to tests/flow/type-at-pos/jsfmt.spec.js diff --git a/tests/type-at-pos/object_special_cases.js b/tests/flow/type-at-pos/object_special_cases.js similarity index 100% rename from tests/type-at-pos/object_special_cases.js rename to tests/flow/type-at-pos/object_special_cases.js diff --git a/tests/type-at-pos/optional.js b/tests/flow/type-at-pos/optional.js similarity index 100% rename from tests/type-at-pos/optional.js rename to tests/flow/type-at-pos/optional.js diff --git a/tests/type-at-pos/predicates.js b/tests/flow/type-at-pos/predicates.js similarity index 100% rename from tests/type-at-pos/predicates.js rename to tests/flow/type-at-pos/predicates.js diff --git a/tests/type-at-pos/react.js b/tests/flow/type-at-pos/react.js similarity index 100% rename from tests/type-at-pos/react.js rename to tests/flow/type-at-pos/react.js diff --git a/tests/type-at-pos/templates.js b/tests/flow/type-at-pos/templates.js similarity index 100% rename from tests/type-at-pos/templates.js rename to tests/flow/type-at-pos/templates.js diff --git a/tests/type-at-pos/test.js b/tests/flow/type-at-pos/test.js similarity index 100% rename from tests/type-at-pos/test.js rename to tests/flow/type-at-pos/test.js diff --git a/tests/type-at-pos/trycatch.js b/tests/flow/type-at-pos/trycatch.js similarity index 100% rename from tests/type-at-pos/trycatch.js rename to tests/flow/type-at-pos/trycatch.js diff --git a/tests/type-destructors/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type-destructors/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union-intersection/jsfmt.spec.js b/tests/flow/type-destructors/jsfmt.spec.js similarity index 100% rename from tests/union-intersection/jsfmt.spec.js rename to tests/flow/type-destructors/jsfmt.spec.js diff --git a/tests/type-destructors/non_maybe_type.js b/tests/flow/type-destructors/non_maybe_type.js similarity index 100% rename from tests/type-destructors/non_maybe_type.js rename to tests/flow/type-destructors/non_maybe_type.js diff --git a/tests/type-destructors/property_type.js b/tests/flow/type-destructors/property_type.js similarity index 100% rename from tests/type-destructors/property_type.js rename to tests/flow/type-destructors/property_type.js diff --git a/tests/type-destructors/union.js b/tests/flow/type-destructors/union.js similarity index 100% rename from tests/type-destructors/union.js rename to tests/flow/type-destructors/union.js diff --git a/tests/type-printer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type-printer/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union/jsfmt.spec.js b/tests/flow/type-printer/jsfmt.spec.js similarity index 100% rename from tests/union/jsfmt.spec.js rename to tests/flow/type-printer/jsfmt.spec.js diff --git a/tests/type-printer/printBinaryExpression.js b/tests/flow/type-printer/printBinaryExpression.js similarity index 100% rename from tests/type-printer/printBinaryExpression.js rename to tests/flow/type-printer/printBinaryExpression.js diff --git a/tests/type-printer/types.js b/tests/flow/type-printer/types.js similarity index 100% rename from tests/type-printer/types.js rename to tests/flow/type-printer/types.js diff --git a/tests/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union_new/jsfmt.spec.js b/tests/flow/type_args_nonstrict/jsfmt.spec.js similarity index 100% rename from tests/union_new/jsfmt.spec.js rename to tests/flow/type_args_nonstrict/jsfmt.spec.js diff --git a/tests/type_args_nonstrict/test.js b/tests/flow/type_args_nonstrict/test.js similarity index 100% rename from tests/type_args_nonstrict/test.js rename to tests/flow/type_args_nonstrict/test.js diff --git a/tests/type_args_strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_args_strict/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union_new/lib/jsfmt.spec.js b/tests/flow/type_args_strict/jsfmt.spec.js similarity index 100% rename from tests/union_new/lib/jsfmt.spec.js rename to tests/flow/type_args_strict/jsfmt.spec.js diff --git a/tests/type_args_strict/test.js b/tests/flow/type_args_strict/test.js similarity index 100% rename from tests/type_args_strict/test.js rename to tests/flow/type_args_strict/test.js diff --git a/tests/type_only_vars/A.js b/tests/flow/type_only_vars/A.js similarity index 100% rename from tests/type_only_vars/A.js rename to tests/flow/type_only_vars/A.js diff --git a/tests/type_only_vars/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_only_vars/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type_only_vars/bad_shadowing.js b/tests/flow/type_only_vars/bad_shadowing.js similarity index 100% rename from tests/type_only_vars/bad_shadowing.js rename to tests/flow/type_only_vars/bad_shadowing.js diff --git a/tests/type_only_vars/good_shadowing.js b/tests/flow/type_only_vars/good_shadowing.js similarity index 100% rename from tests/type_only_vars/good_shadowing.js rename to tests/flow/type_only_vars/good_shadowing.js diff --git a/tests/type_only_vars/import_type.js b/tests/flow/type_only_vars/import_type.js similarity index 100% rename from tests/type_only_vars/import_type.js rename to tests/flow/type_only_vars/import_type.js diff --git a/tests/unreachable/jsfmt.spec.js b/tests/flow/type_only_vars/jsfmt.spec.js similarity index 100% rename from tests/unreachable/jsfmt.spec.js rename to tests/flow/type_only_vars/jsfmt.spec.js diff --git a/tests/type_only_vars/type_alias.js b/tests/flow/type_only_vars/type_alias.js similarity index 100% rename from tests/type_only_vars/type_alias.js rename to tests/flow/type_only_vars/type_alias.js diff --git a/tests/type_param_defaults/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_param_defaults/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type_param_defaults/classes.js b/tests/flow/type_param_defaults/classes.js similarity index 100% rename from tests/type_param_defaults/classes.js rename to tests/flow/type_param_defaults/classes.js diff --git a/tests/urnary_expression/jsfmt.spec.js b/tests/flow/type_param_defaults/jsfmt.spec.js similarity index 100% rename from tests/urnary_expression/jsfmt.spec.js rename to tests/flow/type_param_defaults/jsfmt.spec.js diff --git a/tests/type_param_scope/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_param_scope/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/type_param_scope/class.js b/tests/flow/type_param_scope/class.js similarity index 100% rename from tests/type_param_scope/class.js rename to tests/flow/type_param_scope/class.js diff --git a/tests/type_param_scope/default_params.js b/tests/flow/type_param_scope/default_params.js similarity index 100% rename from tests/type_param_scope/default_params.js rename to tests/flow/type_param_scope/default_params.js diff --git a/tests/value/jsfmt.spec.js b/tests/flow/type_param_scope/jsfmt.spec.js similarity index 100% rename from tests/value/jsfmt.spec.js rename to tests/flow/type_param_scope/jsfmt.spec.js diff --git a/tests/type_param_scope/method_shadow.js b/tests/flow/type_param_scope/method_shadow.js similarity index 100% rename from tests/type_param_scope/method_shadow.js rename to tests/flow/type_param_scope/method_shadow.js diff --git a/tests/type_param_variance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_param_variance/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/vim_emacs_errors/jsfmt.spec.js b/tests/flow/type_param_variance/jsfmt.spec.js similarity index 100% rename from tests/vim_emacs_errors/jsfmt.spec.js rename to tests/flow/type_param_variance/jsfmt.spec.js diff --git a/tests/type_param_variance/promise.js b/tests/flow/type_param_variance/promise.js similarity index 100% rename from tests/type_param_variance/promise.js rename to tests/flow/type_param_variance/promise.js diff --git a/tests/type_param_variance2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_param_variance2/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/weakmode/jsfmt.spec.js b/tests/flow/type_param_variance2/jsfmt.spec.js similarity index 100% rename from tests/weakmode/jsfmt.spec.js rename to tests/flow/type_param_variance2/jsfmt.spec.js diff --git a/tests/type_param_variance2/libs/Promise.js b/tests/flow/type_param_variance2/libs/Promise.js similarity index 100% rename from tests/type_param_variance2/libs/Promise.js rename to tests/flow/type_param_variance2/libs/Promise.js diff --git a/tests/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/window/jsfmt.spec.js b/tests/flow/type_param_variance2/libs/jsfmt.spec.js similarity index 100% rename from tests/window/jsfmt.spec.js rename to tests/flow/type_param_variance2/libs/jsfmt.spec.js diff --git a/tests/type_param_variance2/promise.js b/tests/flow/type_param_variance2/promise.js similarity index 100% rename from tests/type_param_variance2/promise.js rename to tests/flow/type_param_variance2/promise.js diff --git a/tests/typeapp_perf/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/typeapp_perf/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/x/jsfmt.spec.js b/tests/flow/typeapp_perf/jsfmt.spec.js similarity index 100% rename from tests/x/jsfmt.spec.js rename to tests/flow/typeapp_perf/jsfmt.spec.js diff --git a/tests/typeapp_perf/test1.js b/tests/flow/typeapp_perf/test1.js similarity index 100% rename from tests/typeapp_perf/test1.js rename to tests/flow/typeapp_perf/test1.js diff --git a/tests/typeapp_perf/test2.js b/tests/flow/typeapp_perf/test2.js similarity index 100% rename from tests/typeapp_perf/test2.js rename to tests/flow/typeapp_perf/test2.js diff --git a/tests/typecast/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/typecast/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/typecast/jsfmt.spec.js b/tests/flow/typecast/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/typecast/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/typecast/typecast.js b/tests/flow/typecast/typecast.js similarity index 100% rename from tests/typecast/typecast.js rename to tests/flow/typecast/typecast.js diff --git a/tests/typeof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/typeof/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/typeof/jsfmt.spec.js b/tests/flow/typeof/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/typeof/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/typeof/typeof.js b/tests/flow/typeof/typeof.js similarity index 100% rename from tests/typeof/typeof.js rename to tests/flow/typeof/typeof.js diff --git a/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..e0503051 --- /dev/null +++ b/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,120 @@ +exports[`test unary.js 1`] = ` +"/* @flow */ + +function x0(y: string): number { + return +y; // ok, + exists solely for coercion +} + +function x1(y: string): number { + return -y; // error, we don\'t allow coercion here +} + +function x3(y: string) { + return ~y; // error, we don\'t allow coercion here +} + +function x4(y: string): boolean { + return !y; // ok, coercion is allowed +} + +(-1: void); // error, number ~> void +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +function x0(y: string): number { + return +y; // ok, + exists solely for coercion +} + +function x1(y: string): number { + return -y; // error, we don\'t allow coercion here +} + +function x3(y: string) { + return ~y; // error, we don\'t allow coercion here +} + +function x4(y: string): boolean { + return !y; // ok, coercion is allowed +} + +(-1: void); // error, number ~> void +" +`; + +exports[`test update.js 1`] = ` +"// @flow + +let tests = [ + function(y: number) { + y++; + y--; + ++y; + --y; + }, + + function(y: string) { + y++; // error, we don\'t allow coercion here + (y: number); // ok, y is a number now + y++; // error, but you still can\'t write a number to a string + }, + + function(y: string) { + y--; // error, we don\'t allow coercion here + }, + + function(y: string) { + ++y; // error, we don\'t allow coercion here + }, + + function(y: string) { + --y; // error, we don\'t allow coercion here + }, + + function() { + const y = 123; + y++; // error, can\'t update const + y--; // error, can\'t update const + }, + + function(y: any) { + y++; // ok + }, +]; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// @flow + +let tests = [ + function(y: number) { + y++; + y--; + ++y; + --y; + }, + function(y: string) { + y++; + // error, we don\'t allow coercion here + (y: number); + // ok, y is a number now + y++; // error, but you still can\'t write a number to a string + }, + function(y: string) { + y--; // error, we don\'t allow coercion here + }, + function(y: string) { + ++y; // error, we don\'t allow coercion here + }, + function(y: string) { + --y; // error, we don\'t allow coercion here + }, + function() { + const y = 123; + y++; + // error, can\'t update const + y--; // error, can\'t update const + }, + function(y: any) { + y++; // ok + } +]; +" +`; diff --git a/tests/flow/unary/jsfmt.spec.js b/tests/flow/unary/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/unary/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/unary/unary.js b/tests/flow/unary/unary.js similarity index 100% rename from tests/unary/unary.js rename to tests/flow/unary/unary.js diff --git a/tests/unary/update.js b/tests/flow/unary/update.js similarity index 100% rename from tests/unary/update.js rename to tests/flow/unary/update.js diff --git a/tests/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/unchecked_haste_module_vs_lib/buffer.js b/tests/flow/unchecked_haste_module_vs_lib/buffer.js similarity index 100% rename from tests/unchecked_haste_module_vs_lib/buffer.js rename to tests/flow/unchecked_haste_module_vs_lib/buffer.js diff --git a/tests/flow/unchecked_haste_module_vs_lib/jsfmt.spec.js b/tests/flow/unchecked_haste_module_vs_lib/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/unchecked_haste_module_vs_lib/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/unchecked_haste_module_vs_lib/test.js b/tests/flow/unchecked_haste_module_vs_lib/test.js similarity index 100% rename from tests/unchecked_haste_module_vs_lib/test.js rename to tests/flow/unchecked_haste_module_vs_lib/test.js diff --git a/tests/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/unchecked_node_module_vs_lib/jsfmt.spec.js b/tests/flow/unchecked_node_module_vs_lib/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/unchecked_node_module_vs_lib/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/unchecked_node_module_vs_lib/test.js b/tests/flow/unchecked_node_module_vs_lib/test.js similarity index 100% rename from tests/unchecked_node_module_vs_lib/test.js rename to tests/flow/unchecked_node_module_vs_lib/test.js diff --git a/tests/undefined/__snapshots__/jsfmt.spec.js.snap b/tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/undefined/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/undefined/issue-518.js b/tests/flow/undefined/issue-518.js similarity index 100% rename from tests/undefined/issue-518.js rename to tests/flow/undefined/issue-518.js diff --git a/tests/flow/undefined/jsfmt.spec.js b/tests/flow/undefined/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/undefined/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/undefined/undefined.js b/tests/flow/undefined/undefined.js similarity index 100% rename from tests/undefined/undefined.js rename to tests/flow/undefined/undefined.js diff --git a/tests/undefined/undefined2.js b/tests/flow/undefined/undefined2.js similarity index 100% rename from tests/undefined/undefined2.js rename to tests/flow/undefined/undefined2.js diff --git a/tests/unicode/UnicodeUtils.js b/tests/flow/unicode/UnicodeUtils.js similarity index 100% rename from tests/unicode/UnicodeUtils.js rename to tests/flow/unicode/UnicodeUtils.js diff --git a/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..84fdb1bb --- /dev/null +++ b/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,78 @@ +exports[`test UnicodeUtils.js 1`] = ` +"/** + * @flow + */ + +/** + * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] + * @return {boolean} Whether code-unit is in a surrogate (hi/low) range + */ +function inSurrogateRange(codeUnit) { + return 0xD800 <= codeUnit && codeUnit <= 0xDFFF; +} + + +/** + * Return the length of the original Unicode character at given position in the + * String by looking into the UTF-16 code unit; that is equal to 1 for any + * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and + * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact + * representing non-BMP characters ([U+10000..U+10FFFF]). + * + * Examples: + * - \'\\u0020\' => 1 + * - \'\\u3020\' => 1 + * - \'\\uD835\' => 2 + * - \'\\uD835\\uDDEF\' => 2 + * - \'\\uDDEF\' => 2 + * + * @param {string} str Non-empty string + * @param {number} pos Position in the string to look for one code unit + * @return {number} Number 1 or 2 + */ +function utf16Length(str, pos) { + return 1 + inSurrogateRange(str.charCodeAt(pos)); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/** + * @flow + */ + +/** + * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] + * @return {boolean} Whether code-unit is in a surrogate (hi/low) range + */ +function inSurrogateRange(codeUnit) { + return 0xD800 <= codeUnit && codeUnit <= 0xDFFF; +} + +/** + * Return the length of the original Unicode character at given position in the + * String by looking into the UTF-16 code unit; that is equal to 1 for any + * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and + * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact + * representing non-BMP characters ([U+10000..U+10FFFF]). + * + * Examples: + * - \'\\u0020\' => 1 + * - \'\\u3020\' => 1 + * - \'\\uD835\' => 2 + * - \'\\uD835\\uDDEF\' => 2 + * - \'\\uDDEF\' => 2 + * + * @param {string} str Non-empty string + * @param {number} pos Position in the string to look for one code unit + * @return {number} Number 1 or 2 + */ +function utf16Length(str, pos) { + return 1 + inSurrogateRange(str.charCodeAt(pos)); +} +" +`; + +exports[`test keys.js 1`] = ` +"({\'この事はつもり素晴らしいことさ\': \'35jL9V\'}) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +({ \"この事はつもり素晴らしいことさ\": \"35jL9V\" }); +" +`; diff --git a/tests/flow/unicode/jsfmt.spec.js b/tests/flow/unicode/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/unicode/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/flow/unicode/keys.js b/tests/flow/unicode/keys.js new file mode 100644 index 00000000..173e6c79 --- /dev/null +++ b/tests/flow/unicode/keys.js @@ -0,0 +1 @@ +({'この事はつもり素晴らしいことさ': '35jL9V'}) diff --git a/tests/union-intersection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap similarity index 97% rename from tests/union-intersection/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap index e79fb253..7ad687a5 100644 --- a/tests/union-intersection/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap @@ -5027,41 +5027,6 @@ function f3(x: T3): T3 { return x; } type T4 = (A | C) & (B | C); function f4(x: T4): T4 { return x; } - -type T5 = \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"10\" | \"11\" | \"12\" | \"13\"; - -type T6 = \"a-long-string\" | \"another-long-string\" | \"yet-another-long-string\" | \"one-more-for-good-measure\"; - -type T7 = - { eventName: \"these\", a: number } | - { eventName: \"will\", b: number } | - { eventName: \"not\", c: number } | - { eventName: \"fit\", d: number } | - { eventName: \"on\", e: number } | - { eventName: \"one\", f: number } | - { eventName: \"line\", g: number }; - -type Comment = { - type: \'CommentLine\'; - _CommentLine: void; - value: string; - end: number; - loc: { - end: {column: number, line: number}, - start: {column: number, line: number}, - }; - start: number; -} | { - type: \'CommentBlock\'; - _CommentBlock: void; - value: string; - end: number; - loc: { - end: {column: number, line: number}, - start: {column: number, line: number}, - }; - start: number; -}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type A = { a: number }; type B = { b: number }; @@ -5086,59 +5051,5 @@ type T4 = (A | C) & (B | C); function f4(x: T4): T4 { return x; } - -type T5 = - | \"1\" - | \"2\" - | \"3\" - | \"4\" - | \"5\" - | \"6\" - | \"7\" - | \"8\" - | \"9\" - | \"10\" - | \"11\" - | \"12\" - | \"13\"; - -type T6 = - | \"a-long-string\" - | \"another-long-string\" - | \"yet-another-long-string\" - | \"one-more-for-good-measure\"; - -type T7 = - | { eventName: \"these\", a: number } - | { eventName: \"will\", b: number } - | { eventName: \"not\", c: number } - | { eventName: \"fit\", d: number } - | { eventName: \"on\", e: number } - | { eventName: \"one\", f: number } - | { eventName: \"line\", g: number }; - -type Comment = - | { - type: \"CommentLine\", - _CommentLine: void, - value: string, - end: number, - loc: { - end: { column: number, line: number }, - start: { column: number, line: number } - }, - start: number - } - | { - type: \"CommentBlock\", - _CommentBlock: void, - value: string, - end: number, - loc: { - end: { column: number, line: number }, - start: { column: number, line: number } - }, - start: number - }; " `; diff --git a/tests/union-intersection/gen_big_disjoint_union.js b/tests/flow/union-intersection/gen_big_disjoint_union.js similarity index 100% rename from tests/union-intersection/gen_big_disjoint_union.js rename to tests/flow/union-intersection/gen_big_disjoint_union.js diff --git a/tests/flow/union-intersection/jsfmt.spec.js b/tests/flow/union-intersection/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/union-intersection/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/flow/union-intersection/test.js b/tests/flow/union-intersection/test.js new file mode 100644 index 00000000..83655a3b --- /dev/null +++ b/tests/flow/union-intersection/test.js @@ -0,0 +1,15 @@ +type A = {a: number}; +type B = {b: number}; +type C = {c: number}; + +type T1 = (A | B) & C; +function f1(x: T1): T1 { return x; } + +type T2 = (A & B) | C; +function f2(x: T2): T2 { return x; } + +type T3 = (A & C) | (B & C); +function f3(x: T3): T3 { return x; } + +type T4 = (A | C) & (B | C); +function f4(x: T4): T4 { return x; } diff --git a/tests/union/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/union/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/union/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union/fields.js b/tests/flow/union/fields.js similarity index 100% rename from tests/union/fields.js rename to tests/flow/union/fields.js diff --git a/tests/union/fields2.js b/tests/flow/union/fields2.js similarity index 100% rename from tests/union/fields2.js rename to tests/flow/union/fields2.js diff --git a/tests/union/issue-17.js b/tests/flow/union/issue-17.js similarity index 100% rename from tests/union/issue-17.js rename to tests/flow/union/issue-17.js diff --git a/tests/union/issue-198.js b/tests/flow/union/issue-198.js similarity index 100% rename from tests/union/issue-198.js rename to tests/flow/union/issue-198.js diff --git a/tests/union/issue-256.js b/tests/flow/union/issue-256.js similarity index 100% rename from tests/union/issue-256.js rename to tests/flow/union/issue-256.js diff --git a/tests/union/issue-323-lib.js b/tests/flow/union/issue-323-lib.js similarity index 100% rename from tests/union/issue-323-lib.js rename to tests/flow/union/issue-323-lib.js diff --git a/tests/union/issue-323.js b/tests/flow/union/issue-323.js similarity index 100% rename from tests/union/issue-323.js rename to tests/flow/union/issue-323.js diff --git a/tests/union/issue-324.js b/tests/flow/union/issue-324.js similarity index 100% rename from tests/union/issue-324.js rename to tests/flow/union/issue-324.js diff --git a/tests/union/issue-325.js b/tests/flow/union/issue-325.js similarity index 100% rename from tests/union/issue-325.js rename to tests/flow/union/issue-325.js diff --git a/tests/union/issue-326.js b/tests/flow/union/issue-326.js similarity index 100% rename from tests/union/issue-326.js rename to tests/flow/union/issue-326.js diff --git a/tests/union/issue-582.js b/tests/flow/union/issue-582.js similarity index 100% rename from tests/union/issue-582.js rename to tests/flow/union/issue-582.js diff --git a/tests/union/issue-963.js b/tests/flow/union/issue-963.js similarity index 100% rename from tests/union/issue-963.js rename to tests/flow/union/issue-963.js diff --git a/tests/flow/union/jsfmt.spec.js b/tests/flow/union/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/union/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/union/test-lib.js b/tests/flow/union/test-lib.js similarity index 100% rename from tests/union/test-lib.js rename to tests/flow/union/test-lib.js diff --git a/tests/union/test.js b/tests/flow/union/test.js similarity index 100% rename from tests/union/test.js rename to tests/flow/union/test.js diff --git a/tests/union/type-app.js b/tests/flow/union/type-app.js similarity index 100% rename from tests/union/type-app.js rename to tests/flow/union/type-app.js diff --git a/tests/union/union.js b/tests/flow/union/union.js similarity index 100% rename from tests/union/union.js rename to tests/flow/union/union.js diff --git a/tests/union/yuge.js b/tests/flow/union/yuge.js similarity index 100% rename from tests/union/yuge.js rename to tests/flow/union/yuge.js diff --git a/tests/union_new/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/union_new/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/union_new/issue-1349.js b/tests/flow/union_new/issue-1349.js similarity index 100% rename from tests/union_new/issue-1349.js rename to tests/flow/union_new/issue-1349.js diff --git a/tests/union_new/issue-1371.js b/tests/flow/union_new/issue-1371.js similarity index 100% rename from tests/union_new/issue-1371.js rename to tests/flow/union_new/issue-1371.js diff --git a/tests/union_new/issue-1455-helper.js b/tests/flow/union_new/issue-1455-helper.js similarity index 100% rename from tests/union_new/issue-1455-helper.js rename to tests/flow/union_new/issue-1455-helper.js diff --git a/tests/union_new/issue-1455.js b/tests/flow/union_new/issue-1455.js similarity index 100% rename from tests/union_new/issue-1455.js rename to tests/flow/union_new/issue-1455.js diff --git a/tests/union_new/issue-1462-i.js b/tests/flow/union_new/issue-1462-i.js similarity index 100% rename from tests/union_new/issue-1462-i.js rename to tests/flow/union_new/issue-1462-i.js diff --git a/tests/union_new/issue-1462-ii.js b/tests/flow/union_new/issue-1462-ii.js similarity index 100% rename from tests/union_new/issue-1462-ii.js rename to tests/flow/union_new/issue-1462-ii.js diff --git a/tests/union_new/issue-1664.js b/tests/flow/union_new/issue-1664.js similarity index 100% rename from tests/union_new/issue-1664.js rename to tests/flow/union_new/issue-1664.js diff --git a/tests/union_new/issue-1759.js b/tests/flow/union_new/issue-1759.js similarity index 100% rename from tests/union_new/issue-1759.js rename to tests/flow/union_new/issue-1759.js diff --git a/tests/union_new/issue-2232.js b/tests/flow/union_new/issue-2232.js similarity index 100% rename from tests/union_new/issue-2232.js rename to tests/flow/union_new/issue-2232.js diff --git a/tests/union_new/issue-815.js b/tests/flow/union_new/issue-815.js similarity index 100% rename from tests/union_new/issue-815.js rename to tests/flow/union_new/issue-815.js diff --git a/tests/union_new/issue-824-helper.js b/tests/flow/union_new/issue-824-helper.js similarity index 100% rename from tests/union_new/issue-824-helper.js rename to tests/flow/union_new/issue-824-helper.js diff --git a/tests/union_new/issue-824.js b/tests/flow/union_new/issue-824.js similarity index 100% rename from tests/union_new/issue-824.js rename to tests/flow/union_new/issue-824.js diff --git a/tests/flow/union_new/jsfmt.spec.js b/tests/flow/union_new/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/union_new/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/union_new/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/union_new/lib/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/union_new/lib/jsfmt.spec.js b/tests/flow/union_new/lib/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/union_new/lib/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/union_new/lib/test23_lib.js b/tests/flow/union_new/lib/test23_lib.js similarity index 100% rename from tests/union_new/lib/test23_lib.js rename to tests/flow/union_new/lib/test23_lib.js diff --git a/tests/union_new/lib/test25_lib.js b/tests/flow/union_new/lib/test25_lib.js similarity index 100% rename from tests/union_new/lib/test25_lib.js rename to tests/flow/union_new/lib/test25_lib.js diff --git a/tests/union_new/lib/test32_lib.js b/tests/flow/union_new/lib/test32_lib.js similarity index 100% rename from tests/union_new/lib/test32_lib.js rename to tests/flow/union_new/lib/test32_lib.js diff --git a/tests/union_new/test1.js b/tests/flow/union_new/test1.js similarity index 100% rename from tests/union_new/test1.js rename to tests/flow/union_new/test1.js diff --git a/tests/union_new/test10.js b/tests/flow/union_new/test10.js similarity index 100% rename from tests/union_new/test10.js rename to tests/flow/union_new/test10.js diff --git a/tests/union_new/test11.js b/tests/flow/union_new/test11.js similarity index 100% rename from tests/union_new/test11.js rename to tests/flow/union_new/test11.js diff --git a/tests/union_new/test12.js b/tests/flow/union_new/test12.js similarity index 100% rename from tests/union_new/test12.js rename to tests/flow/union_new/test12.js diff --git a/tests/union_new/test13.js b/tests/flow/union_new/test13.js similarity index 100% rename from tests/union_new/test13.js rename to tests/flow/union_new/test13.js diff --git a/tests/union_new/test14.js b/tests/flow/union_new/test14.js similarity index 100% rename from tests/union_new/test14.js rename to tests/flow/union_new/test14.js diff --git a/tests/union_new/test15.js b/tests/flow/union_new/test15.js similarity index 100% rename from tests/union_new/test15.js rename to tests/flow/union_new/test15.js diff --git a/tests/union_new/test16.js b/tests/flow/union_new/test16.js similarity index 100% rename from tests/union_new/test16.js rename to tests/flow/union_new/test16.js diff --git a/tests/union_new/test17.js b/tests/flow/union_new/test17.js similarity index 100% rename from tests/union_new/test17.js rename to tests/flow/union_new/test17.js diff --git a/tests/union_new/test18.js b/tests/flow/union_new/test18.js similarity index 100% rename from tests/union_new/test18.js rename to tests/flow/union_new/test18.js diff --git a/tests/union_new/test19.js b/tests/flow/union_new/test19.js similarity index 100% rename from tests/union_new/test19.js rename to tests/flow/union_new/test19.js diff --git a/tests/union_new/test2.js b/tests/flow/union_new/test2.js similarity index 100% rename from tests/union_new/test2.js rename to tests/flow/union_new/test2.js diff --git a/tests/union_new/test20.js b/tests/flow/union_new/test20.js similarity index 100% rename from tests/union_new/test20.js rename to tests/flow/union_new/test20.js diff --git a/tests/union_new/test21.js b/tests/flow/union_new/test21.js similarity index 100% rename from tests/union_new/test21.js rename to tests/flow/union_new/test21.js diff --git a/tests/union_new/test22.js b/tests/flow/union_new/test22.js similarity index 100% rename from tests/union_new/test22.js rename to tests/flow/union_new/test22.js diff --git a/tests/union_new/test23.js b/tests/flow/union_new/test23.js similarity index 100% rename from tests/union_new/test23.js rename to tests/flow/union_new/test23.js diff --git a/tests/union_new/test24.js b/tests/flow/union_new/test24.js similarity index 100% rename from tests/union_new/test24.js rename to tests/flow/union_new/test24.js diff --git a/tests/union_new/test25.js b/tests/flow/union_new/test25.js similarity index 100% rename from tests/union_new/test25.js rename to tests/flow/union_new/test25.js diff --git a/tests/union_new/test26.js b/tests/flow/union_new/test26.js similarity index 100% rename from tests/union_new/test26.js rename to tests/flow/union_new/test26.js diff --git a/tests/union_new/test27.js b/tests/flow/union_new/test27.js similarity index 100% rename from tests/union_new/test27.js rename to tests/flow/union_new/test27.js diff --git a/tests/union_new/test29.js b/tests/flow/union_new/test29.js similarity index 100% rename from tests/union_new/test29.js rename to tests/flow/union_new/test29.js diff --git a/tests/union_new/test3.js b/tests/flow/union_new/test3.js similarity index 100% rename from tests/union_new/test3.js rename to tests/flow/union_new/test3.js diff --git a/tests/union_new/test30-helper.js b/tests/flow/union_new/test30-helper.js similarity index 100% rename from tests/union_new/test30-helper.js rename to tests/flow/union_new/test30-helper.js diff --git a/tests/union_new/test30.js b/tests/flow/union_new/test30.js similarity index 100% rename from tests/union_new/test30.js rename to tests/flow/union_new/test30.js diff --git a/tests/union_new/test31.js b/tests/flow/union_new/test31.js similarity index 100% rename from tests/union_new/test31.js rename to tests/flow/union_new/test31.js diff --git a/tests/union_new/test32.js b/tests/flow/union_new/test32.js similarity index 100% rename from tests/union_new/test32.js rename to tests/flow/union_new/test32.js diff --git a/tests/union_new/test4.js b/tests/flow/union_new/test4.js similarity index 100% rename from tests/union_new/test4.js rename to tests/flow/union_new/test4.js diff --git a/tests/union_new/test5.js b/tests/flow/union_new/test5.js similarity index 100% rename from tests/union_new/test5.js rename to tests/flow/union_new/test5.js diff --git a/tests/union_new/test6.js b/tests/flow/union_new/test6.js similarity index 100% rename from tests/union_new/test6.js rename to tests/flow/union_new/test6.js diff --git a/tests/union_new/test7.js b/tests/flow/union_new/test7.js similarity index 100% rename from tests/union_new/test7.js rename to tests/flow/union_new/test7.js diff --git a/tests/union_new/test8.js b/tests/flow/union_new/test8.js similarity index 100% rename from tests/union_new/test8.js rename to tests/flow/union_new/test8.js diff --git a/tests/union_new/test9.js b/tests/flow/union_new/test9.js similarity index 100% rename from tests/union_new/test9.js rename to tests/flow/union_new/test9.js diff --git a/tests/unreachable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/unreachable/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/unreachable/jsfmt.spec.js b/tests/flow/unreachable/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/unreachable/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/unreachable/typecheck.js b/tests/flow/unreachable/typecheck.js similarity index 100% rename from tests/unreachable/typecheck.js rename to tests/flow/unreachable/typecheck.js diff --git a/tests/unreachable/unreachable.js b/tests/flow/unreachable/unreachable.js similarity index 100% rename from tests/unreachable/unreachable.js rename to tests/flow/unreachable/unreachable.js diff --git a/tests/value/__snapshots__/jsfmt.spec.js.snap b/tests/flow/value/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/value/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/value/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/value/jsfmt.spec.js b/tests/flow/value/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/value/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/value/value.js b/tests/flow/value/value.js similarity index 100% rename from tests/value/value.js rename to tests/flow/value/value.js diff --git a/tests/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap b/tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/vim_emacs_errors/jsfmt.spec.js b/tests/flow/vim_emacs_errors/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/vim_emacs_errors/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/vim_emacs_errors/test.js b/tests/flow/vim_emacs_errors/test.js similarity index 100% rename from tests/vim_emacs_errors/test.js rename to tests/flow/vim_emacs_errors/test.js diff --git a/tests/weakmode/__snapshots__/jsfmt.spec.js.snap b/tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/weakmode/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/weakmode/jsfmt.spec.js b/tests/flow/weakmode/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/weakmode/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/weakmode/should_fail_without_weak.js b/tests/flow/weakmode/should_fail_without_weak.js similarity index 100% rename from tests/weakmode/should_fail_without_weak.js rename to tests/flow/weakmode/should_fail_without_weak.js diff --git a/tests/weakmode/should_pass_with_weak.js b/tests/flow/weakmode/should_pass_with_weak.js similarity index 100% rename from tests/weakmode/should_pass_with_weak.js rename to tests/flow/weakmode/should_pass_with_weak.js diff --git a/tests/flow/while/__snapshots__/jsfmt.spec.js.snap b/tests/flow/while/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..c2d26091 --- /dev/null +++ b/tests/flow/while/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,73 @@ +exports[`test abnormal.js 1`] = ` +"/* @flow */ + +function foo(x: boolean) { + var ii = 10; + while (ii-- >= 0) { + if (x) { + continue; + } + return; + } + //console.log(\'this is still reachable\'); +} + +function bar(x: boolean) { + var ii = 0; + while (ii > 0) { + return; + } + //console.log(\'this is still reachable\'); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* @flow */ + +function foo(x: boolean) { + var ii = 10; + while (ii-- >= 0) { + if (x) { + continue; + } + return; + } + //console.log(\'this is still reachable\'); +} + +function bar(x: boolean) { + var ii = 0; + while (ii > 0) { + return; + } + //console.log(\'this is still reachable\'); +} +" +`; + +exports[`test test.js 1`] = ` +"class C { + m() { return new C; } +} +function blah() {} +var node: ?C = new C; +while (node) { + var parent = node.m(); + var cloneable: C = node; + blah(); + node = parent.m(); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class C { + m() { + return new C(); + } +} +function blah() {} +var node: ?C = new C(); +while (node) { + var parent = node.m(); + var cloneable: C = node; + blah(); + node = parent.m(); +} +" +`; diff --git a/tests/while/abnormal.js b/tests/flow/while/abnormal.js similarity index 100% rename from tests/while/abnormal.js rename to tests/flow/while/abnormal.js diff --git a/tests/flow/while/jsfmt.spec.js b/tests/flow/while/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/while/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/while/test.js b/tests/flow/while/test.js similarity index 100% rename from tests/while/test.js rename to tests/flow/while/test.js diff --git a/tests/window/__snapshots__/jsfmt.spec.js.snap b/tests/flow/window/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/window/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/window/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/window/jsfmt.spec.js b/tests/flow/window/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/window/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/window/window1.js b/tests/flow/window/window1.js similarity index 100% rename from tests/window/window1.js rename to tests/flow/window/window1.js diff --git a/tests/window/window2.js b/tests/flow/window/window2.js similarity index 100% rename from tests/window/window2.js rename to tests/flow/window/window2.js diff --git a/tests/x/XControllerURIBuilder.js b/tests/flow/x/XControllerURIBuilder.js similarity index 100% rename from tests/x/XControllerURIBuilder.js rename to tests/flow/x/XControllerURIBuilder.js diff --git a/tests/x/__snapshots__/jsfmt.spec.js.snap b/tests/flow/x/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/x/__snapshots__/jsfmt.spec.js.snap rename to tests/flow/x/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/flow/x/jsfmt.spec.js b/tests/flow/x/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/flow/x/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/for/__snapshots__/jsfmt.spec.js.snap b/tests/for/__snapshots__/jsfmt.spec.js.snap index a8684ed2..7ec23d49 100644 --- a/tests/for/__snapshots__/jsfmt.spec.js.snap +++ b/tests/for/__snapshots__/jsfmt.spec.js.snap @@ -1,286 +1,3 @@ -exports[`test abnormal.js 1`] = ` -"/* @flow */ - -function foo(x: boolean) { - var max = 10; - for (var ii = 0; ii < max; ii++) { - if (x) { - continue; - } - return; - } - console.log(\'this is still reachable\'); -} - -function bar(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - return; - } - console.log(\'this is still reachable\'); -} - -function baz(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - continue; - } - console.log(\'this is still reachable\'); -} - -function bliffl(x: boolean) { - var max = 10; - loop1: for (var ii = 0; ii < max; ii++) { - loop2: for (var jj = 0; jj < max; jj++) { - break loop1; - } - console.log(\'this is still reachable\'); - } - console.log(\'this is still reachable\'); -} - -function corge(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - break; - } - console.log(\'this is still reachable\'); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -function foo(x: boolean) { - var max = 10; - for (var ii = 0; ii < max; ii++) { - if (x) { - continue; - } - return; - } - console.log(\"this is still reachable\"); -} - -function bar(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - return; - } - console.log(\"this is still reachable\"); -} - -function baz(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - continue; - } - console.log(\"this is still reachable\"); -} - -function bliffl(x: boolean) { - var max = 10; - loop1: - for (var ii = 0; ii < max; ii++) { - loop2: - for (var jj = 0; jj < max; jj++) { - break loop1; - } - console.log(\"this is still reachable\"); - } - console.log(\"this is still reachable\"); -} - -function corge(x: boolean) { - var max = 0; - for (var ii = 0; ii < max; ii++) { - break; - } - console.log(\"this is still reachable\"); -} -" -`; - -exports[`test abnormal_for_in.js 1`] = ` -"function foo(x: boolean) { - var obj = { a: 1, b: 2}; - for (var prop in obj) { - if (x) { - continue; - } - return; - } - console.log(\'this is still reachable\'); -} - -function bar(x: boolean) { - for (var prop in {}) { - return; - } - console.log(\'this is still reachable\'); -} - -function baz(x: boolean) { - for (var prop in {}) { - continue; - } - console.log(\'this is still reachable\'); -} - -function bliffl(x: boolean) { - var obj = { a: 1, b: 2}; - loop1: for (var prop1 in obj) { - loop2: for (var prop2 in obj) { - break loop1; - } - console.log(\'this is still reachable\'); - } - console.log(\'this is still reachable\'); -} - -function corge(x: boolean) { - for (var prop in {}) { - break; - } - console.log(\'this is still reachable\'); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function foo(x: boolean) { - var obj = { a: 1, b: 2 }; - for (var prop in obj) { - if (x) { - continue; - } - return; - } - console.log(\"this is still reachable\"); -} - -function bar(x: boolean) { - for (var prop in {}) { - return; - } - console.log(\"this is still reachable\"); -} - -function baz(x: boolean) { - for (var prop in {}) { - continue; - } - console.log(\"this is still reachable\"); -} - -function bliffl(x: boolean) { - var obj = { a: 1, b: 2 }; - loop1: - for (var prop1 in obj) { - loop2: - for (var prop2 in obj) { - break loop1; - } - console.log(\"this is still reachable\"); - } - console.log(\"this is still reachable\"); -} - -function corge(x: boolean) { - for (var prop in {}) { - break; - } - console.log(\"this is still reachable\"); -} -" -`; - -exports[`test abnormal_for_of.js 1`] = ` -"function foo(x: boolean) { - var arr = [1, 2, 3]; - for (var elem of arr) { - if (x) { - continue; - } - return; - } - console.log(\'this is still reachable\'); -} - -function bar(x: boolean) { - for (var elem of []) { - return; - } - console.log(\'this is still reachable\'); -} - -function baz(x: boolean) { - for (var elem of []) { - continue; - } - console.log(\'this is still reachable\'); -} - -function bliffl(x: boolean) { - var arr = [1, 2, 3]; - loop1: for (var elem of arr) { - loop2: for (var elem of arr) { - break loop1; - } - console.log(\'this is still reachable\'); - } - console.log(\'this is still reachable\'); -} - -function corge(x: boolean) { - for (var elem of []) { - break; - } - console.log(\'this is still reachable\'); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function foo(x: boolean) { - var arr = [1, 2, 3]; - for (var elem of arr) { - if (x) { - continue; - } - return; - } - console.log(\"this is still reachable\"); -} - -function bar(x: boolean) { - for (var elem of []) { - return; - } - console.log(\"this is still reachable\"); -} - -function baz(x: boolean) { - for (var elem of []) { - continue; - } - console.log(\"this is still reachable\"); -} - -function bliffl(x: boolean) { - var arr = [1, 2, 3]; - loop1: - for (var elem of arr) { - loop2: - for (var elem of arr) { - break loop1; - } - console.log(\"this is still reachable\"); - } - console.log(\"this is still reachable\"); -} - -function corge(x: boolean) { - for (var elem of []) { - break; - } - console.log(\"this is still reachable\"); -} -" -`; - exports[`test for.js 1`] = ` "for (;;) {} for (var i = 0; i < 10; ++i) {} diff --git a/tests/function/__snapshots__/jsfmt.spec.js.snap b/tests/function/__snapshots__/jsfmt.spec.js.snap index 01585406..e029e509 100644 --- a/tests/function/__snapshots__/jsfmt.spec.js.snap +++ b/tests/function/__snapshots__/jsfmt.spec.js.snap @@ -1,366 +1,3 @@ -exports[`test apply.js 1`] = ` -"function test(a: string, b: number): number { - return this.length; // expect []/\"\" this -} - -// tuples flow correctly into params -test.apply(\"\", [\"\", 0]); - -// wrong this is an error -test.apply(0, [\"\", 0]); // error: lookup \`length\` on Number - -// not enough arguments is an error (via incompatible RestT) -test.apply(\"\", [\"\"]); // error: string ~> number - -// mistyped arguments is an error -test.apply(\"\", [\"\", \"\"]); // error: string ~> number (2nd arg) -test.apply(\"\", [0, 0]); // error: number ~> string (1st arg) - -// resolve args array from tvar -function f(args) { test.apply(\"\", args) } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) -f([0, 0]); // error: number ~> string (1st arg) - -// expect array -test.apply(\"\", \"not array\"); // error: expect array of args - -// expect 4 errors: -// - lookup length on Number (because 0 is used as \`this\`) -// - 123 is not a string -// - \'foo\' is not a number -// - return type (number) is not void -(test.call.apply(test, [0, 123, \'foo\']): void); - -// expect 2 errors: -// - lookup length on number (0 is used as \`this\`) -// - 123 is not a string -(test.bind.apply(test, [0, 123]): (b: number) => number); - -// args are optional -function test2(): number { return 0; } -(test2.apply(): number); -(test2.apply(\"\"): number); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function test(a: string, b: number): number { - return this.length; // expect []/\"\" this -} - -// tuples flow correctly into params -test.apply(\"\", [\"\", 0]); - -// wrong this is an error -test.apply(0, [\"\", 0]); - -// error: lookup \`length\` on Number -// not enough arguments is an error (via incompatible RestT) -test.apply(\"\", [\"\"]); - -// error: string ~> number -// mistyped arguments is an error -test.apply(\"\", [\"\", \"\"]); -// error: string ~> number (2nd arg) -test.apply(\"\", [0, 0]); - -// error: number ~> string (1st arg) -// resolve args array from tvar -function f(args) { - test.apply(\"\", args); -} -f([\"\", 0]); -// OK -f([\"\", \"\"]); -// error: string ~> number (2nd arg) -f([0, 0]); - -// error: number ~> string (1st arg) -// expect array -test.apply(\"\", \"not array\"); - -// error: expect array of args -// expect 4 errors: -// - lookup length on Number (because 0 is used as \`this\`) -// - 123 is not a string -// - \'foo\' is not a number -// - return type (number) is not void -(test.call.apply(test, [0, 123, \"foo\"]): void); - -// expect 2 errors: -// - lookup length on number (0 is used as \`this\`) -// - 123 is not a string -(test.bind.apply(test, [0, 123]): (b: number) => number); - -// args are optional -function test2(): number { - return 0; -} -(test2.apply(): number); -(test2.apply(\"\"): number); -" -`; - -exports[`test bind.js 1`] = ` -"// @flow - -let tests = [ - function(x: (a: string, b: string) => void) { - let y = x.bind(x, \'foo\'); - y(\'bar\'); // ok - y(123); // error, number !~> string - }, -]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -let tests = [ - function(x: (a: string, b: string) => void) { - let y = x.bind(x, \"foo\"); - y(\"bar\"); - // ok - y(123); // error, number !~> string - } -]; -" -`; - -exports[`test call.js 1`] = ` -"// @flow - -function test(a: string, b: number): number { - return this.length; // expect []/\"\" this -} - -// args flow correctly into params -test.call(\"\", \"\", 0); - -// wrong this is an error -test.call(0, \"\", 0); // error: lookup \`length\` on Number - -// not enough arguments is an error (via incompatible RestT) -test.call(\"\", \"\"); // error: string ~> number - -// mistyped arguments is an error -test.call(\"\", \"\", \"\"); // error: string ~> number (2nd arg) -test.call(\"\", 0, 0); // error: number ~> string (1st arg) - -// resolve args array from tvar -function f(args) { test.call(\"\", args[0], args[1]) } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) -f([0, 0]); // error: number ~> string (1st arg) - -// expect 3 errors: -// - lookup length on Number (0 used as \`this\`) -// - number !~> string (param a) -// - string !~> number (param b) -(test.apply.call(test, 0, [0, \'foo\']): number); - -// args are optional -function test2(): number { return 0; } -(test2.call(): number); -(test2.call(\"\"): number); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -function test(a: string, b: number): number { - return this.length; // expect []/\"\" this -} - -// args flow correctly into params -test.call(\"\", \"\", 0); - -// wrong this is an error -test.call(0, \"\", 0); - -// error: lookup \`length\` on Number -// not enough arguments is an error (via incompatible RestT) -test.call(\"\", \"\"); - -// error: string ~> number -// mistyped arguments is an error -test.call(\"\", \"\", \"\"); -// error: string ~> number (2nd arg) -test.call(\"\", 0, 0); - -// error: number ~> string (1st arg) -// resolve args array from tvar -function f(args) { - test.call(\"\", args[0], args[1]); -} -f([\"\", 0]); -// OK -f([\"\", \"\"]); -// error: string ~> number (2nd arg) -f([0, 0]); - -// error: number ~> string (1st arg) -// expect 3 errors: -// - lookup length on Number (0 used as \`this\`) -// - number !~> string (param a) -// - string !~> number (param b) -(test.apply.call(test, 0, [0, \"foo\"]): number); - -// args are optional -function test2(): number { - return 0; -} -(test2.call(): number); -(test2.call(\"\"): number); -" -`; - -exports[`test function.js 1`] = ` -"/** - * @flow - */ - -// Previously we represented Function as (...rest: any) => any -// This means the following wouldn\'t pass, because that arrow function -// can only be called with 3 arguments. -var a: Function = (a, b, c) => 123; - -var b: Function = function(a: number, b: number): number { return a + b; }; - -class C {} - -var c: Function = C; - -function good(x: Function, MyThing: Function): number { - var o: Object = x; // Function is an Object - x.foo = 123; - x[\'foo\'] = 456; - x(); - ; - var {...something} = x; - Object.assign(x, {hi: \'there\'}); - Object.keys(x); - return x.bar + x[\'bar\'] + x.lala(); -} - -function bad(x: Function, y: Object): void { - var a: number = x; // Error - var b: string = x; // Error - var c: Function = y; // Object is not a Function -} - -let tests = [ - function(y: () => void, z: Function) { - function x() {} - (x.length: void); // error, it\'s a number - (y.length: void); // error, it\'s a number - (z.length: void); // error, it\'s a number - - (x.name: void); // error, it\'s a string - (y.name: void); // error, it\'s a string - (z.name: void); // error, it\'s a string - }, - - function(y: () => void, z: Function) { - function x() {} - x.length = \'foo\'; // error, it\'s a number - y.length = \'foo\'; // error, it\'s a number - z.length = \'foo\'; // error, it\'s a number - - x.name = 123; // error, it\'s a string - y.name = 123; // error, it\'s a string - z.name = 123; // error, it\'s a string - - // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` - (z.foo: number); - (z.foo: string); - }, -]; - -// \`Function\` types can be bound (resulting in a \`Function\` type) -var d: Function = () => 1; -var e = (d.bind(1): Function)(); -(e: number); -(e: string); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @flow - */ - -// Previously we represented Function as (...rest: any) => any -// This means the following wouldn\'t pass, because that arrow function -// can only be called with 3 arguments. -var a: Function = (a, b, c) => 123; - -var b: Function = function(a: number, b: number): number { - return a + b; -}; - -class C {} - -var c: Function = C; - -function good(x: Function, MyThing: Function): number { - var o: Object = x; - // Function is an Object - x.foo = 123; - x[\"foo\"] = 456; - x(); - ; - var { ...something } = x; - Object.assign(x, { hi: \"there\" }); - Object.keys(x); - return x.bar + x[\"bar\"] + x.lala(); -} - -function bad(x: Function, y: Object): void { - var a: number = x; - // Error - var b: string = x; - // Error - var c: Function = y; // Object is not a Function -} - -let tests = [ - function(y: () => void, z: Function) { - function x() {} - (x.length: void); - // error, it\'s a number - (y.length: void); - // error, it\'s a number - (z.length: void); - - // error, it\'s a number - (x.name: void); - // error, it\'s a string - (y.name: void); - // error, it\'s a string - (z.name: void); // error, it\'s a string - }, - function(y: () => void, z: Function) { - function x() {} - x.length = \"foo\"; - // error, it\'s a number - y.length = \"foo\"; - // error, it\'s a number - z.length = \"foo\"; - - // error, it\'s a number - x.name = 123; - // error, it\'s a string - y.name = 123; - // error, it\'s a string - z.name = 123; - - // error, it\'s a string - // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` - (z.foo: number); - (z.foo: string); - } -]; - -// \`Function\` types can be bound (resulting in a \`Function\` type) -var d: Function = () => 1; -var e = (d.bind(1): Function)(); -(e: number); -(e: string); -" -`; - exports[`test function_expression.js 1`] = ` "(function() {}).length typeof (function() {}); @@ -381,46 +18,3 @@ new (function() {})(); a = function f() {} || b; " `; - -exports[`test rest.js 1`] = ` -"/* regression tests */ - -function rest_array(...xs: Array): T { - return xs[0]; -} - -// Warn, singleton tuple types don\'t represent rest params -function rest_tuple(...xs: [T]): T { - return xs[0]; -} - -function rest_any(...xs: any): any { - return xs[0]; -} - -// Warn, arbitrary subtypes of an array type don\'t represent rest params -function rest_t>(...xs: T): U { - return xs[0]; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* regression tests */ - -function rest_array(...xs: Array): T { - return xs[0]; -} - -// Warn, singleton tuple types don\'t represent rest params -function rest_tuple(...xs: [T]): T { - return xs[0]; -} - -function rest_any(...xs: any): any { - return xs[0]; -} - -// Warn, arbitrary subtypes of an array type don\'t represent rest params -function rest_t>(...xs: T): U { - return xs[0]; -} -" -`; diff --git a/tests/interface/__snapshots__/jsfmt.spec.js.snap b/tests/interface/__snapshots__/jsfmt.spec.js.snap index 64118cef..a08e29fc 100644 --- a/tests/interface/__snapshots__/jsfmt.spec.js.snap +++ b/tests/interface/__snapshots__/jsfmt.spec.js.snap @@ -1,200 +1,10 @@ -exports[`test import.js 1`] = ` -"interface I { x: number } -export type J = I; // workaround for export interface -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -interface I { x: number } -export type J = I; // workaround for export interface -" -`; - -exports[`test indexer.js 1`] = ` -"// @flow - -interface Ok { - [key: string]: string; -} - -interface Bad { - [k1: string]: string; - [k2: number]: number; // error: not supported (yet) -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -interface Ok { [key: string]: string } - -interface Bad { - [k1: string]: string, - [k2: number]: number /* error: not supported (yet)*/ -} -" -`; - -exports[`test interface.js 1`] = ` -"declare class C { x: number; } - -var x: string = new C().x; - -interface I { x: number; } - -var i = new I(); // error - -function testInterfaceName(o: I) { - (o.name: string); // error, name is static - (o.constructor.name: string); // ok -} - -declare module X { +exports[`test module.js 1`] = ` +"declare module X { declare interface Y { x: number; } -}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare class C { x: number } - -var x: string = new C().x; - -interface I { x: number } - -var i = new I(); - -// error -function testInterfaceName(o: I) { - (o.name: string); - // error, name is static - (o.constructor.name: string); // ok } - +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare module X { declare interface Y { x: number } } " `; - -exports[`test test.js 1`] = ` -"interface I { y: string } -interface I_ { x: number } -interface J extends I, I_ { } -interface K extends J { } - -var k: K = { x: \"\", y: \"\" }; // error: x should be number -(k.x: string); // error: x is number -(k.y: string); - -declare class C { x: number } -declare class D extends C, Other { } // error: multiple extends -//declare class E implements I { } // parse error - -interface A { y: Y } -interface A_ { x: X } -interface B extends A, A_ { z: Z } -interface E extends B { } - -var e: E = { x: \"\", y: \"\", z: \"\" }; // error: x and z should be numbers -(e.x: string); // error: x is number -(e.y: string); -(e.z: string); // error: z is number -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -interface I { y: string } -interface I_ { x: number } -interface J extends I, I_ {} -interface K extends J {} - -var k: K = { x: \"\", y: \"\" }; -// error: x should be number -(k.x: string); -// error: x is number -(k.y: string); - -declare class C { x: number } -declare class D extends C, Other {} -// error: multiple extends -//declare class E implements I { } // parse error -interface A { y: Y } -interface A_ { x: X } -interface B extends A, A_ { z: Z } -interface E extends B {} - -var e: E = { x: \"\", y: \"\", z: \"\" }; -// error: x and z should be numbers -(e.x: string); -// error: x is number -(e.y: string); -(e.z: string); // error: z is number -" -`; - -exports[`test test2.js 1`] = ` -"import type { J } from \'./import\'; -interface K { } -interface L extends J, K { y: string } - -function foo(l: L) { l.x; l.y; l.z; } // error: z not found in L - -// interface + multiple inheritance is similar to object type + intersection -type M = { y: string } & J & { z: boolean } - -function bar(m: M) { m.x; m.y; m.z; } // OK -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import type { J } from \"./import\"; -interface K {} -interface L extends J, K { y: string } - -function foo(l: L) { - l.x; - - l.y; - - l.z; -} - -// error: z not found in L -// interface + multiple inheritance is similar to object type + intersection -type M = { y: string } & J & { z: boolean }; - -function bar(m: M) { - m.x; - m.y; - m.z; -} // OK -" -`; - -exports[`test test3.js 1`] = ` -"interface I { x: number, y : string } -interface J { y : number } -interface K extends I, J { x: string } // error: x is number in I -function foo(k: K) { - (k.x: number); // error: x is string in K - (k.y: number); // error: y is string in I -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -interface I { x: number, y: string } -interface J { y: number } -interface K extends I, J { x: string } -// error: x is number in I -function foo(k: K) { - (k.x: number); - // error: x is string in K - (k.y: number); // error: y is string in I -} -" -`; - -exports[`test test4.js 1`] = ` -"interface I { foo(x: number): void; } -(function foo(x: number) { }: I); // error, property \`foo\` not found function - -declare class C { - bar(i: I): void; - bar(f: (x: number) => void): void; -} - -new C().bar((x: string) => { }); // error, number ~/~> string -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -interface I { foo(x: number): void } -(function foo(x: number) {}: I); - -// error, property \`foo\` not found function -declare class C { bar(i: I): void, bar(f: (x: number) => void): void } - -new C().bar((x: string) => {}); // error, number ~/~> string -" -`; diff --git a/tests/interface/module.js b/tests/interface/module.js new file mode 100644 index 00000000..76e42e9f --- /dev/null +++ b/tests/interface/module.js @@ -0,0 +1,3 @@ +declare module X { + declare interface Y { x: number; } +} diff --git a/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..ec0ade12 --- /dev/null +++ b/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,52 @@ +exports[`test test.js 1`] = ` +"const comp1 = ( +
+ Keep the wrapping parens. +
+); + +const comp2 =
+ Create wrapping parens. +
; + +comp2A =
+ Create wrapping parens. +
; + +const comp3 =
Bump to next line without parens
; + +const comp4 =
Create wrapping parens and indent all the things.
; + +const comp5 =
Keep it on one line.
; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const comp1 = ( +
+ Keep the wrapping parens. +
+); + +const comp2 = ( +
+ Create wrapping parens. +
+); + +comp2A = ( +
+ Create wrapping parens. +
+); + +const comp3 = ( +
Bump to next line without parens
+); + +const comp4 = ( +
+ Create wrapping parens and indent all the things. +
+); + +const comp5 =
Keep it on one line.
; +" +`; diff --git a/tests/jsx-multiline-assign/jsfmt.spec.js b/tests/jsx-multiline-assign/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/jsx-multiline-assign/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/jsx-multiline-assign.js b/tests/jsx-multiline-assign/test.js similarity index 100% rename from tests/prettier/jsx-multiline-assign.js rename to tests/jsx-multiline-assign/test.js diff --git a/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..177f1bf3 --- /dev/null +++ b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,117 @@ +exports[`test test.js 1`] = ` +"after = + + foo bar + + +before = + + bar foo + + +before_break1 = + + foo + + +before_break2 = + + foo + + +after_break = + + foo + + +within = + + foo bar + + +break_components = +
+ + +

foobar bar bar

yep

+
+

nope

+
+ +var x =
+ hello hi sdkflsdfjk +
; + +nest_plz = +
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +after = ( + + foo bar + +); + +before = ( + + bar foo + +); + +before_break1 = ( + + + {\" \"}foo + +); + +before_break2 = ( + + + {\" \"}foo + +); + +after_break = ( + + foo{\" \"} + + +); + +within = ( + + foo bar + +); + +break_components = ( +
+ + +

foobar bar bar

yep

+
+

nope

+
+); + +var x = ( +
+ hello hi sdkflsdfjk +
+); + +nest_plz = ( +
+
+
+
+
+); +" +`; diff --git a/tests/jsx-significant-space/jsfmt.spec.js b/tests/jsx-significant-space/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/jsx-significant-space/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/jsx-significant-space.js b/tests/jsx-significant-space/test.js similarity index 100% rename from tests/prettier/jsx-significant-space.js rename to tests/jsx-significant-space/test.js diff --git a/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..f085eaa3 --- /dev/null +++ b/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,174 @@ +exports[`test test.js 1`] = ` +"long_closed = + + +long_open = + + hello + + +long_open_long_children = + + + Hello world + +
hey hiya how are ya
+
+
+
+
+ d + + + +short_closed = + + +short_open = + + hello + + +make_self_closing = +
+ + + +
+ +leave_opening = + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +long_closed = ( + +); + +long_open = ( + + hello + +); + +long_open_long_children = ( + + + Hello world + +
+
hey hiya how are ya
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + d + + + + + +); + +short_closed = ; + +short_open = ( + + hello + +); + +make_self_closing = ( +
+ + +
+); + +leave_opening = ( + + {\" \"} + +); +" +`; diff --git a/tests/jsx-split-attrs/jsfmt.spec.js b/tests/jsx-split-attrs/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/jsx-split-attrs/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/jsx-split-attrs.js b/tests/jsx-split-attrs/test.js similarity index 100% rename from tests/prettier/jsx-split-attrs.js rename to tests/jsx-split-attrs/test.js diff --git a/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..64b8e80e --- /dev/null +++ b/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,237 @@ +exports[`test test.js 1`] = ` +"const render1 = ({ styles }) => ( +
+ Keep the wrapping parens. Put each key on its own line. +
+); + +const render2 = ({ styles }) =>
+ Create wrapping parens. +
; + +const render3 = ({ styles }) =>
Bump to next line without parens
; + +const render4 = ({ styles }) =>
Create wrapping parens and indent all the things.
; + +const render5 = ({ styles }) =>
Keep it on one line.
; + +const render6 = ({ styles }) => ( +
+
ddd d dd d d dddd dddd hello
+
ddd d dd d d dddd dddd hello
+
+
ddd d dd d d dddd dddd hello
hello
+
+) + +const render7 = () => +
+ Dont break each elem onto its own line. +
+
+ +const render7A = () => ( +
+
+
+) + +const render7B = () => ( +
+ Dont break plz + Dont break plz + Dont break plz +
+) + +const render8 = (props) =>
{props.text}
+const render9 = (props) =>
{props.looooooooooooooooooooooooooooooong_text}
+const render10 = (props) =>
{props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents}
+ +const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd) + +React.render( + + , document.querySelector(\'#react-root\') +) + + +const renderTernary = (props) => + + {props.showTheThing ? + Hello world + : \"hello \" + \"howdy! \"} + {props.showTheThing ? + Hello world + : + null + } + {props.showTheThing ? null : + Hello world + } + {props.showTheOtherThing ?
I am here
:
} + {props.showTheOtherThing ?
I am here!!
: null} + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const render1 = ({ styles }) => ( +
+ Keep the wrapping parens. Put each key on its own line. +
+); + +const render2 = ({ styles }) => ( +
+ Create wrapping parens. +
+); + +const render3 = ({ styles }) => ( +
Bump to next line without parens
+); + +const render4 = ({ styles }) => ( +
+ Create wrapping parens and indent all the things. +
+); + +const render5 = ({ styles }) =>
Keep it on one line.
; + +const render6 = ({ styles }) => ( +
+
+ ddd d dd d d dddd dddd hello +
+
+ ddd d dd d d dddd dddd hello +
+
+
+ ddd d dd d d dddd dddd hello +
+ {\" \"} + hello +
+
+); + +const render7 = () => ( +
+ Dont break each elem onto its own line. +
+
+); + +const render7A = () => ( +
+
+
+); + +const render7B = () => ( +
+ Dont break plz + Dont break plz + Dont break plz +
+); + +const render8 = props =>
{props.text}
; +const render9 = props => ( +
{props.looooooooooooooooooooooooooooooong_text}
+); +const render10 = props => ( +
+ {props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents} +
+); + +const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => + this + .someLongCallWithParams(aaaaaa, bbbbbbb) + .anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd); + +React.render( + , + document.querySelector(\"#react-root\") +); + +const renderTernary = props => ( + + { + props.showTheThing + ? + Hello world + + : \"hello \" + \"howdy! \" + } + { + props.showTheThing + ? + Hello world + + : null + } + { + props.showTheThing + ? null + : + Hello world + + } + {props.showTheOtherThing ?
I am here
:
} + {props.showTheOtherThing ?
I am here!!
: null} + +); +" +`; diff --git a/tests/jsx-stateless-arrow-fn/jsfmt.spec.js b/tests/jsx-stateless-arrow-fn/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/jsx-stateless-arrow-fn/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/jsx-stateless-arrow-fn.js b/tests/jsx-stateless-arrow-fn/test.js similarity index 100% rename from tests/prettier/jsx-stateless-arrow-fn.js rename to tests/jsx-stateless-arrow-fn/test.js diff --git a/tests/line-endings/__snapshots__/jsfmt.spec.js.snap b/tests/line/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/line-endings/__snapshots__/jsfmt.spec.js.snap rename to tests/line/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/line/jsfmt.spec.js b/tests/line/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/line/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/line-endings/windows.js b/tests/line/windows.js similarity index 100% rename from tests/line-endings/windows.js rename to tests/line/windows.js diff --git a/tests/literal/__snapshots__/jsfmt.spec.js.snap b/tests/literal/__snapshots__/jsfmt.spec.js.snap index 1f350b20..9ece4dcf 100644 --- a/tests/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/literal/__snapshots__/jsfmt.spec.js.snap @@ -1,123 +1,9 @@ -exports[`test enum.js 1`] = ` -"var APIKeys = { - AGE: \'age\', - NAME: \'name\', -}; - -module.exports = APIKeys; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var APIKeys = { AGE: \"age\", NAME: \"name\" }; - -module.exports = APIKeys; -" -`; - -exports[`test enum_client.js 1`] = ` -"var APIKeys = require(\'./enum\'); -// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" - -function foo(x: $Keys) { } -foo(\"AGE\"); -foo(\"LOCATION\"); // error - -function bar(x: $Keys<{age: number}>) { } -bar(APIKeys.AGE); // not an error: APIKeys.AGE = \"age\" -bar(APIKeys.NAME); // error: since \"NAME\" is not in the smaller enum - -var object = {}; -object[APIKeys.AGE] = 123; // i.e., object.age = 123 -object[APIKeys.NAME] = \"FOO\"; // i.e., object.name = \"FOO\" - -var age:number = object[APIKeys.AGE]; -var name:number = object[APIKeys.NAME]; // error: object.name is a string - -var indices = { red: 0, green: 1, blue: 2 }; -var tuple = [42, \"hello\", false]; -var red:string = tuple[indices.red]; // error: tuple[0] is a number -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var APIKeys = require(\"./enum\"); -// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" -function foo(x: $Keys) {} -foo(\"AGE\"); -foo(\"LOCATION\"); - -// error -function bar(x: $Keys<{ age: number }>) {} -bar(APIKeys.AGE); -// not an error: APIKeys.AGE = \"age\" -bar(APIKeys.NAME); - -// error: since \"NAME\" is not in the smaller enum -var object = {}; -object[APIKeys.AGE] = 123; -// i.e., object.age = 123 -object[APIKeys.NAME] = \"FOO\"; - -// i.e., object.name = \"FOO\" -var age: number = object[APIKeys.AGE]; -var name: number = object[APIKeys.NAME]; - -// error: object.name is a string -var indices = { red: 0, green: 1, blue: 2 }; -var tuple = [42, \"hello\", false]; -var red: string = tuple[indices.red]; // error: tuple[0] is a number -" -`; - exports[`test number.js 1`] = ` -"function test1(x: number): number { - return -x; -} - -function test2(x: string): number { - return -x; -} - -// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s -// because of the UnaryMinusT\'s, causing nontermination -function test3(x: number, flip_times: number): number { - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} -function test4(flip_times: number): number { - var x = 1; - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} - -// parentheses around numeric literal should be preserved +"// parentheses around numeric literal should be preserved function test5(): string { return (100).toString(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function test1(x: number): number { - return -x; -} - -function test2(x: string): number { - return -x; -} - -// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s -// because of the UnaryMinusT\'s, causing nontermination -function test3(x: number, flip_times: number): number { - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} -function test4(flip_times: number): number { - var x = 1; - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} - // parentheses around numeric literal should be preserved function test5(): string { return (100).toString(); diff --git a/tests/literal/number.js b/tests/literal/number.js index 9765a13e..4184bf11 100644 --- a/tests/literal/number.js +++ b/tests/literal/number.js @@ -1,27 +1,3 @@ -function test1(x: number): number { - return -x; -} - -function test2(x: string): number { - return -x; -} - -// sanity checks to make sure merging envs doesn't keep creating new NumT's -// because of the UnaryMinusT's, causing nontermination -function test3(x: number, flip_times: number): number { - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} -function test4(flip_times: number): number { - var x = 1; - for (var i = 0; i < flip_times; i++) { - x = -x; - } - return x; -} - // parentheses around numeric literal should be preserved function test5(): string { return (100).toString(); diff --git a/tests/method-chain/__snapshots__/jsfmt.spec.js.snap b/tests/method-chain/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..431c7faa --- /dev/null +++ b/tests/method-chain/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,17 @@ +exports[`test test.js 1`] = ` +"method().then(x => x) + [\"abc\"](x => x) + [abc](x => x); + +({}.a().b()); +({}).a().b(); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method() + .then(x => x) + [\"abc\"](x => x) + [abc](x => x); + +({}).a().b(); +({}).a().b(); +" +`; diff --git a/tests/method-chain/jsfmt.spec.js b/tests/method-chain/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/method-chain/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/method-chain.js b/tests/method-chain/test.js similarity index 100% rename from tests/prettier/method-chain.js rename to tests/method-chain/test.js diff --git a/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap b/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..7b6f8904 --- /dev/null +++ b/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,58 @@ +exports[`test test.js 1`] = ` +"const a = classnames({ + \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp +}); + +const b = classnames({ + \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true +}); + +const c = classnames({ + \"some-prop\": [ \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\" ] +}); + +const d = classnames({ + \"some-prop\": () => {} +}); + +const e = classnames({ + \"some-prop\": function bar() {} +}); + +const f = classnames({ + \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } +}); + +const g = classnames({ + \"some-prop\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 +}); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const a = classnames({ + \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp +}); + +const b = classnames({ + \"some-prop\": ( + this.state.longLongLongLongLongLongLongLongLongTooLongProp === true + ) +}); + +const c = classnames({ + \"some-prop\": [\"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\"] +}); + +const d = classnames({ \"some-prop\": () => {} }); + +const e = classnames({ \"some-prop\": function bar() {} }); + +const f = classnames({ + \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } +}); + +const g = classnames({ + \"some-prop\": ( + longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 + ) +}); +" +`; diff --git a/tests/object-prop-break-in/jsfmt.spec.js b/tests/object-prop-break-in/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/object-prop-break-in/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/object-prop-break-in.js b/tests/object-prop-break-in/test.js similarity index 100% rename from tests/prettier/object-prop-break-in.js rename to tests/object-prop-break-in/test.js diff --git a/tests/objects/__snapshots__/jsfmt.spec.js.snap b/tests/objects/__snapshots__/jsfmt.spec.js.snap index 2b8644ba..9cdd3c30 100644 --- a/tests/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/objects/__snapshots__/jsfmt.spec.js.snap @@ -1,48 +1,3 @@ -exports[`test conversion.js 1`] = ` -"/* @flow */ - -(Object({foo: \'bar\'}): {foo: string}); -(Object(\"123\"): String); -(Object(123): Number); -(Object(true): Boolean); -(Object(null): {}); -(Object(undefined): {}); -(Object(void(0)): {}); -(Object(undefined): Number); // error - -var x = Object(null); -x.foo = \"bar\"; - -var y = Object(\"123\"); -(y.charAt(0): string); - -var z = Object(123); // error (next line makes this not match any signatures) -(z.charAt(0): string); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -(Object({ foo: \"bar\" }): { foo: string }); -(Object(\"123\"): String); -(Object(123): Number); -(Object(true): Boolean); -(Object(null): {}); -(Object(undefined): {}); -(Object(void 0): {}); -(Object(undefined): Number); - -// error -var x = Object(null); -x.foo = \"bar\"; - -var y = Object(\"123\"); -(y.charAt(0): string); - -var z = Object(123); -// error (next line makes this not match any signatures) -(z.charAt(0): string); -" -`; - exports[`test expression.js 1`] = ` "() => ({}\`\`); ({})\`\`; @@ -53,114 +8,3 @@ a = () => ({}).x; a = () => ({}).x; " `; - -exports[`test objects.js 1`] = ` -"/* @flow */ - -var x : {\'123\': string, bar: string} = {\'123\': \'val\', bar: \'bar\'}; -(x.foo : string); // error, key doesn\'t exist -(x[\'foo\'] : string); // error, key doesn\'t exist -(x[123] : boolean); // TODO: use the number\'s value to error here -(x.bar: boolean); // error, string !~> boolean -(x[\'123\'] : boolean); // error, string !~> boolean -x[\'123\'] = false; // error, boolean !~> string -x[123] = false; // TODO: use the number\'s value to error here -x[\'foo\'+\'bar\'] = \'derp\'; // ok since we can\'t tell -(x[\`foo\`]: string); // error, key doesn\'t exist - -var y : {foo: string} = {foo: \'bar\'}; -y[\'foo\'] = 123; // error, number !~> string -y[\'bar\'] = \'abc\'; // error, property not found - -(y[\'hasOwnProperty\']: string); // error, prototype method is not a string -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -var x: { \"123\": string, bar: string } = { \"123\": \"val\", bar: \"bar\" }; -(x.foo: string); -// error, key doesn\'t exist -(x[\"foo\"]: string); -// error, key doesn\'t exist -(x[123]: boolean); -// TODO: use the number\'s value to error here -(x.bar: boolean); -// error, string !~> boolean -(x[\"123\"]: boolean); -// error, string !~> boolean -x[\"123\"] = false; -// error, boolean !~> string -x[123] = false; -// TODO: use the number\'s value to error here -x[\"foo\" + \"bar\"] = \"derp\"; -// ok since we can\'t tell -(x[\`foo\`]: string); - -// error, key doesn\'t exist -var y: { foo: string } = { foo: \"bar\" }; -y[\"foo\"] = 123; -// error, number !~> string -y[\"bar\"] = \"abc\"; - -// error, property not found -(y[\"hasOwnProperty\"]: string); // error, prototype method is not a string -" -`; - -exports[`test unaliased_assign.js 1`] = ` -"/** - * test handling of unaliased value assignment. - * - * An unaliased object rvalue may be assigned to a supertype lvalue, - * because later widening mutations on the rvalue can\'t break assumptions - * made by other lvalues. - * - * However, upon assignment the rvalue must take on the type of the - * lvalue, to avoid both false positives and false negatives - * (unsoundness), as shown below. - * - * @flow - */ - -var glob: { x: string } = { x: \"hey\" }; - -function assign_then_alias() { - var obj: { x: string | number }; - obj = { x: \"hey\" }; - glob = obj; // error: subsequent assignment might make glob.x a number -} - -function assign_then_widen() { - var obj: { x: string | number }; - obj = { x: \"hey\" }; - obj.x = 10; // ok, by lvalue\'s given type -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * test handling of unaliased value assignment. - * - * An unaliased object rvalue may be assigned to a supertype lvalue, - * because later widening mutations on the rvalue can\'t break assumptions - * made by other lvalues. - * - * However, upon assignment the rvalue must take on the type of the - * lvalue, to avoid both false positives and false negatives - * (unsoundness), as shown below. - * - * @flow - */ - -var glob: { x: string } = { x: \"hey\" }; - -function assign_then_alias() { - var obj: { x: string | number }; - obj = { x: \"hey\" }; - glob = obj; // error: subsequent assignment might make glob.x a number -} - -function assign_then_widen() { - var obj: { x: string | number }; - obj = { x: \"hey\" }; - obj.x = 10; // ok, by lvalue\'s given type -} -" -`; diff --git a/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap b/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..da002101 --- /dev/null +++ b/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,10 @@ +exports[`test test.js 1`] = ` +"type Foo = (any) => string + +type Bar = { [string]: number } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +type Foo = (any) => string; + +type Bar = { [string]: number }; +" +`; diff --git a/tests/optional-type-name/jsfmt.spec.js b/tests/optional-type-name/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/optional-type-name/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/prettier/optional-type-name.js b/tests/optional-type-name/test.js similarity index 100% rename from tests/prettier/optional-type-name.js rename to tests/optional-type-name/test.js diff --git a/tests/prettier/__snapshots__/jsfmt.spec.js.snap b/tests/prettier/__snapshots__/jsfmt.spec.js.snap deleted file mode 100644 index 27deee96..00000000 --- a/tests/prettier/__snapshots__/jsfmt.spec.js.snap +++ /dev/null @@ -1,761 +0,0 @@ -exports[`test binary-expressions.js 1`] = ` -"// It should always break the highest precedence operators first, and -// break them all at the same time. - -const x = longVariable + longVariable + longVariable; -const x = longVariable + longVariable + longVariable + longVariable - longVariable + longVariable; -const x = longVariable + longVariable * longVariable + longVariable - longVariable + longVariable; -const x = longVariable + longVariable * longVariable * longVariable / longVariable + longVariable; - -const x = longVariable && longVariable && longVariable && longVariable && longVariable && longVariable; -const x = longVariable && longVariable || longVariable && longVariable || longVariable && longVariable; - -const x = longVariable * longint && longVariable >> 0 && longVariable + longVariable; - -const x = longVariable > longint && longVariable === 0 + longVariable * longVariable; - -foo(obj.property * new Class() && obj instanceof Class && longVariable ? number + 5 : false); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// It should always break the highest precedence operators first, and -// break them all at the same time. - -const x = longVariable + longVariable + longVariable; -const x = longVariable + - longVariable + - longVariable + - longVariable - - longVariable + - longVariable; -const x = longVariable + - longVariable * longVariable + - longVariable - - longVariable + - longVariable; -const x = longVariable + - longVariable * longVariable * longVariable / longVariable + - longVariable; - -const x = longVariable && - longVariable && - longVariable && - longVariable && - longVariable && - longVariable; -const x = longVariable && longVariable || - longVariable && longVariable || - longVariable && longVariable; - -const x = longVariable * longint && - longVariable >> 0 && - longVariable + longVariable; - -const x = longVariable > longint && - longVariable === 0 + longVariable * longVariable; - -foo( - obj.property * new Class() && obj instanceof Class && longVariable - ? number + 5 - : false -); -" -`; - -exports[`test directives.js 1`] = ` -"\"use strict\"; - -function fn() { - \"use strict\"; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; - -function fn() { - \"use strict\"; -} -" -`; - -exports[`test exports.js 1`] = ` -"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \"exports\"; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export { - value1, - value2 as value2_renamed, - value3, - value4 as value4_renamed, - value5 -} from \"exports\"; -" -`; - -exports[`test jsx-multiline-assign.js 1`] = ` -"const comp1 = ( -
- Keep the wrapping parens. -
-); - -const comp2 =
- Create wrapping parens. -
; - -comp2A =
- Create wrapping parens. -
; - -const comp3 =
Bump to next line without parens
; - -const comp4 =
Create wrapping parens and indent all the things.
; - -const comp5 =
Keep it on one line.
; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const comp1 = ( -
- Keep the wrapping parens. -
-); - -const comp2 = ( -
- Create wrapping parens. -
-); - -comp2A = ( -
- Create wrapping parens. -
-); - -const comp3 = ( -
Bump to next line without parens
-); - -const comp4 = ( -
- Create wrapping parens and indent all the things. -
-); - -const comp5 =
Keep it on one line.
; -" -`; - -exports[`test jsx-significant-space.js 1`] = ` -"after = - - foo bar - - -before = - - bar foo - - -before_break1 = - - foo - - -before_break2 = - - foo - - -after_break = - - foo - - -within = - - foo bar - - -break_components = -
- - -

foobar bar bar

yep

-
-

nope

-
- -var x =
- hello hi sdkflsdfjk -
; - -nest_plz = -
-
-
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -after = ( - - foo bar - -); - -before = ( - - bar foo - -); - -before_break1 = ( - - - {\" \"}foo - -); - -before_break2 = ( - - - {\" \"}foo - -); - -after_break = ( - - foo{\" \"} - - -); - -within = ( - - foo bar - -); - -break_components = ( -
- - -

foobar bar bar

yep

-
-

nope

-
-); - -var x = ( -
- hello hi sdkflsdfjk -
-); - -nest_plz = ( -
-
-
-
-
-); -" -`; - -exports[`test jsx-split-attrs.js 1`] = ` -"long_closed = - - -long_open = - - hello - - -long_open_long_children = - - - Hello world - -
hey hiya how are ya
-
-
-
-
- d - - - -short_closed = - - -short_open = - - hello - - -make_self_closing = -
- - - -
- -leave_opening = - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -long_closed = ( - -); - -long_open = ( - - hello - -); - -long_open_long_children = ( - - - Hello world - -
-
hey hiya how are ya
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - d - - - - - -); - -short_closed = ; - -short_open = ( - - hello - -); - -make_self_closing = ( -
- - -
-); - -leave_opening = ( - - {\" \"} - -); -" -`; - -exports[`test jsx-stateless-arrow-fn.js 1`] = ` -"const render1 = ({ styles }) => ( -
- Keep the wrapping parens. Put each key on its own line. -
-); - -const render2 = ({ styles }) =>
- Create wrapping parens. -
; - -const render3 = ({ styles }) =>
Bump to next line without parens
; - -const render4 = ({ styles }) =>
Create wrapping parens and indent all the things.
; - -const render5 = ({ styles }) =>
Keep it on one line.
; - -const render6 = ({ styles }) => ( -
-
ddd d dd d d dddd dddd hello
-
ddd d dd d d dddd dddd hello
-
-
ddd d dd d d dddd dddd hello
hello
-
-) - -const render7 = () => -
- Dont break each elem onto its own line. -
-
- -const render7A = () => ( -
-
-
-) - -const render7B = () => ( -
- Dont break plz - Dont break plz - Dont break plz -
-) - -const render8 = (props) =>
{props.text}
-const render9 = (props) =>
{props.looooooooooooooooooooooooooooooong_text}
-const render10 = (props) =>
{props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents}
- -const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd) - -React.render( - - , document.querySelector(\'#react-root\') -) - - -const renderTernary = (props) => - - {props.showTheThing ? - Hello world - : \"hello \" + \"howdy! \"} - {props.showTheThing ? - Hello world - : - null - } - {props.showTheThing ? null : - Hello world - } - {props.showTheOtherThing ?
I am here
:
} - {props.showTheOtherThing ?
I am here!!
: null} - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const render1 = ({ styles }) => ( -
- Keep the wrapping parens. Put each key on its own line. -
-); - -const render2 = ({ styles }) => ( -
- Create wrapping parens. -
-); - -const render3 = ({ styles }) => ( -
Bump to next line without parens
-); - -const render4 = ({ styles }) => ( -
- Create wrapping parens and indent all the things. -
-); - -const render5 = ({ styles }) =>
Keep it on one line.
; - -const render6 = ({ styles }) => ( -
-
- ddd d dd d d dddd dddd hello -
-
- ddd d dd d d dddd dddd hello -
-
-
- ddd d dd d d dddd dddd hello -
- {\" \"} - hello -
-
-); - -const render7 = () => ( -
- Dont break each elem onto its own line. -
-
-); - -const render7A = () => ( -
-
-
-); - -const render7B = () => ( -
- Dont break plz - Dont break plz - Dont break plz -
-); - -const render8 = props =>
{props.text}
; -const render9 = props => ( -
{props.looooooooooooooooooooooooooooooong_text}
-); -const render10 = props => ( -
- {props.even_looooooooooooooooooooooooooooooooooooooooooonger_contents} -
-); - -const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => - this - .someLongCallWithParams(aaaaaa, bbbbbbb) - .anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd); - -React.render( - , - document.querySelector(\"#react-root\") -); - -const renderTernary = props => ( - - { - props.showTheThing - ? - Hello world - - : \"hello \" + \"howdy! \" - } - { - props.showTheThing - ? - Hello world - - : null - } - { - props.showTheThing - ? null - : - Hello world - - } - {props.showTheOtherThing ?
I am here
:
} - {props.showTheOtherThing ?
I am here!!
: null} - -); -" -`; - -exports[`test method-chain.js 1`] = ` -"method().then(x => x) - [\"abc\"](x => x) - [abc](x => x); - -({}.a().b()); -({}).a().b(); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -method() - .then(x => x) - [\"abc\"](x => x) - [abc](x => x); - -({}).a().b(); -({}).a().b(); -" -`; - -exports[`test object-prop-break-in.js 1`] = ` -"const a = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp -}); - -const b = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true -}); - -const c = classnames({ - \"some-prop\": [ \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\" ] -}); - -const d = classnames({ - \"some-prop\": () => {} -}); - -const e = classnames({ - \"some-prop\": function bar() {} -}); - -const f = classnames({ - \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } -}); - -const g = classnames({ - \"some-prop\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 -}); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const a = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp -}); - -const b = classnames({ - \"some-prop\": ( - this.state.longLongLongLongLongLongLongLongLongTooLongProp === true - ) -}); - -const c = classnames({ - \"some-prop\": [\"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\"] -}); - -const d = classnames({ \"some-prop\": () => {} }); - -const e = classnames({ \"some-prop\": function bar() {} }); - -const f = classnames({ - \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } -}); - -const g = classnames({ - \"some-prop\": ( - longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 - ) -}); -" -`; - -exports[`test optional-type-name.js 1`] = ` -"type Foo = (any) => string - -type Bar = { [string]: number } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -type Foo = (any) => string; - -type Bar = { [string]: number }; -" -`; diff --git a/tests/switch/__snapshots__/jsfmt.spec.js.snap b/tests/switch/__snapshots__/jsfmt.spec.js.snap index e8273fdd..9f7dc2a4 100644 --- a/tests/switch/__snapshots__/jsfmt.spec.js.snap +++ b/tests/switch/__snapshots__/jsfmt.spec.js.snap @@ -9,409 +9,3 @@ switch (1) { } " `; - -exports[`test more_switch.js 1`] = ` -"/* @flow */ - -function foo(x): number { - switch (x) { - case 0: - case 1: return 1; - default: throw new Error(\'hi\'); - } -} - -function bar(x) { - switch (x) { - case 0: break; - default: return; - } - 1; -} - -function baz(x): number { - switch (x) { - case 0: break; - case 1: return 1; - default: throw new Error(\'hi\'); - } - return 2; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -function foo(x): number { - switch (x) { - case 0: - case 1: - return 1; - default: - throw new Error(\"hi\"); - } -} - -function bar(x) { - switch (x) { - case 0: - break; - default: - return; - } - 1; -} - -function baz(x): number { - switch (x) { - case 0: - break; - case 1: - return 1; - default: - throw new Error(\"hi\"); - } - return 2; -} -" -`; - -exports[`test switch.js 1`] = ` -"/** - * @flow - */ -function foo( -): number { - switch (\'foo\') { - case \'foo\': - return 1; - } - return 2; -} - -function bar() { - switch (\'bar\') { - case \'bar\': - break; - default: - break; - } -} - -function qux(b) { - var x = b? 0: \"\"; - switch(\'qux\') { - case \'\': - x = 0; - case \'qux\': - x = x*x; - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @flow - */ -function foo(): number { - switch (\"foo\") { - case \"foo\": - return 1; - } - return 2; -} - -function bar() { - switch (\"bar\") { - case \"bar\": - break; - default: - break; - } -} - -function qux(b) { - var x = b ? 0 : \"\"; - switch (\"qux\") { - case \"\": - x = 0; - case \"qux\": - x = x * x; - } -} -" -`; - -exports[`test switch_default_fallthrough.js 1`] = ` -"/** - * @flow - */ -function foo(x : mixed): string { - var a = \"\"; - var b = \"\"; - - switch (x) { - case \"foo\": - a = 0; - default: - b = 0; - } - - // a is now string | number - (a : string); // error, string | number ~/> string - (a : number); // error, string | number ~/> number - - // b is now number - (b : number); // ok - return b; // error, number ~/> string -} - -function baz(x: mixed): number { - var a = \"\"; - var b = \"\"; - - switch (x) { - case \"baz\": - a = 0; - break; - case \"bar\": - a = \"\"; - default: - b = 0; - } - - // a is now string | number - (a : string); // error, string | number ~/> string - (a : number); // error, string | number ~/> number - - // b is now string | number - (b : string); // error, string | number ~/> string - (b : number); // error, string | number ~/> number - - return a+b; // error, string ~/> number -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @flow - */ -function foo(x: mixed): string { - var a = \"\"; - var b = \"\"; - - switch (x) { - case \"foo\": - a = 0; - default: - b = 0; - } - - // a is now string | number - (a: string); - // error, string | number ~/> string - (a: number); - - // error, string | number ~/> number - // b is now number - (b: number); - // ok - return b; // error, number ~/> string -} - -function baz(x: mixed): number { - var a = \"\"; - var b = \"\"; - - switch (x) { - case \"baz\": - a = 0; - break; - case \"bar\": - a = \"\"; - default: - b = 0; - } - - // a is now string | number - (a: string); - // error, string | number ~/> string - (a: number); - - // error, string | number ~/> number - // b is now string | number - (b: string); - // error, string | number ~/> string - (b: number); - - // error, string | number ~/> number - return a + b; // error, string ~/> number -} -" -`; - -exports[`test trailing_cases.js 1`] = ` -"/** - * trailing cases are allowed - spot checks that we handle them as usual - * @flow - */ -function f1(i) { - var x; - - switch (i) { - case 0: - x = 0; - break; - case 1: - x = 1; - break; - default: - x = -1; - break; - case 2: - x = \"2\"; - break; - } - - var y:number = x; // error, number | string ~/> number -} - -function f2(i) { - var x; - - switch (i) { - case 0: - case 1: - default: - x = 1; - break; - case 2: - // does not fall through default - } - - var y:number = x; // error, number | uninitialized ~/> number -} - -function f3(i) { - var x; - - switch (i) { - case 0: - case 1: - default: - // falls through to subsequent cases - case 2: - x = 1; - } - - var y:number = x; // no error -} - -function foo(x): number { - switch (x) { - case 0: - default: throw new Error(\'hi\'); - case 1: return 1; - } -} - -function bar(x) { - switch (x) { - default: return; - case 0: break; - } - 1; -} - -function baz(x): number { - switch (x) { - case 0: break; - default: throw new Error(\'hi\'); - case 1: return 1; - } - return 2; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * trailing cases are allowed - spot checks that we handle them as usual - * @flow - */ -function f1(i) { - var x; - - switch (i) { - case 0: - x = 0; - break; - case 1: - x = 1; - break; - default: - x = -1; - break; - case 2: - x = \"2\"; - break; - } - - var y: number = x; // error, number | string ~/> number -} - -function f2(i) { - var x; - - switch (i) { - case 0: - case 1: - default: - x = 1; - break; - // does not fall through default - case 2: - } - - var y: number = x; // error, number | uninitialized ~/> number -} - -function f3(i) { - var x; - - switch (i) { - case 0: - case 1: - default: - // falls through to subsequent cases - case 2: - x = 1; - } - - var y: number = x; // no error -} - -function foo(x): number { - switch (x) { - case 0: - default: - throw new Error(\"hi\"); - case 1: - return 1; - } -} - -function bar(x) { - switch (x) { - default: - return; - case 0: - break; - } - 1; -} - -function baz(x): number { - switch (x) { - case 0: - break; - default: - throw new Error(\"hi\"); - case 1: - return 1; - } - return 2; -} -" -`; diff --git a/tests/template/__snapshots__/jsfmt.spec.js.snap b/tests/template/__snapshots__/jsfmt.spec.js.snap index a2b6d627..21a51c19 100644 --- a/tests/template/__snapshots__/jsfmt.spec.js.snap +++ b/tests/template/__snapshots__/jsfmt.spec.js.snap @@ -143,83 +143,3 @@ function* f() { } " `; - -exports[`test template.js 1`] = ` -"/* @flow */ - -(\`foo\`: string); // ok -(\`bar\`: \'bar\'); // ok -(\`baz\`: number); // error - -\`foo \${123} bar\`; // ok, number can be appended to string -\`foo \${{bar: 123}} baz\`; // error, object can\'t be appended - -let tests = [ - function(x: string) { - \`foo \${x}\`; // ok - \`\${x} bar\`; // ok - \`foo \${\'bar\'} \${x}\`; // ok - }, - function(x: number) { - \`foo \${x}\`; // ok - \`\${x} bar\`; // ok - \`foo \${\'bar\'} \${x}\`; // ok - }, - function(x: boolean) { - \`foo \${x}\`; // error - \`\${x} bar\`; // error - \`foo \${\'bar\'} \${x}\`; // error - }, - function(x: mixed) { - \`foo \${x}\`; // error - \`\${x} bar\`; // error - \`foo \${\'bar\'} \${x}\`; // error - }, -]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -(\`foo\`: string); -// ok -(\`bar\`: \"bar\"); -// ok -(\`baz\`: number); - -// error -\`foo \${123} bar\`; -// ok, number can be appended to string -\`foo \${{ bar: 123 }} baz\`; - -// error, object can\'t be appended -let tests = [ - function(x: string) { - \`foo \${x}\`; - // ok - \`\${x} bar\`; - // ok - \`foo \${\"bar\"} \${x}\`; // ok - }, - function(x: number) { - \`foo \${x}\`; - // ok - \`\${x} bar\`; - // ok - \`foo \${\"bar\"} \${x}\`; // ok - }, - function(x: boolean) { - \`foo \${x}\`; - // error - \`\${x} bar\`; - // error - \`foo \${\"bar\"} \${x}\`; // error - }, - function(x: mixed) { - \`foo \${x}\`; - // error - \`\${x} bar\`; - // error - \`foo \${\"bar\"} \${x}\`; // error - } -]; -" -`; diff --git a/tests/trailingComma/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/trailingComma/__snapshots__/jsfmt.spec.js.snap rename to tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/trailingComma/function-calls.js b/tests/trailing_comma/function-calls.js similarity index 100% rename from tests/trailingComma/function-calls.js rename to tests/trailing_comma/function-calls.js diff --git a/tests/trailingComma/jsfmt.spec.js b/tests/trailing_comma/jsfmt.spec.js similarity index 100% rename from tests/trailingComma/jsfmt.spec.js rename to tests/trailing_comma/jsfmt.spec.js diff --git a/tests/trailingComma/object.js b/tests/trailing_comma/object.js similarity index 100% rename from tests/trailingComma/object.js rename to tests/trailing_comma/object.js diff --git a/tests/unary/__snapshots__/jsfmt.spec.js.snap b/tests/unary/__snapshots__/jsfmt.spec.js.snap index 6a0b95b9..10e8ed0f 100644 --- a/tests/unary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/unary/__snapshots__/jsfmt.spec.js.snap @@ -36,124 +36,3 @@ x-- - 1; --x - 1; " `; - -exports[`test unary.js 1`] = ` -"/* @flow */ - -function x0(y: string): number { - return +y; // ok, + exists solely for coercion -} - -function x1(y: string): number { - return -y; // error, we don\'t allow coercion here -} - -function x3(y: string) { - return ~y; // error, we don\'t allow coercion here -} - -function x4(y: string): boolean { - return !y; // ok, coercion is allowed -} - -(-1: void); // error, number ~> void -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -function x0(y: string): number { - return +y; // ok, + exists solely for coercion -} - -function x1(y: string): number { - return -y; // error, we don\'t allow coercion here -} - -function x3(y: string) { - return ~y; // error, we don\'t allow coercion here -} - -function x4(y: string): boolean { - return !y; // ok, coercion is allowed -} - -(-1: void); // error, number ~> void -" -`; - -exports[`test update.js 1`] = ` -"// @flow - -let tests = [ - function(y: number) { - y++; - y--; - ++y; - --y; - }, - - function(y: string) { - y++; // error, we don\'t allow coercion here - (y: number); // ok, y is a number now - y++; // error, but you still can\'t write a number to a string - }, - - function(y: string) { - y--; // error, we don\'t allow coercion here - }, - - function(y: string) { - ++y; // error, we don\'t allow coercion here - }, - - function(y: string) { - --y; // error, we don\'t allow coercion here - }, - - function() { - const y = 123; - y++; // error, can\'t update const - y--; // error, can\'t update const - }, - - function(y: any) { - y++; // ok - }, -]; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// @flow - -let tests = [ - function(y: number) { - y++; - y--; - ++y; - --y; - }, - function(y: string) { - y++; - // error, we don\'t allow coercion here - (y: number); - // ok, y is a number now - y++; // error, but you still can\'t write a number to a string - }, - function(y: string) { - y--; // error, we don\'t allow coercion here - }, - function(y: string) { - ++y; // error, we don\'t allow coercion here - }, - function(y: string) { - --y; // error, we don\'t allow coercion here - }, - function() { - const y = 123; - y++; - // error, can\'t update const - y--; // error, can\'t update const - }, - function(y: any) { - y++; // ok - } -]; -" -`; diff --git a/tests/urnary_expression/__snapshots__/jsfmt.spec.js.snap b/tests/unary_expression/__snapshots__/jsfmt.spec.js.snap similarity index 100% rename from tests/urnary_expression/__snapshots__/jsfmt.spec.js.snap rename to tests/unary_expression/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/unary_expression/jsfmt.spec.js b/tests/unary_expression/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/unary_expression/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/urnary_expression/urnary_expression.js b/tests/unary_expression/urnary_expression.js similarity index 100% rename from tests/urnary_expression/urnary_expression.js rename to tests/unary_expression/urnary_expression.js diff --git a/tests/unicode/__snapshots__/jsfmt.spec.js.snap b/tests/unicode/__snapshots__/jsfmt.spec.js.snap index 84fdb1bb..ebc7b603 100644 --- a/tests/unicode/__snapshots__/jsfmt.spec.js.snap +++ b/tests/unicode/__snapshots__/jsfmt.spec.js.snap @@ -1,75 +1,3 @@ -exports[`test UnicodeUtils.js 1`] = ` -"/** - * @flow - */ - -/** - * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] - * @return {boolean} Whether code-unit is in a surrogate (hi/low) range - */ -function inSurrogateRange(codeUnit) { - return 0xD800 <= codeUnit && codeUnit <= 0xDFFF; -} - - -/** - * Return the length of the original Unicode character at given position in the - * String by looking into the UTF-16 code unit; that is equal to 1 for any - * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and - * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact - * representing non-BMP characters ([U+10000..U+10FFFF]). - * - * Examples: - * - \'\\u0020\' => 1 - * - \'\\u3020\' => 1 - * - \'\\uD835\' => 2 - * - \'\\uD835\\uDDEF\' => 2 - * - \'\\uDDEF\' => 2 - * - * @param {string} str Non-empty string - * @param {number} pos Position in the string to look for one code unit - * @return {number} Number 1 or 2 - */ -function utf16Length(str, pos) { - return 1 + inSurrogateRange(str.charCodeAt(pos)); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/** - * @flow - */ - -/** - * @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF] - * @return {boolean} Whether code-unit is in a surrogate (hi/low) range - */ -function inSurrogateRange(codeUnit) { - return 0xD800 <= codeUnit && codeUnit <= 0xDFFF; -} - -/** - * Return the length of the original Unicode character at given position in the - * String by looking into the UTF-16 code unit; that is equal to 1 for any - * non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and - * returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact - * representing non-BMP characters ([U+10000..U+10FFFF]). - * - * Examples: - * - \'\\u0020\' => 1 - * - \'\\u3020\' => 1 - * - \'\\uD835\' => 2 - * - \'\\uD835\\uDDEF\' => 2 - * - \'\\uDDEF\' => 2 - * - * @param {string} str Non-empty string - * @param {number} pos Position in the string to look for one code unit - * @return {number} Number 1 or 2 - */ -function utf16Length(str, pos) { - return 1 + inSurrogateRange(str.charCodeAt(pos)); -} -" -`; - exports[`test keys.js 1`] = ` "({\'この事はつもり素晴らしいことさ\': \'35jL9V\'}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap b/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 00000000..c4508e4f --- /dev/null +++ b/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,91 @@ +exports[`test test.js 1`] = ` +"type T5 = \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"10\" | \"11\" | \"12\" | \"13\"; + +type T6 = \"a-long-string\" | \"another-long-string\" | \"yet-another-long-string\" | \"one-more-for-good-measure\"; + +type T7 = + { eventName: \"these\", a: number } | + { eventName: \"will\", b: number } | + { eventName: \"not\", c: number } | + { eventName: \"fit\", d: number } | + { eventName: \"on\", e: number } | + { eventName: \"one\", f: number } | + { eventName: \"line\", g: number }; + +type Comment = { + type: \'CommentLine\'; + _CommentLine: void; + value: string; + end: number; + loc: { + end: {column: number, line: number}, + start: {column: number, line: number}, + }; + start: number; +} | { + type: \'CommentBlock\'; + _CommentBlock: void; + value: string; + end: number; + loc: { + end: {column: number, line: number}, + start: {column: number, line: number}, + }; + start: number; +}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +type T5 = + | \"1\" + | \"2\" + | \"3\" + | \"4\" + | \"5\" + | \"6\" + | \"7\" + | \"8\" + | \"9\" + | \"10\" + | \"11\" + | \"12\" + | \"13\"; + +type T6 = + | \"a-long-string\" + | \"another-long-string\" + | \"yet-another-long-string\" + | \"one-more-for-good-measure\"; + +type T7 = + | { eventName: \"these\", a: number } + | { eventName: \"will\", b: number } + | { eventName: \"not\", c: number } + | { eventName: \"fit\", d: number } + | { eventName: \"on\", e: number } + | { eventName: \"one\", f: number } + | { eventName: \"line\", g: number }; + +type Comment = + | { + type: \"CommentLine\", + _CommentLine: void, + value: string, + end: number, + loc: { + end: { column: number, line: number }, + start: { column: number, line: number } + }, + start: number + } + | { + type: \"CommentBlock\", + _CommentBlock: void, + value: string, + end: number, + loc: { + end: { column: number, line: number }, + start: { column: number, line: number } + }, + start: number + }; +" +`; diff --git a/tests/union_intersection/jsfmt.spec.js b/tests/union_intersection/jsfmt.spec.js new file mode 100644 index 00000000..989047bc --- /dev/null +++ b/tests/union_intersection/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/union-intersection/test.js b/tests/union_intersection/test.js similarity index 73% rename from tests/union-intersection/test.js rename to tests/union_intersection/test.js index e0430179..7e83fadd 100644 --- a/tests/union-intersection/test.js +++ b/tests/union_intersection/test.js @@ -1,19 +1,3 @@ -type A = {a: number}; -type B = {b: number}; -type C = {c: number}; - -type T1 = (A | B) & C; -function f1(x: T1): T1 { return x; } - -type T2 = (A & B) | C; -function f2(x: T2): T2 { return x; } - -type T3 = (A & C) | (B & C); -function f3(x: T3): T3 { return x; } - -type T4 = (A | C) & (B | C); -function f4(x: T4): T4 { return x; } - type T5 = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13"; type T6 = "a-long-string" | "another-long-string" | "yet-another-long-string" | "one-more-for-good-measure"; diff --git a/tests/while/__snapshots__/jsfmt.spec.js.snap b/tests/while/__snapshots__/jsfmt.spec.js.snap index 7776db15..1a0f7cf8 100644 --- a/tests/while/__snapshots__/jsfmt.spec.js.snap +++ b/tests/while/__snapshots__/jsfmt.spec.js.snap @@ -1,48 +1,3 @@ -exports[`test abnormal.js 1`] = ` -"/* @flow */ - -function foo(x: boolean) { - var ii = 10; - while (ii-- >= 0) { - if (x) { - continue; - } - return; - } - //console.log(\'this is still reachable\'); -} - -function bar(x: boolean) { - var ii = 0; - while (ii > 0) { - return; - } - //console.log(\'this is still reachable\'); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* @flow */ - -function foo(x: boolean) { - var ii = 10; - while (ii-- >= 0) { - if (x) { - continue; - } - return; - } - //console.log(\'this is still reachable\'); -} - -function bar(x: boolean) { - var ii = 0; - while (ii > 0) { - return; - } - //console.log(\'this is still reachable\'); -} -" -`; - exports[`test indent.js 1`] = ` "if (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {} while (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {} @@ -63,32 +18,3 @@ while ( } " `; - -exports[`test test.js 1`] = ` -"class C { - m() { return new C; } -} -function blah() {} -var node: ?C = new C; -while (node) { - var parent = node.m(); - var cloneable: C = node; - blah(); - node = parent.m(); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class C { - m() { - return new C(); - } -} -function blah() {} -var node: ?C = new C(); -while (node) { - var parent = node.m(); - var cloneable: C = node; - blah(); - node = parent.m(); -} -" -`;