Skip to content

Commit

Permalink
test: add typed EventEmitter, remove legacy events
Browse files Browse the repository at this point in the history
  • Loading branch information
weyoss committed Nov 26, 2023
1 parent 65d57c3 commit 4ba6ec8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/ticker/test00001.test.ts
Expand Up @@ -7,7 +7,6 @@
* in the root directory of this source tree.
*/

import { events } from '../../src/events/events';
import { delay } from 'bluebird';
import { Ticker } from '../../src/ticker/ticker';

Expand All @@ -18,7 +17,7 @@ describe('Ticker', () => {
ticker.nextTick();

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));

await delay(2000);
expect(down).toBe(0);
Expand All @@ -30,7 +29,7 @@ describe('Ticker', () => {
const ticker = new Ticker(() => (changedFromTicker += 1), 0);

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));
ticker.quit();

await delay(1000);
Expand All @@ -44,7 +43,7 @@ describe('Ticker', () => {
ticker.nextTick();

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));
ticker.quit();

await delay(1000);
Expand All @@ -58,7 +57,7 @@ describe('Ticker', () => {
ticker.nextTick();

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));
ticker.quit();

await delay(5000);
Expand All @@ -72,7 +71,7 @@ describe('Ticker', () => {
ticker.runTimer();

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));
ticker.quit();

await delay(1000);
Expand All @@ -86,7 +85,7 @@ describe('Ticker', () => {
ticker.runTimer();

let down = 0;
ticker.once(events.DOWN, () => (down += 1));
ticker.once('down', () => (down += 1));
ticker.quit();

await delay(5000);
Expand Down

0 comments on commit 4ba6ec8

Please sign in to comment.