mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Expose types for benchmark options (#52875)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52875 Changelog: [internal] This simplifies typing tests. Reviewed By: christophpurrer Differential Revision: D79086359 fbshipit-source-id: 683a713e0182f18c9b26e515921d17cf7873aa06
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6e4d23ded2
commit
797d14da9e
+5
-3
@@ -18,7 +18,7 @@ import {
|
||||
type TaskResult,
|
||||
} from 'tinybench';
|
||||
|
||||
type SuiteOptions = $ReadOnly<{
|
||||
export type SuiteOptions = $ReadOnly<{
|
||||
minIterations?: number,
|
||||
minDuration?: number,
|
||||
warmup?: boolean,
|
||||
@@ -28,7 +28,9 @@ type SuiteOptions = $ReadOnly<{
|
||||
testOnly?: boolean,
|
||||
}>;
|
||||
|
||||
type TestOptions = $ReadOnly<{
|
||||
export type TestOptions = FnOptions;
|
||||
|
||||
type InternalTestOptions = $ReadOnly<{
|
||||
...FnOptions,
|
||||
only?: boolean,
|
||||
}>;
|
||||
@@ -71,7 +73,7 @@ interface SuiteAPI {
|
||||
interface TestTask {
|
||||
name: string;
|
||||
fn: () => void;
|
||||
options: TestOptions | void;
|
||||
options: InternalTestOptions | void;
|
||||
}
|
||||
|
||||
export function suite(
|
||||
|
||||
+5
@@ -567,6 +567,11 @@ export function enqueueModalSizeUpdate(
|
||||
|
||||
export const unstable_benchmark = Benchmark;
|
||||
|
||||
export type {
|
||||
SuiteOptions as BenchmarkSuiteOptions,
|
||||
TestOptions as BenchmarkTestOptions,
|
||||
} from './Benchmark';
|
||||
|
||||
/**
|
||||
* Quick and dirty polyfills required by tinybench.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user