Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2826 from trufflesuite/fix-assertions
Browse files Browse the repository at this point in the history
Bug fix: Fix assertion library
  • Loading branch information
eggplantzzz committed Feb 14, 2020
2 parents a2428a6 + 78835a4 commit c644f84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/core/lib/testing/soliditytest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const SolidityTest = {

// Set up our runner's needs first.
suite.beforeAll("prepare suite", async function() {
await runner.initialize.bind(runner)();
// This compiles some native contracts (including the assertion library
// contracts) which need to be compiled before initializing the runner
await self.compileNewAbstractInterface.bind(this)(runner);
await runner.initialize.bind(runner)();
await self.deployTestDependencies.bind(
this
)(abstraction, dependencyPaths, runner);
Expand Down
8 changes: 6 additions & 2 deletions packages/core/lib/testing/testrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ TestRunner.prototype.endTest = async function(mocha) {
fromBlock: this.currentTestStartBlock.toNumber()
});

if (logs.length === 0) {
const userDefinedEventLogs = logs.filter(log => {
return log.decodings.every(decoding => decoding.abi.name !== "TestEvent")
});

if (userDefinedEventLogs.length === 0) {
this.logger.log(" > No events were emitted");
return;
}
Expand All @@ -184,7 +188,7 @@ TestRunner.prototype.endTest = async function(mocha) {
this.logger.log(" ---------------------------");
this.logger.log("");

for (const log of logs) {
for (const log of userDefinedEventLogs) {
switch (log.decodings.length) {
case 0:
this.logger.log(` Warning: Could not decode event!`);
Expand Down

0 comments on commit c644f84

Please sign in to comment.