Does OpenZeppelin Test Environment make tests faster to write?

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.

2 Likes

Hi @ilanD,

Welcome to the community :wave:
I moved this discussion to it’s own topic. (from Blazing Fast Contracts Testing)

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 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.

1 Like

@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?

2 Likes

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

Would appreciate any feedback on the conversion.

I’d also suggest looking at OpenZeppelin Test Helpers for testing event emission, revert reasons etc.

1 Like

we started using test helpers.
Expect event
and
Expect revert

both are great

2 Likes

Hi @ilanD,

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

Have you had a try of OpenZeppelin Test Environment?

1 Like

No
We are now using buidler setup with truffle.
haven’t found a good reason to migrate to OpenZeppelin Test Environment.

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

2 Likes

Hi @ilanD,

OpenZeppelin Test Environment can run with buidler.

The gain is a big speed improvement in running tests.

1 Like

A post was split to a new topic: OpenZeppelin Test Helpers expectRevert.unspecified creates issues when running coverage