fix logging in test

This commit is contained in:
Iuri Matias 2016-10-02 17:26:48 -04:00
parent 5ae091ffb5
commit b0458c6fab
3 changed files with 24 additions and 4 deletions

View File

@ -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();
});
});
});

View File

@ -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} ;

View File

@ -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() {