58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
|
/*globals describe, it*/
|
||
|
var Config = require('../lib/config.js');
|
||
|
var assert = require('assert');
|
||
|
var fs = require('fs');
|
||
|
|
||
|
describe('embark.Config', function() {
|
||
|
var config = new Config({
|
||
|
env: 'myenv',
|
||
|
configDir: './test/test1/config/'
|
||
|
});
|
||
|
|
||
|
describe('#loadBlockchainConfigFile', function() {
|
||
|
it('should load blockchain config correctly', function() {
|
||
|
config.loadBlockchainConfigFile();
|
||
|
var expectedConfig = {
|
||
|
"networkType": "custom",
|
||
|
"genesisBlock": "config/development/genesis.json",
|
||
|
"datadir": ".embark/development/datadir",
|
||
|
"mineWhenNeeded": true,
|
||
|
"nodiscover": true,
|
||
|
"rpcHost": "localhost",
|
||
|
"rpcPort": 8545,
|
||
|
"rpcCorsDomain": "http://localhost:8000",
|
||
|
"account": {
|
||
|
"password": "config/development/password"
|
||
|
}
|
||
|
};
|
||
|
|
||
|
assert.deepEqual(config.blockchainConfig, expectedConfig);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
describe('#loadContractsConfigFile', function() {
|
||
|
it('should load contract config correctly', function() {
|
||
|
config.loadContractsConfigFile();
|
||
|
var expectedConfig = {
|
||
|
"gas": "auto",
|
||
|
"contracts": {
|
||
|
"SimpleStorage": {
|
||
|
"args": [
|
||
|
100
|
||
|
],
|
||
|
"gas": 123456
|
||
|
},
|
||
|
"Token": {
|
||
|
"args": [
|
||
|
200
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
assert.deepEqual(config.contractsConfig, expectedConfig);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
});
|