@uniflowed/test 0.0.0-alpha.39 → 0.0.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,11 +55,8 @@ import { resetModuleState } from "./modules.js";
55
55
  import { unstubAllEnvs, unstubAllGlobals } from "./namespace.js";
56
56
  // Renamed at the door, for two reasons that agree. It reads as the resets
57
57
  // beside it do — `reset`, `unstubAllEnvs`, `resetModuleState` are all
58
- // verb-first, and so is what this does to the clock. And `useRealTimers` is
59
- // not a React hook: it is uf's own timer control, which happens to be named
60
- // the way every runner names it, and React's tools read a `use` prefix as a
61
- // hook. The name here is simply accurate.
62
- import { useRealTimers as restoreRealClock } from "./timers.js";
58
+ // verb-first, and so is what this does to the clock.
59
+ import { restoreRealClock } from "./timers.js";
63
60
 
64
61
  /**
65
62
  * One piece of process-wide state a file can change, and how to put it back.
@@ -226,8 +226,8 @@ export type Uft = {
226
226
  readonly waitFor: typeof waitFor,
227
227
  readonly waitUntil: typeof waitUntil,
228
228
 
229
- readonly useFakeTimers: typeof timers.useFakeTimers,
230
- readonly useRealTimers: typeof timers.useRealTimers,
229
+ readonly useFakeTimers: typeof timers.installFakeClock,
230
+ readonly useRealTimers: typeof timers.restoreRealClock,
231
231
  readonly isFakeTimers: typeof timers.isFaked,
232
232
  readonly advanceTimersByTime: typeof timers.advanceTimersByTime,
233
233
  readonly advanceTimersByTimeAsync: typeof timers.advanceTimersByTimeAsync,
@@ -273,8 +273,8 @@ export const uft: Uft = Object.freeze({
273
273
 
274
274
  // The clock a test controls. A test about "after five minutes the session
275
275
  // expires" should not take five minutes.
276
- useFakeTimers: timers.useFakeTimers,
277
- useRealTimers: timers.useRealTimers,
276
+ useFakeTimers: timers.installFakeClock,
277
+ useRealTimers: timers.restoreRealClock,
278
278
  isFakeTimers: timers.isFaked,
279
279
  advanceTimersByTime: timers.advanceTimersByTime,
280
280
  advanceTimersByTimeAsync: timers.advanceTimersByTimeAsync,
@@ -82,7 +82,7 @@ function host(): $FlowFixMe {
82
82
  * formats a date sees a plausible one — and `setSystemTime` is how a test that
83
83
  * cares says which.
84
84
  */
85
- export function useFakeTimers(): void {
85
+ export function installFakeClock(): void {
86
86
  if (installed != null) {
87
87
  return;
88
88
  }
@@ -120,7 +120,7 @@ export function useFakeTimers(): void {
120
120
  }
121
121
 
122
122
  /** Put the real scheduling globals back. */
123
- export function useRealTimers(): void {
123
+ export function restoreRealClock(): void {
124
124
  if (installed == null) {
125
125
  return;
126
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniflowed/test",
3
- "version": "0.0.0-alpha.39",
3
+ "version": "0.0.0-alpha.40",
4
4
  "description": "The test API and worker for `uf test`: describe/it, a full matcher set, and the process uf fans test files out to.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "!*.test.js"
31
31
  ],
32
32
  "dependencies": {
33
- "@uniflowed/host": "0.0.0-alpha.39"
33
+ "@uniflowed/host": "0.0.0-alpha.40"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "axe-core": ">=4"