mirror of
https://github.com/appium/appium.git
synced 2026-02-16 06:50:20 -06:00
- `@appium/test-support` now exports the e2e setup for plugins, and e2e/unit suites for drivers from base-driver. it also generates declarations. - `appium` exports this as `appium/test`. - The `capability.spec.js` unit test for basedriver now avoids spying on the "global" logger, due to test flake. It now spies directly on the function which calls the global logger. (@mykola_mokhnach) - removed homebrew ansi-stripping code from `test-support` and replaced with `@colors/colors` - type fixes and refactors for `@appium/test-support` - type fixes for `appium` - simplify `lib/index.js` of `@appium/base-driver`
25 lines
453 B
JavaScript
25 lines
453 B
JavaScript
/** @deprecated */
|
|
function fakeTime(sandbox) {
|
|
let clock = sandbox.useFakeTimers();
|
|
return new TimeLord(clock);
|
|
}
|
|
|
|
class TimeLord {
|
|
constructor(clock) {
|
|
this.clock = clock;
|
|
}
|
|
|
|
speedup(interval, times) {
|
|
let tick = (n) => {
|
|
if (n === 0) return; // eslint-disable-line curly
|
|
process.nextTick(() => {
|
|
this.clock.tick(interval);
|
|
n--;
|
|
tick(n);
|
|
});
|
|
};
|
|
tick(times);
|
|
}
|
|
}
|
|
export {fakeTime};
|