Commit Graph

3 Commits

Author SHA1 Message Date
Daniel Büchele
500007ccca use perf_hooks
Summary:
We were using `window.performance` to measure performance. This was because the equivalent node.js API `perf_hooks` wasn't available in the electron version we were using back then.
However, `perf_hooks` has landed in electron meanwhile, so I am moving to this API, as it works for the headless version and jest tests, too.

This allows us to delete the babel transform that was used for node-based tests, where the browser API was replaced with the node API

Reviewed By: jknoxville

Differential Revision: D13860133

fbshipit-source-id: cf1395004fac046dd55751ff465af494173b2cbf
2019-01-29 09:32:05 -08:00
John Knox
76d40e7ddf Use node's perf_hooks
Summary:
I tried switching Flipper to use the node.js module: https://nodejs.org/api/perf_hooks.html instead of electrons window.performance. But the module couldn't be found.

So instead, I'm just replacing it in the pure node tests.

This means tests without node can work without issues.

Reviewed By: danielbuechele

Differential Revision: D10302114

fbshipit-source-id: b3b8aa5fb350a8246fcdfc2a80cc72daec2448d7
2018-10-22 09:00:38 -07:00
John Knox
87830ff106 Add transform for stubbing electron
Summary:
The idea behind this is to enable tests running in pure node, without electron, because electron requires display drivers and complicated things.

I've been lazy and only added the bare minimum electron api's for the connection test to pass.
It would be awesome to auto generate it properly.

Reviewed By: danielbuechele

Differential Revision: D10238132

fbshipit-source-id: d4a2da2baf5f8964184b532a581c3a75ee33ef06
2018-10-22 09:00:38 -07:00