Socket
Socket
Sign inDemoInstall

ethereum-waffle

Package Overview
Dependencies
Maintainers
1
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereum-waffle

Sweeter and simpler than truffle.


Version published
Weekly downloads
39K
decreased by-29.11%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Ethereum Waffle

Sweeter and simpler than truffle. Works with ethers-js. Taste best with chai and ES6.

Philosophy

  • Simpler: Set of helpers rather than framework
  • Sweeter: Easy to customize and extend

Features:

  • Build, deploy link and test solidity based smart contracts
  • No need to run mock rpc server
  • Easily import contracts from other npms
  • Coming soon: Parallel testing

Install:

To start using with npm, type:

npm i ethereum-waffle

or with Yarn:

yarn add ethereum-waffle

Step by step guide

First test

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

Package last updated on 03 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc