Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
ethereum-waffle
Advanced tools
Sweeter and simpler than truffle. Works with ethers-js. Taste best with chai and ES6.
To start using with npm, type:
npm i ethereum-waffle
or with Yarn:
yarn add ethereum-waffle
import chai from 'chai';
import {createMockProvider, deployContract, getWallets} from 'ethereum-waffle';
import ethers from 'ethers';
import BasicToken from './contracts/BasicToken';
const {expect} = chai;
describe('Example', () => {
let provider;
let token;
let wallet;
beforeEach(async () => {
provider = createMockProvider();
[wallet] = await getWallets(provider);
token = await deployContract(wallet, BasicToken);
});
it('Should be able to test', async () => {
const actualBalance = await token.balanceOf(wallet.address);
expect(actualBalance.eq(0)).to.be.true;
});
});
Run tests:
yarn waffle:test
FAQs
Sweeter, faster and simpler than truffle.
The npm package ethereum-waffle receives a total of 31,725 weekly downloads. As such, ethereum-waffle popularity was classified as popular.
We found that ethereum-waffle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.