Converted some left-over JavaScript file to TypeScript
Summary: Found some errors in a CI failure originating from a JavaScript file. The horror! Reviewed By: jknoxville Differential Revision: D29549998 fbshipit-source-id: 633100ec9a446050bb0c703dcc37e9b132b17198
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9ca8bee208
commit
04ec026034
@@ -7,8 +7,8 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {IdlerImpl, TestIdler} from '../Idler.tsx';
|
||||
import {sleep} from '../promiseTimeout.tsx';
|
||||
import {IdlerImpl, TestIdler} from '../Idler';
|
||||
import {sleep} from '../promiseTimeout';
|
||||
|
||||
test('Idler should interrupt', async () => {
|
||||
const idler = new IdlerImpl();
|
||||
@@ -64,7 +64,7 @@ test('TestIdler can be controlled', async () => {
|
||||
expect(idler.shouldIdle()).toBe(true);
|
||||
|
||||
let threw = false;
|
||||
const p = idler.idle().catch((e) => {
|
||||
const p = idler.idle().catch((e: any) => {
|
||||
threw = true;
|
||||
expect(e).toMatchInlineSnapshot(
|
||||
`[CancelledPromiseError: Idler got killed]`,
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import adbConfig from '../adbConfig.tsx';
|
||||
import adbConfig from '../adbConfig';
|
||||
|
||||
test('get host and port from ADB_SERVER_SOCKET', () => {
|
||||
process.env.ANDROID_ADB_SERVER_PORT = undefined;
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {parseFlipperPorts} from '../environmentVariables.tsx';
|
||||
import {parseFlipperPorts} from '../environmentVariables';
|
||||
|
||||
test('Valid port overrides are parsed correctly', () => {
|
||||
const overrides = parseFlipperPorts('1111,2222');
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import JsonFileStorage from '../jsonFileReduxPersistStorage.tsx';
|
||||
import JsonFileStorage from '../jsonFileReduxPersistStorage';
|
||||
import fs from 'fs';
|
||||
|
||||
const validSerializedData = fs
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {readCurrentRevision} from '../packageMetadata.tsx';
|
||||
import {readCurrentRevision} from '../packageMetadata';
|
||||
|
||||
test('readCurrentRevision does not return something meaningful in dev mode', async () => {
|
||||
const ret = await readCurrentRevision();
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {default as config, resetConfigForTesting} from '../processConfig.tsx';
|
||||
import {default as config, resetConfigForTesting} from '../processConfig';
|
||||
|
||||
afterEach(() => {
|
||||
resetConfigForTesting();
|
||||
@@ -7,12 +7,12 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import promiseTimeout from '../promiseTimeout.tsx';
|
||||
import promiseTimeout from '../promiseTimeout';
|
||||
|
||||
test('test promiseTimeout for timeout to happen', () => {
|
||||
const promise = promiseTimeout(
|
||||
200,
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise<void>((resolve) => {
|
||||
const id = setTimeout(() => {
|
||||
clearTimeout(id);
|
||||
resolve();
|
||||
@@ -27,7 +27,7 @@ test('test promiseTimeout for timeout to happen', () => {
|
||||
test('test promiseTimeout for timeout not to happen', () => {
|
||||
const promise = promiseTimeout(
|
||||
200,
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise<string | void>((resolve) => {
|
||||
const id = setTimeout(() => {
|
||||
clearTimeout(id);
|
||||
resolve();
|
||||
Reference in New Issue
Block a user