Replace chai.should with chai.expect.
See original GitHub issueThroughout the codebase we’re using chai.should
, which patches all objects so that they have the should
property (this is done here).
It’d be great to get rid of that, and switch to expect
, which is not only simpler due to it just requiring to import a function, but also has arguably clearer semantics (and prevents ugly hacks like (await promise()).should.bla.bla.bla
). This conversion should be rather straightforward, with most obj.should.equal
being replaced for expect(obj).to.equal
, though we’d also have to add const { expect } = require('chai')
at the top of the relevant files.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Chai Change - Chai Assertion Library
Chai Change. Build Status. Assert that a change you expected to happen, happened, with this plugin for the chai assertion library.
Read more >chai-changes - Chai Assertion Library
chai -changes is an extension to the chai assertion library that provides a set of change-specific assertions. Assertions. All assertions use a when...
Read more >Assertion Styles - Chai
First of all, notice that the expect require is just a reference to the expect function, whereas with the should require, the function...
Read more >Expect / Should - Chai Assertion Library
The BDD styles are expect and should . ... When one argument is provided, .change asserts that the given function subject returns a...
Read more >Chai Assertions for Promises
Chai as Promised is compatible with all promises following the Promises/A+ specification. Notably, jQuery's promises were not up to spec before jQuery 3.0,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nventuro I updated one of the tests and wanted to see if I was on the right track with what you were thinking. Could you look it over and let me know your thoughts?
https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1723
tagging this - I can work on this next