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
With proper transpiling, this should already work:
import{expect}from'chai'
Edit: I should add that the purpose of the issue you linked is that, unlike expect, should requires modifications to Object.prototype, which are performed by calling should() after importing it. Therefore, the import chai/should form was added as a shortcut to condense the two steps of importing should + running should() into one step.
@llfm see my comment here for a complete list of available syntaxes (as of the upcoming 4.0.0 release):
// Plugin-lessimport{expect}from'chai'import{assert}from'chai'import'chai/should'// if you need should.exist/should.fail etc:importshouldfrom'chai/should'// With pluginsimportchaifrom'chai';importsomePluginfrom'some-plugin';constexpect=chai.use(somePlugin).expectimportchaifrom'chai';importsomePluginfrom'some-plugin';constassert=chai.use(somePlugin).assertimportchaifrom'chai';importsomePluginfrom'some-plugin';constshould=chai.use(somePlugin).should()
Could
expect
have the same behavior ofshould
here?The possibility to use:
import { expect } from 'chai'
import expect from 'chai/expect'
The text was updated successfully, but these errors were encountered: