Skip to content

Commit 864c2a2

Browse files
authored
🤖 Merge PR DefinitelyTyped#72652 fix(jasmine): Add Clock.autoTick from jasmine 5.7 by @atscott
1 parent 636f7c1 commit 864c2a2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎types/jasmine/index.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ declare namespace jasmine {
466466
}
467467

468468
interface Clock {
469+
autoTick(): void;
469470
install(): Clock;
470471
uninstall(): void;
471472
/** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */

‎types/jasmine/jasmine-tests.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,14 @@ describe("Manually ticking the Jasmine Clock", () => {
17341734
});
17351735
});
17361736

1737+
describe("Automatically ticking the Jasmine Clock", () => {
1738+
it("ticks automatically", async () => {
1739+
jasmine.clock().install().autoTick();
1740+
await new Promise(resolve => setTimeout(resolve));
1741+
jasmine.clock().uninstall();
1742+
});
1743+
});
1744+
17371745
describe("Asynchronous specs", () => {
17381746
var value: number;
17391747
beforeEach((done: DoneFn) => {

0 commit comments

Comments
 (0)