fix specs
This commit is contained in:
parent
0ec3fba352
commit
1cdcaee7d9
|
@ -1,3 +1,4 @@
|
|||
/*jshint esversion: 6, loopfunc: true */
|
||||
var shelljs = require('shelljs');
|
||||
var shelljs_global = require('shelljs/global');
|
||||
var fs = require('fs');
|
||||
|
@ -15,13 +16,15 @@ Compiler.prototype.compile_contracts = function(contractFiles) {
|
|||
".sol": this.compile_solidity
|
||||
};
|
||||
|
||||
var compilerPlugins = this.plugins.getPluginsFor('compilers');
|
||||
if (compilerPlugins.length > 0) {
|
||||
compilerPlugins.forEach(function(plugin) {
|
||||
plugin.compilers.forEach(function(compilerObject) {
|
||||
available_compilers[compilerObject.extension] = compilerObject.cb;
|
||||
if (this.plugins) {
|
||||
var compilerPlugins = this.plugins.getPluginsFor('compilers');
|
||||
if (compilerPlugins.length > 0) {
|
||||
compilerPlugins.forEach(function(plugin) {
|
||||
plugin.compilers.forEach(function(compilerObject) {
|
||||
available_compilers[compilerObject.extension] = compilerObject.cb;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var compiledObject = {};
|
||||
|
|
|
@ -16,11 +16,13 @@ var Config = function(options) {
|
|||
this.contractsFiles = [];
|
||||
this.configDir = options.configDir || 'config/';
|
||||
this.chainsFile = options.chainsFile || './chains.json';
|
||||
this.plugins = options.plugins;
|
||||
this.logger = options.logger;
|
||||
};
|
||||
|
||||
Config.prototype.loadConfigFiles = function(options) {
|
||||
this.embarkConfig = JSON.parse(fs.readFileSync(options.embarkConfig));
|
||||
this.embarkConfig.plugins = this.embarkConfig.plugins || {};
|
||||
|
||||
this.loadPipelineConfigFile();
|
||||
this.loadBlockchainConfigFile();
|
||||
|
|
|
@ -8,7 +8,7 @@ var readFile = function(file) {
|
|||
};
|
||||
|
||||
describe('embark.Compiler', function() {
|
||||
var compiler = new Compiler();
|
||||
var compiler = new Compiler({});
|
||||
|
||||
describe('#compile_solidity', function() {
|
||||
var compiledContracts = compiler.compile_solidity([
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*globals describe, it*/
|
||||
var Config = require('../lib/config.js');
|
||||
var Plugins = require('../lib/plugins.js');
|
||||
var assert = require('assert');
|
||||
var fs = require('fs');
|
||||
|
||||
|
@ -8,6 +9,7 @@ describe('embark.Config', function() {
|
|||
env: 'myenv',
|
||||
configDir: './test/test1/config/'
|
||||
});
|
||||
config.plugins = new Plugins({plugins: {}});
|
||||
|
||||
describe('#loadBlockchainConfigFile', function() {
|
||||
it('should load blockchain config correctly', function() {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*globals describe, it*/
|
||||
var Console = require('../lib/console.js');
|
||||
var Plugins = require('../lib/plugins.js');
|
||||
var assert = require('assert');
|
||||
|
||||
describe('embark.Console', function() {
|
||||
var console = new Console();
|
||||
var plugins = new Plugins({plugins: {}});
|
||||
var console = new Console({plugins: plugins});
|
||||
|
||||
describe('#executeCmd', function() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue