mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 22:34:24 +00:00
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 = require('shelljs');
|
||||||
var shelljs_global = require('shelljs/global');
|
var shelljs_global = require('shelljs/global');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
@ -15,13 +16,15 @@ Compiler.prototype.compile_contracts = function(contractFiles) {
|
|||||||
".sol": this.compile_solidity
|
".sol": this.compile_solidity
|
||||||
};
|
};
|
||||||
|
|
||||||
var compilerPlugins = this.plugins.getPluginsFor('compilers');
|
if (this.plugins) {
|
||||||
if (compilerPlugins.length > 0) {
|
var compilerPlugins = this.plugins.getPluginsFor('compilers');
|
||||||
compilerPlugins.forEach(function(plugin) {
|
if (compilerPlugins.length > 0) {
|
||||||
plugin.compilers.forEach(function(compilerObject) {
|
compilerPlugins.forEach(function(plugin) {
|
||||||
available_compilers[compilerObject.extension] = compilerObject.cb;
|
plugin.compilers.forEach(function(compilerObject) {
|
||||||
|
available_compilers[compilerObject.extension] = compilerObject.cb;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var compiledObject = {};
|
var compiledObject = {};
|
||||||
|
@ -16,11 +16,13 @@ var Config = function(options) {
|
|||||||
this.contractsFiles = [];
|
this.contractsFiles = [];
|
||||||
this.configDir = options.configDir || 'config/';
|
this.configDir = options.configDir || 'config/';
|
||||||
this.chainsFile = options.chainsFile || './chains.json';
|
this.chainsFile = options.chainsFile || './chains.json';
|
||||||
|
this.plugins = options.plugins;
|
||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
};
|
};
|
||||||
|
|
||||||
Config.prototype.loadConfigFiles = function(options) {
|
Config.prototype.loadConfigFiles = function(options) {
|
||||||
this.embarkConfig = JSON.parse(fs.readFileSync(options.embarkConfig));
|
this.embarkConfig = JSON.parse(fs.readFileSync(options.embarkConfig));
|
||||||
|
this.embarkConfig.plugins = this.embarkConfig.plugins || {};
|
||||||
|
|
||||||
this.loadPipelineConfigFile();
|
this.loadPipelineConfigFile();
|
||||||
this.loadBlockchainConfigFile();
|
this.loadBlockchainConfigFile();
|
||||||
|
@ -8,7 +8,7 @@ var readFile = function(file) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe('embark.Compiler', function() {
|
describe('embark.Compiler', function() {
|
||||||
var compiler = new Compiler();
|
var compiler = new Compiler({});
|
||||||
|
|
||||||
describe('#compile_solidity', function() {
|
describe('#compile_solidity', function() {
|
||||||
var compiledContracts = compiler.compile_solidity([
|
var compiledContracts = compiler.compile_solidity([
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*globals describe, it*/
|
/*globals describe, it*/
|
||||||
var Config = require('../lib/config.js');
|
var Config = require('../lib/config.js');
|
||||||
|
var Plugins = require('../lib/plugins.js');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
@ -8,6 +9,7 @@ describe('embark.Config', function() {
|
|||||||
env: 'myenv',
|
env: 'myenv',
|
||||||
configDir: './test/test1/config/'
|
configDir: './test/test1/config/'
|
||||||
});
|
});
|
||||||
|
config.plugins = new Plugins({plugins: {}});
|
||||||
|
|
||||||
describe('#loadBlockchainConfigFile', function() {
|
describe('#loadBlockchainConfigFile', function() {
|
||||||
it('should load blockchain config correctly', function() {
|
it('should load blockchain config correctly', function() {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
/*globals describe, it*/
|
/*globals describe, it*/
|
||||||
var Console = require('../lib/console.js');
|
var Console = require('../lib/console.js');
|
||||||
|
var Plugins = require('../lib/plugins.js');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
|
||||||
describe('embark.Console', function() {
|
describe('embark.Console', function() {
|
||||||
var console = new Console();
|
var plugins = new Plugins({plugins: {}});
|
||||||
|
var console = new Console({plugins: plugins});
|
||||||
|
|
||||||
describe('#executeCmd', function() {
|
describe('#executeCmd', function() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user