Effect CommunityEC
Effect Community9mo ago
1 reply
Industrial

Mocking a Service in a test

Hi.

https://gist.github.com/Industrial/1f03b4182ab52304a5851251e2039bf2

What I'm trying to do is mock a service that's used in another service.

On line 36 I get this error:
Argument of type 'Effect<number, ExchangeLoadMarketsError | ExchangeFetchTickerError | ExchangeGetLastPriceError | ExchangeGetMarketError | ExchangeGetPrecisionAmountError | PositionCalculatorRoundAmountError, ExchangeService>' is not assignable to parameter of type 'Effect<number, ExchangeLoadMarketsError | ExchangeFetchTickerError | ExchangeGetLastPriceError | ExchangeGetMarketError | ExchangeGetPrecisionAmountError | PositionCalculatorRoundAmountError, never>'.
  Type 'ExchangeService' is not assignable to type 'never'.ts(2345)


I'm not sure why it's expecting a never there. Does that mean that the dependency on ExchangeService hasn't been resolved yet at that point?
Gist
GitHub Gist: instantly share code, notes, and snippets.
foo.ts
Was this page helpful?