diff --git a/lib/tests/test.js b/lib/tests/test.js index e642e7eb..b0c9c66f 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -321,6 +321,21 @@ class Test { function resetContracts(next) { self.engine.events.request("contracts:reset:dependencies", next); }, + function compileContracts(next) { + if (Object.keys(self.builtContracts).length > 0) { + return next(); + } + console.info('Compiling contracts'.cyan); + self.engine.contractsManager.build(() => { + self.builtContracts = cloneDeep(self.engine.contractsManager.contracts); + let className; + for (className in self.builtContracts) { + self.builtContracts[className].dependencyCount = null; + } + self.compiledContracts = cloneDeep(self.engine.contractsManager.compiledContracts); + next(); + }); + }, function deploy(next) { self._deploy(options, (err, accounts) => { if (err) {