chaijs / chai-spies

Spies for Chai Assertion Library.
MIT License
132 stars 29 forks source link

Module '"chai-spies"' has no exported member 'spies'. #110

Closed JimLynchCodes closed 4 years ago

JimLynchCodes commented 4 years ago

When I enter this code in TypeScript it does not compile:

import { expect } from 'chai';
import { spies } from 'chai-spies';
chai.use(spies);

Error:Module '"chai-spies"' has no exported member 'spies'.

You should probably have a guide for TypeScript in the README.

Thanks! Jim

keithamus commented 4 years ago

Thanks for the issue @JimLynchCodes!

Right now you have to use the default export syntax; like so:

import { expect } from 'chai';
import spies from 'chai-spies';
chai.use(spies);

Then to use it you call chai.spy....

If you'd like to raise a PR to clarify the docs, we'd be super happy to review+merge it!

JimLynchCodes commented 4 years ago

Thanks @keithamus, you are a legend. 🙏

I have opened a PR here: https://github.com/chaijs/chai-spies/pull/111

❤️

keithamus commented 4 years ago

Thanks for raising a PR @JimLynchCodes! You're the legend here :)