# Recommended Test Setup with OZ SDK

**URL:** https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790
**Category:** General
**Created:** [November 20, 2019, 8:53am UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790 "2019-11-20T08:53:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gitpusha](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/gitpusha/32/1480_2.png) [@gitpusha](https://forum.openzeppelin.com/u/gitpusha)
#### Post date: [November 20, 2019, 8:53am UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/1 "2019-11-20T08:53:13Z")

</div>

Hi,

What is the current recommended test setup for the OZ SDK. From the docs it looks like truffle is still the way to go. However, the mixing of the oz SDK with truffle does not look too neat to me.  
Is there already a testing framework that is built into the oz SDK? If not, are there plans to roll one out soonish?

---

<div class="post-metadata">

### Author: ![spalladino](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/spalladino/32/22_2.png) [@spalladino](https://forum.openzeppelin.com/u/spalladino)
#### Post date: [November 20, 2019, 1:30pm UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/2 "2019-11-20T13:30:23Z")

</div>

> [@gitpusha](#):
>
> If not, are there plans to roll one out soonish?

Stay tuned 🕶

We will be making an announcement real soon!

---

<div class="post-metadata">

### Author: ![bayram](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bayram](https://forum.openzeppelin.com/u/bayram)
#### Post date: [November 20, 2019, 2:05pm UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/3 "2019-11-20T14:05:37Z")

</div>

I haven’t yet fully switched to OZ SDK for that reason. Still preferring truffle just because it provides a test framework.  
Also it would be great if you could enrich you documentation on OZ command line; more examples, more explanations, etc.

---

<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: [November 20, 2019, 9:34pm UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/4 "2019-11-20T21:34:56Z")

</div>

Hi @gitpusha,

Great timing with this question!  
There are definitely plans for an OpenZeppelin test environment.

In fact the repository for this has just been made public.

**Please note, it hasn’t been formally announced (this will be coming soon-ish), so it is a soft launch for now.**

Feedback on using the framework is greatly appreciated.

## OpenZeppelin Test-Environment

> **[OpenZeppelin/openzeppelin-test-environment](https://github.com/OpenZeppelin/openzeppelin-test-environment)**
>
> One-line setup for a blazing-fast smart contracts tests - OpenZeppelin/openzeppelin-test-environment

---

<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: [November 20, 2019, 9:40pm UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/5 "2019-11-20T21:40:31Z")

</div>

Hi @bayram,

There is now an OpenZeppelin Test-Environment!

**Please note, it hasn’t been formally announced (this will be coming soon-ish), so it is a soft launch for now.**

Feedback on using the framework is greatly appreciated.

## OpenZeppelin Test-Environment

> **[OpenZeppelin/openzeppelin-test-environment](https://github.com/OpenZeppelin/openzeppelin-test-environment)**
>
> One-line setup for a blazing-fast smart contracts tests - OpenZeppelin/openzeppelin-test-environment

* * *

For OpenZeppelin CLI documentation, can you give more detail on what you would like to see regards examples and documentation, so that we can make it more useful.  
Are there particular commands you would like more information on?

---

<div class="post-metadata">

### Author: ![gitpusha](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/gitpusha/32/1480_2.png) [@gitpusha](https://forum.openzeppelin.com/u/gitpusha)
#### Post date: [November 21, 2019, 9:49am UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/6 "2019-11-21T09:49:30Z")

</div>

Hi @spalladino and @abcoathup. Too much tease, so many questions:  
Does oz test environment work well with tools like + how to configure?

- solidity-coverage
- eth-gas-reporter

Is there built-in `ethers.js` support too?

---

<div class="post-metadata">

### Author: ![nventuro](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nventuro/32/8_2.png) [@nventuro](https://forum.openzeppelin.com/u/nventuro)
#### Post date: [November 21, 2019, 5:52pm UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/7 "2019-11-21T17:52:16Z")

</div>

Hello @gitpusha, thanks for your interest in `test-environment`! Keep in mind this is only an initial release, in which we’re focusing on more simple setups that are limited to running tests. That said, we’ve definitely considered those tools during the design of `test-environment`, and plan to add first-class support for them soon.

`solidity-coverage` actually already has experimental, undocumented support which is used in the OpenZeppelin Contracts build. Since a new, much better version of `coverage` is coming out soon, we’re holding off the integration until that happens. You can read more about that and share ideas on this issue: [https://github.com/OpenZeppelin/openzeppelin-test-environment/issues/21](https://github.com/OpenZeppelin/openzeppelin-test-environment/issues/21)

Regarding `ethers`, we expose a `provider` object which is a regular `web3` provider: you should be able to use it to set up your `ethers` instance like in any other development setup. You could do something similar to create Contract objects. Are there any specific `ethers` features you’d like to see being supported natively?

---

<div class="post-metadata">

### Author: ![gitpusha](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/gitpusha/32/1480_2.png) [@gitpusha](https://forum.openzeppelin.com/u/gitpusha)
#### Post date: [November 22, 2019, 8:56am UTC](https://forum.openzeppelin.com/t/recommended-test-setup-with-oz-sdk/1790/8 "2019-11-22T08:56:21Z")

</div>

Hi @nventuro. Thanks for the detailed response. I will start playing around with `test-environment` myself. I think it is worth doing so and waiting for the upcoming releases, as I am just impressed with the developer experience your products have provided me with so far. So might as well start using it now, and spare me switching my suite over to it later, once the full-fledged release is there.

Regarding `solidity-coverage` and [OpenZeppelin/openzeppelin-test-environment#21](https://github.com/OpenZeppelin/openzeppelin-test-environment/issues/21) - it sounds a bit like I should stay away from `jest/ava` if I want to rely on `solidity-coverage` working well for me in the near future. Or is a solution to your issues imminent?

Regarding `ethers` - I will have to report back to you, once I fiddled around wih it inside the `test-environment` . I only recently made the switch from `web3.js` to `ethers.js` and found the latter much more pleasing and less verbose. I also prefer the `ethers.js docs` . I guess (for me) the `test-environment` would ideally be designed with `ethers.js` in mind too. But I know you guys use `web3.js` and more people seem to use that still. Actually, I have heard that the EF wants to combine the teams working on `web3.js` and `ethers.js` under a unified effort. So maybe there’s some new library altogether to come soon anyway.  
One question from the top of my head:  
The code inside the [test-environment.config.js](https://github.com/OpenZeppelin/openzeppelin-test-environment#configuration) file

```auto
contracts: {
   type: 'truffle', // Contract abstraction to use: 'truffle' for @truffle/contract or 'web3' for web3-eth-contract
   defaultGas: 6e6, // Maximum gas for contract calls (when unspecified)
 },

```

What would I do for the `type` field, if I used `ethers.js`?  
I guess with some more thinking, I’d figure it out myself. It’s just that ideally it would be covered in the `test-environment` docs for ethers.js users like me. But dont worry bout it please, if it’s not on your priority list.

May I also add: do you have any experience with `ethers.js`, and any opinions on it?
