# OpenZeppelin Test Helpers (OpenZeppelin Solidity version): "web3.currentProvider.sendAsync is not a function"

**URL:** <https://forum.openzeppelin.com/t/openzeppelin-test-helpers-openzeppelin-solidity-version-web3-currentprovider-sendasync-is-not-a-function/4246>\
**Category:** Support\
**Tags:** test-helpers\
**Created:** [October 26, 2020, 4:19am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-helpers-openzeppelin-solidity-version-web3-currentprovider-sendasync-is-not-a-function/4246 "2020-10-26T04:19:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaryab2000](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/zaryab2000/32/3212_2.png) [@zaryab2000](https://forum.openzeppelin.com/u/zaryab2000)\
**Post date:** [October 26, 2020, 4:19am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-helpers-openzeppelin-solidity-version-web3-currentprovider-sendasync-is-not-a-function/4246/1 "2020-10-26T04:19:49Z")

</div>

Hello @abcoathup  
I was trying to use the **increaseTimeto** function of Openzepplin test helpers.  
_I was importing from - **openzeppelin-solidity/test/helpers/increaseTime** _

However I got an error which(_I assume_) is related to web3 breaking changes -

ERROR- “ **web3.currentProvider.sendAsync is not a function** ”

Because of this web3 error I am not being able to proceed with my time tests using Openzepplin.

How to solve this .?

Should I use any other upgraded version?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [October 26, 2020, 8:32am UTC](https://forum.openzeppelin.com/t/openzeppelin-test-helpers-openzeppelin-solidity-version-web3-currentprovider-sendasync-is-not-a-function/4246/2 "2020-10-26T08:32:46Z")

</div>

Hi @zaryab2000,

Welcome to the community forum 👋

Thanks for posting here.

It looks like you are using the test helpers from an older version of OpenZeppelin Contracts

I recommend using the latest version of OpenZeppelin Test Helpers which is a separate package.

```auto
npm install --save-dev @openzeppelin/test-helpers

```

You can then use `time` functionality in your tests. See the documentation for details: [https://docs.openzeppelin.com/test-helpers/0.5/api#time](https://docs.openzeppelin.com/test-helpers/0.5/api#time)

A simple test example (based from the Learn guides: [https://docs.openzeppelin.com/learn/writing-automated-tests#performing-complex-assertions](https://docs.openzeppelin.com/learn/writing-automated-tests#performing-complex-assertions))

```auto
// test/Box.test.js
// Load dependencies
const { expect } = require('chai');

// Import utilities from Test Helpers
const { BN, time } = require('@openzeppelin/test-helpers');

// Load compiled artifacts
const Box = artifacts.require('Box');

// Start test block
contract('Box', function ([owner, other]) {

  // Use large integers ('big numbers')
  const value = new BN('42');

  beforeEach(async function () {
    this.box = await Box.new({ from: owner });
  });

  it('retrieve returns a value previously stored', async function () {
    await this.box.store(value, { from: owner });

    await time.increase(10);

    // Use large integer comparisons
    expect(await this.box.retrieve()).to.be.bignumber.equal(value);
  });
});

```

Testing Box.sol (from the Learn guides)

```auto
// contracts/Box.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

contract Box {
    uint256 private value;

    // Emitted when the stored value changes
    event ValueChanged(uint256 newValue);

    // Stores a new value in the contract
    function store(uint256 newValue) public {
        value = newValue;
        emit ValueChanged(newValue);
    }

    // Reads the last stored value
    function retrieve() public view returns (uint256) {
        return value;
    }
}

```

Running the test:

```auto
$ npx truffle test

Compiling your contracts...
===========================
> Compiling ./contracts/Box.sol
> Compiling ./contracts/Migrations.sol
> Artifacts written to /tmp/test--1751-QgwJ7hZSF9IO
> Compiled successfully using:
   - solc: 0.6.12+commit.27d51765.Emscripten.clang

  Contract: Box
    ✓ retrieve returns a value previously stored (100ms)

  1 passing (182ms)

```
