Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Yoga Setiawan d7c222a6a7 Update Broken Link #devcjog25 (#27025)
Summary:
Update broken link  https://github.com/facebook/react-native/blob/master/react-native-cli/CONTRIBUTING.md to https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md
## Changelog
Pull Request resolved: https://github.com/facebook/react-native/pull/27025

Differential Revision: D18173631

Pulled By: cpojer

fbshipit-source-id: c3634c43c4de7e39e56ec31ef17b9f31db517128
2019-10-28 12:11:45 -07:00
Andres Suarez e1cfeaddd4 Move non-license comments out of license header
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: cpojer

Differential Revision: D17749100

fbshipit-source-id: edca9c73a065e9fc311109cd6efeb1f75451a55a
2019-10-15 20:12:12 -07:00
Jan Kassens a494227d6c copy jest flow declaration from www
Summary:
Copies part of the changes to the flow declarations from www to get the stricter
definitions of `it.each`.

Reviewed By: jstejada

Differential Revision: D17857908

fbshipit-source-id: aafc8e3848d6291a9d527e334ab5d54c5ca635fd
2019-10-10 12:07:18 -07:00
Jan Kassens c13e5d0b43 fix jest's test.table flow type
Summary:
The current flow type disallows passing in an `Array<string>` since the current
type signature would allow just to append to the `Array`, `$ReadOnlyArray`
doesn't allow writing.

@public

Reviewed By: jstejada

Differential Revision: D16354977

fbshipit-source-id: a83c1227c1a15225487ac8672818d8b319dce32f
2019-07-18 09:38:47 -07:00
Florian Schoellhammer 2bf8c8bcd6 Unit Test 12 - Fix Storage Mock
Summary:
**Final Goal**
Currently unit test by default unmock everything and dependencies have to be explicitely mocked. The goal is to mock everything by default and whitelist (unmock) explicitely.

**This Diff**
Fixes the typing in the mock and add unit tests

Differential Revision: D16198318

fbshipit-source-id: d2bb71e9c940f4aeb48f8ac92bf3c5444ebc2025
2019-07-12 11:17:53 -07:00
Sam Goldman ab1a42762c Make RelayObservable Source return type disjoint
Summary:
In Flow v0.99 we are changing function type annotations to be strict about their
static properties. This causes a small issue with the union of a Subcription and
`() => mixed` function type, where the latter is now understood to possibly have
an `unsubscribe` property with a mixed type.

This causes the following refinement check, which appears lower in this file, to
cause an error in the next version of Flow:

```
if (cleanup) {
  if (cleanup.unsubscribe) {
    cleanup.unsubscribe(); // <-- error here
  }
  // ...
}
```

In Flow v0.99, because `() => mixed` statics are now checked, Flow sees that
`cleanup.unsubscribe` might be `mixed`, which passes the conditional but could
cause an exception when called.

I also needed to change JestMockFn to have exact statics, because tests
sometimes use a value with that type in place of the cleanup function. That runs
into the `{} <: {+p?: void}` rule, which is an error. `{||} <: {+p?:void}` is
not an error.

Reviewed By: josephsavona

Differential Revision: D15522655

fbshipit-source-id: 2ae3c9016e2b07abaac79827082d2f8743623eb5
2019-05-28 12:13:49 -07:00
Chad Smith e293f8e01f add getEnv to jest's type definition
Reviewed By: AGS-

Differential Revision: D14858004

fbshipit-source-id: 38ef0283f5605f6a13d179d8c68dd26c63adb910
2019-04-09 14:56:01 -07:00
empyrical 2da60a8f45 Prettify remaining unprettified files (#21327)
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
2018-09-25 19:50:08 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Spencer Ahrens 09e6e6c329 Update jest flow type to latest v23
Summary: Copied https://raw.githubusercontent.com/flow-typed/flow-typed/master/definitions/npm/jest_v23.x.x/flow_v0.39.x-/jest_v23.x.x.js

Reviewed By: yungsters

Differential Revision: D9762910

fbshipit-source-id: 626c456ea51ca636194a56f6b0878b66b7fb3842
2018-09-11 11:16:59 -07:00
Wayne Cheng 86f8e9e760 Adding flow strict to as many xplat files as possible
Summary:
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict/'
  cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i '' 's/flow strict-local$/flow strict/'
  until flow; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: yungsters

Differential Revision: D9003523

fbshipit-source-id: d0c9fbfe3c32e65d57819fa040d06cd6ebbd59cc
2018-07-27 12:31:42 -07:00
Tim Yung f8b4850425 Jest: Upgrade Flow Definition in RN + Metro
Reviewed By: sahrens

Differential Revision: D8371076

fbshipit-source-id: 12d03c545ca190a5fda1ff319e5ea906173d2241
2018-06-11 17:49:25 -07:00
Eli White 4aeefa5484 Open source Flow definition for Jest
Reviewed By: sahrens

Differential Revision: D8347198

fbshipit-source-id: 0b6194bfd14bad09db7dcd462f0bf342c9c6fe44
2018-06-10 22:38:39 -07:00