# Does OpenZeppelin Test Environment make tests faster to write?

**URL:** https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016
**Category:** Support
**Created:** [January 1, 2020, 7:56pm UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016 "2020-01-01T19:56:40Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![ilanD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/iland/32/2477_2.png) [@ilanD](https://forum.openzeppelin.com/u/ilanD)
#### Post date: [January 1, 2020, 7:56pm UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/1 "2020-01-01T19:56:40Z")

</div>

Thanks

But I am not following  
the example above looks very similar to my truffle test files.  
is the time improvement only related to tests run time?  
or also for writing the tests?

I do see the nice added value for testing events or getting balances.  
but it doesn’t seem like it will make writing tests faster.  
Neither not a good enough reason to migrate.  
I am looking for ways to make testing faster and easier.

so please help me out here.  
not sure what I a missing.

---

<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: [January 2, 2020, 12:36am UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/2 "2020-01-02T00:36:35Z")

</div>

Hi @ilanD,

Welcome to the community 👋  
I moved this discussion to it’s own topic. (from [Blazing Fast Contracts Testing](https://forum.openzeppelin.com/t/blazing-fast-contracts-testing/1873))

OpenZeppelin Test Environment greatly improves the time taken to run tests.  
As per the Mocha test example, it is very similar to workflows using Mocha based tests, making it straight forward to migrate. (The tests for OpenZeppelin Contracts and OpenZeppelin SDK were migrated to OpenZeppelin Test Environment)

Whilst the tests don’t significantly change, the speed of running tests is a big improvement. In my opinion, this improves the speed of developing tests as I run tests many times whilst developing them.

For developers using test runners Jest or Ava, it allows tests to be developed to use their preferred test runners, again improving the experience.

[OpenZeppelin Test Helpers](https://github.com/OpenZeppelin/openzeppelin-test-helpers) integrates seamlessly with OpenZeppelin Test Environment, but it also supports Truffle tests and regular web3 workflows. So whether you use OpenZeppelin Test Environment or another workflow, you can make use of Test Helpers for things such as event emission, revert reasons, which all make it easier to write tests.

---

<div class="post-metadata">

### Author: ![ilanD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/iland/32/2477_2.png) [@ilanD](https://forum.openzeppelin.com/u/ilanD)
#### Post date: [January 2, 2020, 11:30am UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/3 "2020-01-02T11:30:31Z")

</div>

@abcoathup  
thank u very much for this reply.

I get it now.

so it seems to me it does make sense to migrate from my side.  
From what I see on high level.  
migrating from truffle setup should be quiet seem less. right?

---

<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: [January 3, 2020, 3:29am UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/4 "2020-01-03T03:29:47Z")

</div>

Hi @ilanD,

Migrating from Truffle test to OpenZeppelin Test Environment (using Mocha and Chai) is straight forward. There is a guide on how to do this: [https://github.com/OpenZeppelin/openzeppelin-test-environment/blob/master/docs/modules/ROOT/pages/migrating-from-truffle.adoc](https://github.com/OpenZeppelin/openzeppelin-test-environment/blob/master/docs/modules/ROOT/pages/migrating-from-truffle.adoc)

Would appreciate any feedback on the conversion.

I’d also suggest looking at [OpenZeppelin Test Helpers](https://github.com/OpenZeppelin/openzeppelin-test-helpers) for testing event emission, revert reasons etc.

---

<div class="post-metadata">

### Author: ![ilanD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/iland/32/2477_2.png) [@ilanD](https://forum.openzeppelin.com/u/ilanD)
#### Post date: [March 5, 2020, 7:39pm UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/5 "2020-03-05T19:39:15Z")

</div>

we started using test helpers.  
Expect event  
and  
Expect revert

both are great

---

<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: [March 6, 2020, 3:21am UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/6 "2020-03-06T03:21:38Z")

</div>

Hi @ilanD,

Great to hear. The OpenZeppelin Test Helpers make testing easier.

Have you had a try of [OpenZeppelin Test Environment](https://docs.openzeppelin.com/test-environment)?

---

<div class="post-metadata">

### Author: ![ilanD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/iland/32/2477_2.png) [@ilanD](https://forum.openzeppelin.com/u/ilanD)
#### Post date: [March 8, 2020, 8:02pm UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/7 "2020-03-08T20:02:40Z")

</div>

No  
We are now using buidler setup with truffle.  
haven’t found a good reason to migrate to [OpenZeppelin Test Environment](https://docs.openzeppelin.com/test-environment).

can it run with buidler?  
what would we gain from migrating?

---

<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: [March 10, 2020, 3:01pm UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/8 "2020-03-10T15:01:10Z")

</div>

Hi @ilanD,

OpenZeppelin Test Environment can run with buidler.

The gain is a big speed improvement in running tests.

---

<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: [April 14, 2020, 12:35am UTC](https://forum.openzeppelin.com/t/does-openzeppelin-test-environment-make-tests-faster-to-write/2016/9 "2020-04-14T00:35:15Z")

</div>

A post was split to a new topic: [OpenZeppelin Test Helpers expectRevert.unspecified creates issues when running coverage](https://forum.openzeppelin.com/t/openzeppelin-test-helpers-expectrevert-unspecified-creates-issues-when-running-coverage/2650)
