2

I have unit tests that depend on chai and chai-as-promised (a library that extends Chai so you can easily test promises)

This assertion:

return expect(myPromise).to.eventually.equal(true)

gives me compile error

error TS2300: Duplicate identifier AssertionError

when I have both @types/chai and @types/chai-as-promised installed.

When I uninstall @types/chai-as-promised I get error

error TS2339: Property 'eventually' does not exist on type 'Assertion'.

So obviously types are necessary

What is going wrong here? Is chai-as-promised extending chai poorly? Should I create my own types for it?

mgbennet
  • 622
  • 7
  • 16
Jared
  • 2,978
  • 4
  • 26
  • 45

0 Answers0