This package is used to test general functions in token contract
install it via npm i gluwa-token-testtools
in test file, make sure it has following variables:
- Contract name - to fetch contractFactory by name
- Token name
- Token symbol
- Token decimals
- Mint amount
- Mint function signature
- Initialize function (Contract instance, owner) (OPTIONAL)
- Arrays of errors messages (to override errors msg) (OPTIONAL)
Pass variables to the test function and put it in chai test
describe('Test for ERC20 Functions', TestUtilies.ERC20Test("TestERC20","TokenName", "TOKEN_SYMBOL", MINT_AMOUNT, "faucetMint(address,uint256)"));
OR
describe( 'Test for ERC20 Functions', ERC20Test( testHelper.CONTRACT_NAME, testHelper.TOKEN_NAME, testHelper.TOKEN_SYMBOL, testHelper.TOKEN_DECIMALS, BigInt(testHelper.MINT_AMOUNT), testHelper.methods.MINT, testHelper.initializeContractTesting, testHelper.errors ) );
in test file, make sure it has following variables:
- Contract name - to fetch contractFactory by name
- Mint amount
- Mint function signature
- Initialize function (Contract instance, owner) (OPTIONAL)
- Array of errors messages (to override errors msg) (OPTIONAL)
- Array of tests functions (to override tests functions) (OPTIONAL)
describe( 'Test for Reservable Functions', ReserveTest( testHelper.CONTRACT_NAME, BigInt(testHelper.MINT_AMOUNT), testHelper.methods.MINT, testHelper.initializeContractTesting, testHelper.errors, testHelper.functions ) );