Skip to content

Commit

Permalink
move tests to "classic-only"
Browse files Browse the repository at this point in the history
Summary:
These tests only make sense in classic mode, so I'm moving them to
folders with the prefix `classic_only_`. When classic mode is not supported
anymore these tests will be deleted.

Reviewed By: jbrown215

Differential Revision: D25601278

fbshipit-source-id: cface29b9c7bb55c4b88f600b1ff1e6cca6b018d
  • Loading branch information
panagosg7 authored and facebook-github-bot committed Dec 17, 2020
1 parent 28f5aa8 commit 8efa4d5
Show file tree
Hide file tree
Showing 28 changed files with 41 additions and 47 deletions.
1 change: 0 additions & 1 deletion tests/autofix_insert_type/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[lints]

[options]
types_first=false
no_flowlib=false

[strict]
42 changes: 0 additions & 42 deletions tests/autofix_insert_type/autofix_insert_type.exp
Original file line number Diff line number Diff line change
Expand Up @@ -103,30 +103,6 @@ class A {
function foo(x: (() => A)) {}
foo(new A().m);
No errors!
class-poly-0.js 5 10
// @flow

class D<T> {}
class C<T> extends D<T> {
m(x: T): T {
//$FlowFixMe[escaped-generic]
return x;
}
}

module.exports = C;
No errors!
comments-0.js 4 33
// @flow

// BEFORE FUNCTION
export function test (x: number): string {
// ONE
const a = 4 + x; // END OF a = 4...
// TWO
return /* BETWEEEN */ `${a}` // END OF return ...
} // END
No errors!
dictionary.js 12 12
// @flow

Expand Down Expand Up @@ -383,24 +359,6 @@ replacement-dictionary.js 3 3 --strategy=generalize
ab: null, 'a b': null, 'a"b': null, '1': null, '"': null, ' ': null, '_': null, '': null,
get 'x'() {return null;}, set 'y'(z: string) {} } );
No errors!
replacement-function.js 7 47
// @flow

// Spaced out comments /* non-comments

// BEFORE FUNCTION
export //too many comments
function /*Random*/ test /*weird*/ (x: number): string /*Comments*/ {
// ONE
/* Two */ const a = 4 + x; // END OF a = 4...



// Three

return /* BETWEEEN */ `${a}` // END OF return ...
} // END */
No errors!
replacement-object.js 2 16
// @flow
var obj = {n(y): string {return this.m(y);},m(x) {return "";}}
Expand Down
3 changes: 0 additions & 3 deletions tests/autofix_insert_type/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ do_file "class-0.js" 4 3 4 4
do_file "class-1.js" 5 6
do_file "class-2.js" 4 6
do_file "class-3.js" 9 15
do_file "class-poly-0.js" 5 10
do_file "comments-0.js" 4 33
do_file "dictionary.js" 12 12
do_file "func-0.js" 3 26
do_file "func-1.js" 3 18
Expand All @@ -57,7 +55,6 @@ do_file "replacement-array.js" 5 15 --strategy=generalize
do_file "replacement-arrow.js" 3 13
do_file "replacement-class.js" 5 7
do_file "replacement-dictionary.js" 3 3 --strategy=generalize
do_file "replacement-function.js" 7 47
do_file "replacement-object.js" 2 16

do_file "func-0.js" 4 14 4 15
Expand Down
13 changes: 13 additions & 0 deletions tests/classic_only_autofix_insert_type/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ignore]

[include]

[libs]

[lints]

[options]
no_flowlib=false
types_first=false

[strict]
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Found 0 errors
File renamed without changes.
27 changes: 27 additions & 0 deletions tests/classic_only_autofix_insert_type/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

## Correct tests

TEMP_DIR=tmp
mkdir $TEMP_DIR

do_file() {
FILE="$1"; shift;
echo "$FILE" "$@"
cp "$FILE" "$TEMP_DIR/$FILE"
assert_ok "$FLOW" autofix insert-type --strip-root --quiet --in-place --path="$TEMP_DIR/out.js" \
"$TEMP_DIR/$FILE" "$@"
cat "$TEMP_DIR/out.js"
rm "$TEMP_DIR/$FILE"
assert_ok "$FLOW" force-recheck "$TEMP_DIR/out.js"
assert_ok "$FLOW" status
rm "$TEMP_DIR/out.js"
}

do_file "class-poly-0.js" 4 33
do_file "comments-0.js" 4 33
do_file "replacement-function.js" 7 47
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[options]
types_first=false
all=true

File renamed without changes.
File renamed without changes.

0 comments on commit 8efa4d5

Please sign in to comment.