Skip to content

Commit

Permalink
fix: extract types
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Jul 26, 2024
1 parent 4d2ca3b commit 7c6d987
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/e2e/utils/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ const POLLING_STOPPED = {
};
let polling = POLLING_STOPPED;

const start = (bundleId: string, {onAttachFailed}: {onAttachFailed: () => Promise<void>}) => {
type StartOptions = {
onAttachFailed: () => Promise<void>;
};

const start = (bundleId: string, {onAttachFailed}: StartOptions) => {
// clear our measurements results
measures = [];

Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/utils/withFailTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import CONFIG from '../config';
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- nullish coalescing doesn't achieve the same result in this case
const TIMEOUT = Number(process.env.INTERACTION_TIMEOUT || CONFIG.INTERACTION_TIMEOUT);

const withFailTimeout = (promise: Promise<void>, name: string): {promise: Promise<unknown>; resetTimeout: () => void} => {
type WithFailTimeoutReturn = {
promise: Promise<unknown>;
resetTimeout: () => void;
};

const withFailTimeout = (promise: Promise<void>, name: string): WithFailTimeoutReturn => {
let timeoutId: NodeJS.Timeout;
const resetTimeout = () => {
clearTimeout(timeoutId);
Expand Down

0 comments on commit 7c6d987

Please sign in to comment.