One sleep to rule them all. Zzz

Summary: Boyscouted some code duplication away.

Reviewed By: jknoxville

Differential Revision: D29731016

fbshipit-source-id: d5f1677a667f032f6e7e031da296be26e1976932
This commit is contained in:
Michel Weststrate
2021-07-16 03:42:14 -07:00
committed by Facebook GitHub Bot
parent d23ccfcd44
commit 57d00e0bab
8 changed files with 7 additions and 31 deletions

View File

@@ -7,13 +7,9 @@
* @format
*/
import {TestUtils} from 'flipper-plugin';
import {TestUtils, sleep} from 'flipper-plugin';
import * as plugin from '..';
async function sleep(ms: number) {
return new Promise<void>((resolve) => setTimeout(() => resolve(), ms));
}
// this testing is inspired by Flipper sample app
test('general plugin logic testing', async () => {
const {instance, onSend, connect, sendEvent} = TestUtils.startPlugin(plugin, {