From b0458c6faba4f537db05ea400b3ba9fdcf691fa1 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 2 Oct 2016 17:26:48 -0400 Subject: [PATCH] fix logging in test --- demo/test/simple_storage2_spec.js | 23 +++++++++++++++++++++++ lib/test.js | 3 +-- lib/test_logger.js | 2 -- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 demo/test/simple_storage2_spec.js diff --git a/demo/test/simple_storage2_spec.js b/demo/test/simple_storage2_spec.js new file mode 100644 index 00000000..5e41b7d1 --- /dev/null +++ b/demo/test/simple_storage2_spec.js @@ -0,0 +1,23 @@ +var assert = require('assert'); +//var Embark = require('embark-framework'); +var Embark = require('../../lib/index.js'); +var EmbarkSpec = Embark.initTests(); + +describe("SimpleStorage", function() { + before(function(done) { + var contractsConfig = { + "token": { + args: [1000] + } + }; + EmbarkSpec.deployAll(contractsConfig, done); + }); + + it("should get balance", function(done) { + token.coinBalanceOf(EmbarkSpec.web3.eth.defaultAccount, function(err, result) { + assert.equal(result.toNumber(), 1000); + done(); + }); + }); + +}); diff --git a/lib/test.js b/lib/test.js index 695df1b3..3e14537e 100644 --- a/lib/test.js +++ b/lib/test.js @@ -3,7 +3,7 @@ var Web3 = require('web3'); var Embark = require('./index.js'); var ContractsManager = require('./contracts.js'); var Deploy = require('./deploy.js'); -var TestLogger = require('./logger.js'); +var TestLogger = require('./test_logger.js'); var Config = require('./config.js'); var ABIGenerator = require('./abi.js'); @@ -29,7 +29,6 @@ Test.prototype.deployAll = function(contractsConfig, cb) { async.waterfall([ function buildContracts(callback) { - var config = new Config('test'); config.contractsFiles = config.loadFiles(["app/contracts/**"]); config.contractsConfig = {contracts: contractsConfig} ; diff --git a/lib/test_logger.js b/lib/test_logger.js index efc713db..7795f1a4 100644 --- a/lib/test_logger.js +++ b/lib/test_logger.js @@ -6,8 +6,6 @@ var TestLogger = function(options) { this.logLevels = ['error', 'warn', 'info', 'debug', 'trace']; this.logs = []; this.logLevel = options.logLevel || 'info'; - this.contractsState = options.contractsState || console.log; - this.availableServices = options.availableServices || console.log; }; TestLogger.prototype.logFunction = function() {