From 253d3dd57c9a0faa36f55f6bef278250225db5f8 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 1 Aug 2018 12:08:47 -0400 Subject: [PATCH] wip --- lib/core/engine.js | 6 +++++- lib/modules/coverage/index.js | 15 ++++++++++++--- lib/tests/test.js | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/core/engine.js b/lib/core/engine.js index 8f285ea6..c401233d 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -57,7 +57,8 @@ class Engine { "libraryManager": this.libraryManagerService, "processManager": this.processManagerService, "storage": this.storageService, - "graph": this.graphService + "graph": this.graphService, + "codeCoverage": this.codeCoverageService }; let service = services[serviceName]; @@ -226,6 +227,9 @@ class Engine { this.registerModule('library_manager'); } + codeCoverageService(_options) { + this.registerModule('coverage'); + } } module.exports = Engine; diff --git a/lib/modules/coverage/index.js b/lib/modules/coverage/index.js index e03548dc..cf896738 100644 --- a/lib/modules/coverage/index.js +++ b/lib/modules/coverage/index.js @@ -1,9 +1,18 @@ class CodeCoverage { - constructor(embark, options) { - const self = this; - + constructor(embark, _options) { this.events = embark.events; this.logger = embark.logger; + + embark.registerActionForEvent('contracts:deploy:afterAll', this.deployed.bind(this)); + } + + deployed(cb) { + this.events.request('contracts:list', (error, contracts) => { + console.dir(error); + console.dir(contracts); + cb(); + }); } } +module.exports = CodeCoverage; diff --git a/lib/tests/test.js b/lib/tests/test.js index ae9696e9..10ef7405 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -120,6 +120,7 @@ class Test { ipcRole: 'client' }); this.events.request('deploy:setGasLimit', 6000000); + this.engine.startService("codeCoverage"); } init(callback) {