Commit Graph

6 Commits

Author SHA1 Message Date
Michel Weststrate
74004b6338 Improve unit test robustness
Summary: When running tests locally, some are quite flaky, and there is a lot of error logging noise. This diff doesn't remove all of it, but does reduce it significantly.

Reviewed By: nikoant

Differential Revision: D20034619

fbshipit-source-id: 183f74475b644f803b2f92b1b1301f4d0f6e193a
2020-02-25 14:59:48 -08:00
John Knox
498fa2dc85 Fix missing errors from test output
Summary:
We were losing the first argument of every console.error call during tests.
This happens to be useful stuff, like react telling you how to do better testing etc, and explains the weird looking error output from the ConfigField tests.

Reviewed By: passy

Differential Revision: D17931532

fbshipit-source-id: cfeb834a4646ef68ac55f81a269bcfef7a25ea31
2019-10-16 01:11:56 -07:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Pascal Hartig
e831743132 Harden lint rules
Summary: Taking another stab at adding some lint rules to make it harder to shoot yourself in the foot. Hopefully nothing too controversial. Preferring spread and rest should lead is more readable and there's no downside when using ES6. The "useless" rules are just things like renaming imports to the original name which should only happen during refactors.

Reviewed By: jknoxville

Differential Revision: D16180453

fbshipit-source-id: 1cf6851b7726c0aee953ec7cf7dd6fa0aca32253
2019-07-10 12:06:39 -07:00
Pascal Hartig
08e74e617b Polyfill fetch() for tests
Summary: Per title. Required as Scribe is now being used for device tests.

Reviewed By: jknoxville, danielbuechele

Differential Revision: D13971892

fbshipit-source-id: 2df36d44d4e45a579cc9cca0d4cad9105ba8a383
2019-02-06 16:33:24 -08:00
Pascal Hartig
719dd65340 Warn when console.error is used in tests
Summary:
It's a bit hacky but apparently the recommended solution:
https://stackoverflow.com/questions/28615293/is-there-a-jest-config-that-will-fail-tests-on-console-warn

This will bail when a call to `console.error` is used in a test.
If you *need to* use console.error in a test, then mock it.

This will likely not pass yet, but let's fix all failures and then land it.

Reviewed By: danielbuechele

Differential Revision: D13898383

fbshipit-source-id: 0ca222a07433a9a311dc6bdf0d264342a59208be
2019-02-06 08:51:47 -08:00