You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, love this library, much better and safer than chai.
I'm migrating some test done with mocha, chai and typescript, and just a silly request could you export expect as an alias of the function must?
See if you want to use expect on typescript this is what you need to do:
importmustfrom'must';constexpect=must;
If you try to do this:
import{mustasexpect}from'must';
Typescript parser understands that you want to export the must property on the Object returned by require which is an instance of Must according to must.d.ts, in particular this:
interfaceObject{must: Must;}
Other option would be to change expect to must in my tests, but it looks weird:
awaitmust(testee.load()).must.reject.to.error(Error,'message');// must must === very must?
Hmm, I've not used Typescript myself, but that sure sounds weird. Doesn't it have a way rename the default export just like with plain CommonJS you can do var expect = require("must")?
I definitely want you to be able to rename the default export to expect if you prefer that over the prototype-extension approach.
Hi, love this library, much better and safer than chai.
I'm migrating some test done with mocha, chai and typescript, and just a silly request could you export expect as an alias of the function must?
See if you want to use expect on typescript this is what you need to do:
If you try to do this:
Typescript parser understands that you want to export the must property on the Object returned by require which is an instance of Must according to must.d.ts, in particular this:
Other option would be to change expect to must in my tests, but it looks weird:
I know this intended to be used this way:
But don't feel safe using this notation to be honest.
Cheers!
The text was updated successfully, but these errors were encountered: