question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace chai.should with chai.expect.

See original GitHub issue

Throughout 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cksheicommented, Apr 22, 2019

@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

1reaction
cksheicommented, Apr 12, 2019

tagging this - I can work on this next

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found