# gluwa-token-testtools

> This package is used to test general functions in token contract

Latest version **1.1.2** (published 2022-09-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install gluwa-token-testtools
pnpm add gluwa-token-testtools
yarn add gluwa-token-testtools
bun add gluwa-token-testtools
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-09-28 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 81.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ray.gluwa |

## Links

- npm: https://www.npmjs.com/package/gluwa-token-testtools
- Repository: https://github.com/gluwa/Gluwa-Token-TestTools
- Homepage: https://github.com/gluwa/Gluwa-Token-TestTools#readme
- Issues: https://github.com/gluwa/Gluwa-Token-TestTools/issues
- npm.io page: https://npm.io/package/gluwa-token-testtools

## Dependencies (18)

- [chai](https://npm.io/package/chai.md) ^4.3.6
- [web3](https://npm.io/package/web3.md) ^1.7.1
- [mocha](https://npm.io/package/mocha.md) ^9.2.2
- [chance](https://npm.io/package/chance.md) ^1.1.8
- [ethers](https://npm.io/package/ethers.md) ^5.6.9
- [hardhat](https://npm.io/package/hardhat.md) ^2.10.0
- [chai-bignumber](https://npm.io/package/chai-bignumber.md) ^3.0.0
- [ethereum-waffle](https://npm.io/package/ethereum-waffle.md) ^3.4.4
- [solidity-coverage](https://npm.io/package/solidity-coverage.md) ^0.7.21
- [hardhat-awesome-cli](https://npm.io/package/hardhat-awesome-cli.md) ^0.0.15
- [hardhat-gas-reporter](https://npm.io/package/hardhat-gas-reporter.md) ^1.0.8
- [@nomiclabs/hardhat-web3](https://npm.io/package/@nomiclabs/hardhat-web3.md) ^2.0.0
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) ^4.7.0
- [@nomiclabs/hardhat-ethers](https://npm.io/package/@nomiclabs/hardhat-ethers.md) ^2.0.6
- [@nomiclabs/hardhat-waffle](https://npm.io/package/@nomiclabs/hardhat-waffle.md) ^2.0.3
- [@nomiclabs/hardhat-etherscan](https://npm.io/package/@nomiclabs/hardhat-etherscan.md) ^3.1.0
- [@openzeppelin/hardhat-upgrades](https://npm.io/package/@openzeppelin/hardhat-upgrades.md) ^1.19.0
- [@openzeppelin/contracts-upgradeable](https://npm.io/package/@openzeppelin/contracts-upgradeable.md) ^4.7.0

## Recent versions

- 1.1.2 (latest) — 2022-09-28
- 1.1.1 — 2022-09-20
- 1.1.0 — 2022-09-13
- 1.0.8 — 2022-07-20
- 1.0.7 — 2022-07-20
- 1.0.6 — 2022-07-18
- 1.0.5 — 2022-07-18
- 1.0.4 — 2022-07-14
- 1.0.3 — 2022-07-14
- 1.0.2 — 2022-07-14
- 1.0.1 — 2022-07-14
- 1.0.0 — 2022-07-14

## README

# Gluwa-Token-TestTools
This package is used to test general functions in token contract

install it via npm i gluwa-token-testtools

## ERC20 Tests
in test file, make sure it has following variables:
1. Contract name - to fetch contractFactory by name
2. Token name
3. Token symbol
4. Token decimals
5. Mint amount
6. Mint function signature
7. Initialize function (Contract instance, owner) (OPTIONAL)
8. 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
    )
);
``

## Reserve Tests
in test file, make sure it has following variables:
1. Contract name - to fetch contractFactory by name
2. Mint amount
3. Mint function signature
4. Initialize function (Contract instance, owner) (OPTIONAL)
5. Array of errors messages (to override errors msg) (OPTIONAL)
6. 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
    )
);
``

---
_Source: https://npm.io/package/gluwa-token-testtools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
