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

Resolves Issue #14709 Clarifies date.now() in milliseconds #14747

Merged
merged 6 commits into from Dec 25, 2023
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
2 changes: 1 addition & 1 deletion docs/Configuration.md
Expand Up @@ -662,7 +662,7 @@ type ModernFakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number;
/** Maximum number of recursive timers that will be run. The default is `100_000` timers. */
timerLimit?: number;
Expand Down
2 changes: 1 addition & 1 deletion docs/JestObjectAPI.md
Expand Up @@ -839,7 +839,7 @@ type FakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number | Date;
/**
* The maximum number of recursive timers that will be run when calling `jest.runAllTimers()`.
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/src/Config.ts
Expand Up @@ -58,7 +58,7 @@ export type FakeTimersConfig = {
*/
doNotFake?: Array<FakeableAPI>;
/**
* Sets current system time to be used by fake timers.
* Sets current system time to be used by fake timers, in milliseconds.
*
* @defaultValue
* The default is `Date.now()`.
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.4/Configuration.md
Expand Up @@ -653,7 +653,7 @@ type ModernFakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number;
/** Maximum number of recursive timers that will be run. The default is `100_000` timers. */
timerLimit?: number;
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.4/JestObjectAPI.md
Expand Up @@ -839,7 +839,7 @@ type FakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number | Date;
/**
* The maximum number of recursive timers that will be run when calling `jest.runAllTimers()`.
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.5/Configuration.md
Expand Up @@ -653,7 +653,7 @@ type ModernFakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number;
/** Maximum number of recursive timers that will be run. The default is `100_000` timers. */
timerLimit?: number;
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.5/JestObjectAPI.md
Expand Up @@ -839,7 +839,7 @@ type FakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number | Date;
/**
* The maximum number of recursive timers that will be run when calling `jest.runAllTimers()`.
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.6/Configuration.md
Expand Up @@ -653,7 +653,7 @@ type ModernFakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number;
/** Maximum number of recursive timers that will be run. The default is `100_000` timers. */
timerLimit?: number;
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.6/JestObjectAPI.md
Expand Up @@ -839,7 +839,7 @@ type FakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number | Date;
/**
* The maximum number of recursive timers that will be run when calling `jest.runAllTimers()`.
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.7/Configuration.md
Expand Up @@ -653,7 +653,7 @@ type ModernFakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number;
/** Maximum number of recursive timers that will be run. The default is `100_000` timers. */
timerLimit?: number;
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.7/JestObjectAPI.md
Expand Up @@ -839,7 +839,7 @@ type FakeTimersConfig = {
* The default is `false`.
*/
legacyFakeTimers?: boolean;
/** Sets current system time to be used by fake timers. The default is `Date.now()`. */
/** Sets current system time to be used by fake timers, in milliseconds. The default is `Date.now()`. */
now?: number | Date;
/**
* The maximum number of recursive timers that will be run when calling `jest.runAllTimers()`.
Expand Down