Sync the Flow tests (#1163)

* Extract custom tests from tests/flow/

Approach:

1. Remove all .js files in tests/flow except .snap.js files.
2. Copy over all .js files from tests/ in the flow repo.
3. Go through the diff looking for deletions.
   - It was easy to see which deletions were due to changes in the tests
     due to updates in the flow repo.
   - For the rest of the deletions, I used `git blame` to verify that
     they had been added by us since the flow tests were copied over.

This makes tests/flow/ simply a copy of the tests from the flow repo,
making it easier to sync with the upstream flow tests in the future.

* Add a script for syncing the flow tests

* Sync the flow tests
This commit is contained in:
Simon Lydell authored and Christopher Chedeau committed 2017-04-08 07:52:38 -07:00
1 parent bfd5fa4515
commit dc93bdc983
238 files changed
+7129 -413

No files matched your search

@@ -0,0 +1,68 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test.js 1`] = `
"type Banana = {
eat: string => boolean,
};
type Hex = {n: 0x01};
type T = { method: (a) => void };
type T = { method(a): void };
declare class X { method(a): void }
declare function f(a): void;
var f: (a) => void;
interface F { m(string): number }
interface F { m: (string) => number }
function f(o: { f: (string) => void }) {}
function f(o: { f(string): void }) {}
type f = (...arg) => void;
type f = (/* comment */ arg) => void;
type f = (arg /* comment */) => void;
type f = (?arg) => void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type Banana = {
eat: string => boolean
};
type Hex = { n: 0x01 };
type T = { method: a => void };
type T = { method(a): void };
declare class X { method(a): void }
declare function f(a): void;
var f: a => void;
interface F { m(string): number }
interface F { m: string => number }
function f(o: { f: string => void }) {}
function f(o: { f(string): void }) {}
type f = (...arg) => void;
type f = /* comment */ arg => void;
type f = arg /* comment */ => void;
type f = ?arg => void;
"
`;
@@ -0,0 +1 @@
run_spec(__dirname);
+31
View File
@@ -0,0 +1,31 @@
type Banana = {
eat: string => boolean,
};
type Hex = {n: 0x01};
type T = { method: (a) => void };
type T = { method(a): void };
declare class X { method(a): void }
declare function f(a): void;
var f: (a) => void;
interface F { m(string): number }
interface F { m: (string) => number }
function f(o: { f: (string) => void }) {}
function f(o: { f(string): void }) {}
type f = (...arg) => void;
type f = (/* comment */ arg) => void;
type f = (arg /* comment */) => void;
type f = (?arg) => void;