Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add missing options for timers on config.ts file #10632

Merged
merged 3 commits into from Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@
### Fixes

- `[jest-runtime]` `require.main` is no longer `undefined` when using `jest.resetModules` ([#10626](https://github.com/facebook/jest/pull/10626))
- `[@jest/types]` Add missing values for `timers` ([#10632](https://github.com/facebook/jest/pull/10632))

### Chore & Maintenance

Expand Down
8 changes: 5 additions & 3 deletions packages/jest-types/src/Config.ts
Expand Up @@ -11,6 +11,8 @@ import type {ForegroundColor} from 'chalk';

type CoverageProvider = 'babel' | 'v8';

type Timers = 'real' | 'fake' | 'modern' | 'legacy';

export type Path = string;

export type Glob = string;
Expand Down Expand Up @@ -92,7 +94,7 @@ export type DefaultOptions = {
testRunner: string;
testSequencer: string;
testURL: string;
timers: 'real' | 'fake';
timers: Timers;
transformIgnorePatterns: Array<Glob>;
useStderr: boolean;
watch: boolean;
Expand Down Expand Up @@ -206,7 +208,7 @@ export type InitialOptions = Partial<{
testSequencer: string;
testURL: string;
testTimeout: number;
timers: 'real' | 'fake';
timers: Timers;
transform: {
[regex: string]: Path | TransformerConfig;
};
Expand Down Expand Up @@ -362,7 +364,7 @@ export type ProjectConfig = {
testRegex: Array<string | RegExp>;
testRunner: string;
testURL: string;
timers: 'real' | 'fake' | 'modern' | 'legacy';
timers: Timers;
transform: Array<[string, Path, Record<string, unknown>]>;
transformIgnorePatterns: Array<Glob>;
watchPathIgnorePatterns: Array<string>;
Expand Down