Remove Babel (#1074)
* Test helpers no longer rely on Babel. * Behaviours are no longer imported. * Removed Babel dependency. * Fixed linter errors.
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import shouldSupportInterfaces from '../../introspection/SupportsInterface.behavior';
|
||||
import assertRevert from '../../helpers/assertRevert';
|
||||
import decodeLogs from '../../helpers/decodeLogs';
|
||||
import sendTransaction from '../../helpers/sendTransaction';
|
||||
import _ from 'lodash';
|
||||
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
|
||||
const { assertRevert } = require('../../helpers/assertRevert');
|
||||
const { decodeLogs } = require('../../helpers/decodeLogs');
|
||||
const { sendTransaction } = require('../../helpers/sendTransaction');
|
||||
const _ = require('lodash');
|
||||
|
||||
const ERC721Receiver = artifacts.require('ERC721ReceiverMock.sol');
|
||||
const BigNumber = web3.BigNumber;
|
||||
@ -12,7 +12,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
export default function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
const firstTokenId = 1;
|
||||
const secondTokenId = 2;
|
||||
const unknownTokenId = 3;
|
||||
@ -558,4 +558,8 @@ export default function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
'ERC721Exists',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
shouldBehaveLikeERC721BasicToken,
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import shouldBehaveLikeERC721BasicToken from './ERC721BasicToken.behaviour';
|
||||
import shouldMintAndBurnERC721Token from './ERC721MintBurn.behaviour';
|
||||
const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behaviour');
|
||||
const { shouldBehaveLikeMintAndBurnERC721Token } = require('./ERC721MintBurn.behaviour');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
const ERC721BasicToken = artifacts.require('ERC721BasicTokenMock.sol');
|
||||
@ -15,5 +15,5 @@ contract('ERC721BasicToken', function (accounts) {
|
||||
});
|
||||
|
||||
shouldBehaveLikeERC721BasicToken(accounts);
|
||||
shouldMintAndBurnERC721Token(accounts);
|
||||
shouldBehaveLikeMintAndBurnERC721Token(accounts);
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import assertRevert from '../../helpers/assertRevert';
|
||||
const { assertRevert } = require('../../helpers/assertRevert');
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
@ -6,7 +6,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
export default function shouldMintAndBurnERC721Token (accounts) {
|
||||
function shouldBehaveLikeMintAndBurnERC721Token (accounts) {
|
||||
const firstTokenId = 1;
|
||||
const secondTokenId = 2;
|
||||
const unknownTokenId = 3;
|
||||
@ -23,7 +23,7 @@ export default function shouldMintAndBurnERC721Token (accounts) {
|
||||
const to = accounts[1];
|
||||
const tokenId = unknownTokenId;
|
||||
let logs = null;
|
||||
|
||||
|
||||
describe('when successful', function () {
|
||||
beforeEach(async function () {
|
||||
const result = await this.token.mint(to, tokenId);
|
||||
@ -108,4 +108,8 @@ export default function shouldMintAndBurnERC721Token (accounts) {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
shouldBehaveLikeMintAndBurnERC721Token,
|
||||
};
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import assertRevert from '../../helpers/assertRevert';
|
||||
import shouldBehaveLikeERC721BasicToken from './ERC721BasicToken.behaviour';
|
||||
import shouldMintAndBurnERC721Token from './ERC721MintBurn.behaviour';
|
||||
import shouldSupportInterfaces from '../../introspection/SupportsInterface.behavior';
|
||||
import _ from 'lodash';
|
||||
const { assertRevert } = require('../../helpers/assertRevert');
|
||||
const { shouldBehaveLikeERC721BasicToken } = require('./ERC721BasicToken.behaviour');
|
||||
const { shouldBehaveLikeMintAndBurnERC721Token } = require('./ERC721MintBurn.behaviour');
|
||||
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
|
||||
const _ = require('lodash');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
const ERC721Token = artifacts.require('ERC721TokenMock.sol');
|
||||
@ -24,7 +24,7 @@ contract('ERC721Token', function (accounts) {
|
||||
});
|
||||
|
||||
shouldBehaveLikeERC721BasicToken(accounts);
|
||||
shouldMintAndBurnERC721Token(accounts);
|
||||
shouldBehaveLikeMintAndBurnERC721Token(accounts);
|
||||
|
||||
describe('like a full ERC721', function () {
|
||||
beforeEach(async function () {
|
||||
|
||||
Reference in New Issue
Block a user