Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* No longer install chai.should in setup. * Update integration tests. * Improve readme. * Fix linter errors. * Improve integration test scripts. * Make chai a peerDependency. * Add chai dev dependency.
- Loading branch information
Showing
22 changed files
with
129 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
const chai = require('chai'); | ||
|
||
const BN = web3.utils.BN; | ||
|
||
const should = chai | ||
.use(require('chai-bn')(BN)) | ||
.should(); | ||
chai.use(require('chai-bn')(BN)); | ||
|
||
module.exports = { | ||
BN, | ||
expect: chai.expect, | ||
should, | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require('./setup'); | ||
|
||
const ether = require('./ether'); | ||
const send = require('./send'); | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"truffle": "^5.0.1" | ||
} | ||
} |
This file contains 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
3 changes: 2 additions & 1 deletion
3
test-integration/simple-project-truffle-5.x/test/accounts.test.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
const { balance, BN, ether, send } = require('openzeppelin-test-helpers'); | ||
const { expect } = require('chai'); | ||
|
||
contract('accounts', function (accounts) { | ||
it('sends ether and tracks balances', async function () { | ||
const value = ether('42', 'ether'); | ||
const tracker = await balance.tracker(accounts[0]); | ||
await send.ether(accounts[0], accounts[1], value); | ||
(await tracker.delta()).should.be.bignumber.equals(value.neg()); | ||
expect(await tracker.delta()).to.be.bignumber.equals(value.neg()); | ||
}); | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
const { BN } = require('../../src/setup'); | ||
const { expect } = require('chai'); | ||
const ether = require('../../src/ether'); | ||
|
||
describe('ether', function () { | ||
it('returns a BN', function () { | ||
ether('1').should.be.bignumber.equal(new BN('1000000000000000000')); | ||
expect(ether('1')).to.be.bignumber.equal(new BN('1000000000000000000')); | ||
}); | ||
|
||
it('works with negative amounts', function () { | ||
ether('-1').should.be.bignumber.equal(new BN('-1000000000000000000')); | ||
expect(ether('-1')).to.be.bignumber.equal(new BN('-1000000000000000000')); | ||
}); | ||
}); |
Oops, something went wrong.