How to run the truffle migrations with openzeppelin/test-environment

Hello!

I’m migrating from truffle-test to test-enviroment lib + jest, and I would like to make sure the custom migration script (where I define all the contract arguments and creation rules) gets applied to the test blockchain that test-environment spins up. I can see the abis are loaded from the artifact storage, but the contracts are not deployed by default in this network.

Should I add the beforeAll in each test file to deploy my contracts, or do we have some sort of config to indicate which migration script should be executed before the test runner starts?

Thank you!

Hi @fforbeck, welcome to the forum.

Just to be clear, test-environment does not support Truffle migrations.

If you have a global setup, you should run it manually before your tests run. Using Jest’s beforeAll would be good, though if the setup is the same for all files, you should only place it in a single file.

1 Like

Hey! Thanks @frangio ! That works.

1 Like