diff --git a/src/timer.ts b/src/timer.ts index 7cfc216..4780e46 100644 --- a/src/timer.ts +++ b/src/timer.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-promise-reject-errors */ import {type AnyActorRef} from 'xstate'; import {noop} from './util.js'; diff --git a/test/example-done.spec.ts b/test/example-done.spec.ts index d8a0c69..e39c9d2 100644 --- a/test/example-done.spec.ts +++ b/test/example-done.spec.ts @@ -14,6 +14,7 @@ const promiseLogic = fromPromise( clearTimeout(timeout); // this rejection is eaten by xstate-audition // in lieu of its own timeout error (seen below) + // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors reject(signal.reason); }; diff --git a/test/until-emitted.spec.ts b/test/until-emitted.spec.ts index 66ed351..780d160 100644 --- a/test/until-emitted.spec.ts +++ b/test/until-emitted.spec.ts @@ -57,9 +57,9 @@ describe('xstate-audition', () => { describe('when called with all arguments', () => { it('should return a value with the expected type', async () => { - const value = await runUntilEmitted(actor, EMITTER_MACHINE_TYPES); + const _value = await runUntilEmitted(actor, EMITTER_MACHINE_TYPES); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< ActorEmittedTuple< Actor, typeof EMITTER_MACHINE_TYPES @@ -70,17 +70,17 @@ describe('xstate-audition', () => { describe('when called without arguments', () => { it('should return itself', async () => { - const func = runUntilEmitted(); + const _value = runUntilEmitted(); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); describe('when called with one argument', () => { it('should return a curried function type', async () => { - const func = runUntilEmitted(actor); + const _value = runUntilEmitted(actor); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< CurryEmittedP1 >(); }); @@ -110,9 +110,9 @@ describe('xstate-audition', () => { describe('when called with all arguments', () => { it('should return a value with the expected type', async () => { - const value = await waitForEmitted(actor, EMITTER_MACHINE_TYPES); + const _value = await waitForEmitted(actor, EMITTER_MACHINE_TYPES); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< ActorEmittedTuple< Actor, typeof EMITTER_MACHINE_TYPES @@ -123,17 +123,17 @@ describe('xstate-audition', () => { describe('when called without arguments', () => { it('should return itself', () => { - const func = waitForEmitted(); + const _value = waitForEmitted(); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); describe('when called with one argument', () => { it('should return a curried function type', () => { - const func = waitForEmitted(actor); + const _value = waitForEmitted(actor); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< CurryEmittedP1 >(); }); @@ -173,13 +173,13 @@ describe('xstate-audition', () => { describe('when called with all arguments', () => { it('should return a value with the expected type', async () => { - const value = await runUntilEmittedWith( + const _value = await runUntilEmittedWith( actor, {}, EMITTER_MACHINE_TYPES, ); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< ActorEmittedTuple< Actor, typeof EMITTER_MACHINE_TYPES @@ -190,17 +190,17 @@ describe('xstate-audition', () => { describe('when called without arguments', () => { it('should return itself', async () => { - const func = runUntilEmittedWith(); + const _value = runUntilEmittedWith(); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); describe('when called with one argument', () => { it('should return a curried function type', async () => { - const func = runUntilEmittedWith(actor); + const _value = runUntilEmittedWith(actor); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< CurryEmittedWithP1 >(); }); @@ -208,9 +208,9 @@ describe('xstate-audition', () => { describe('when called with two arguments', () => { it('should return a curried function type', async () => { - const func = runUntilEmittedWith(actor, {}); + const _value = runUntilEmittedWith(actor, {}); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< CurryEmittedWithP2 >(); }); @@ -227,13 +227,13 @@ describe('xstate-audition', () => { it('should return a value with the expected type', async () => { const actor = createActor(emitterMachine); - const value = await waitForEmittedWith( + const _value = await waitForEmittedWith( actor, {}, EMITTER_MACHINE_TYPES, ); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< ActorEmittedTuple< Actor, typeof EMITTER_MACHINE_TYPES diff --git a/test/until-event-received.spec.ts b/test/until-event-received.spec.ts index c1f84d9..b8fbf4d 100644 --- a/test/until-event-received.spec.ts +++ b/test/until-event-received.spec.ts @@ -36,9 +36,9 @@ describe('xstate-audition', () => { actor.send({type: 'PING'}); - const value = await promise; + const _value = await promise; - expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); + expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); }); }); }); diff --git a/test/until-event-sent.spec.ts b/test/until-event-sent.spec.ts index d5c8f42..88e1a2d 100644 --- a/test/until-event-sent.spec.ts +++ b/test/until-event-sent.spec.ts @@ -38,13 +38,13 @@ describe('xstate-audition', () => { ); it('should return a value with the expected type', async () => { - const value = await runUntilEventSent< + const _value = await runUntilEventSent< typeof actor, Actor, ['PING'] >(actor, ['PING']); - expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); + expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); }); }); @@ -65,13 +65,13 @@ describe('xstate-audition', () => { ); it('should return a value with the expected type', async () => { - const value = await waitForEventSent< + const _value = await waitForEventSent< typeof actor, Actor, ['PING'] >(actor, ['PING']); - expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); + expectTypeOf().toEqualTypeOf<[ReceiverMachineEvent]>(); }); }); diff --git a/test/until-snapshot.spec.ts b/test/until-snapshot.spec.ts index d97db7d..40982ae 100644 --- a/test/until-snapshot.spec.ts +++ b/test/until-snapshot.spec.ts @@ -23,12 +23,12 @@ describe('xstate-audition', () => { ); it('should return a value with the expected type', async () => { - const value = await runUntilSnapshot( + const _value = await runUntilSnapshot( createActor(promiseLogic), predicate, ); - expectTypeOf().toEqualTypeOf< + expectTypeOf().toEqualTypeOf< PromiseSnapshot >(); }); diff --git a/test/until-spawn.spec.ts b/test/until-spawn.spec.ts index d35779d..64e2a58 100644 --- a/test/until-spawn.spec.ts +++ b/test/until-spawn.spec.ts @@ -57,9 +57,9 @@ describe('xstate-audition', () => { it('should return a value with the expected type', async () => { actor = createActor(spawnerMachine); - const value = await runUntilSpawn(actor, ACTOR_ID); + const _value = await runUntilSpawn(actor, ACTOR_ID); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); }); @@ -106,9 +106,9 @@ describe('xstate-audition', () => { it('should return a value with the expected type', async () => { actor = createActor(spawnerMachine); - const value = await waitForSpawn(actor, ACTOR_ID); + const _value = await waitForSpawn(actor, ACTOR_ID); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); }); @@ -156,9 +156,9 @@ describe('xstate-audition', () => { it('should return a value with the expected type', async () => { actor = createActor(spawnerMachine); - const value = await runUntilSpawnWith(actor, {}, ACTOR_ID); + const _value = await runUntilSpawnWith(actor, {}, ACTOR_ID); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); it('should timeout if the actor does not complete in time', async () => { @@ -224,9 +224,9 @@ describe('xstate-audition', () => { it('should return a value with the expected type', async () => { actor = createActor(spawnerMachine); - const value = await waitForSpawnWith(actor, {}, ACTOR_ID); + const _value = await waitForSpawnWith(actor, {}, ACTOR_ID); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); it('should timeout if the actor does not complete in time', async () => { diff --git a/test/until-transition.spec.ts b/test/until-transition.spec.ts index 5b6e667..3a7cd62 100644 --- a/test/until-transition.spec.ts +++ b/test/until-transition.spec.ts @@ -37,9 +37,9 @@ describe('xstate-audition', () => { resolver(actor); - const value = await promise; + const _value = await promise; - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); describe('when called with an Actor that immediately throws', () => { @@ -90,9 +90,9 @@ describe('xstate-audition', () => { resolver(actor); - const value = await promise; + const _value = await promise; - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); @@ -108,9 +108,9 @@ describe('xstate-audition', () => { resolver(actor); - const value = await promise; + const _value = await promise; - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); @@ -130,9 +130,9 @@ describe('xstate-audition', () => { resolver(actor); - const value = await promise; + const _value = await promise; - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); }); });