Created
April 14, 2020 09:27
-
-
Save eps1lon/d000759a68b0c24a0312743937b06773 to your computer and use it in GitHub Desktop.
chai jest-like expect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import chai from 'chai'; | |
chai.use((chaiAPI, utils) => { | |
chai.Assertion.addMethod('toHaveLength', function toHaveLength(length) { | |
new chai.Assertion(this._obj).to.have.length(length); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment