embark/test/test.js

30 lines
1007 B
JavaScript
Raw Normal View History

2015-07-04 02:27:17 +00:00
var Config = require('../lib/config/config.js');
var Test = require('../lib/test.js');
2015-07-04 03:23:21 +00:00
var Compiler = require('../lib/compiler.js');
2015-07-04 02:27:17 +00:00
var assert = require('assert');
2015-07-04 02:27:17 +00:00
//var contractFiles = grunt.file.expand("./app/contracts/**/*.sol")
describe('embark.test', function() {
var files = [
'test/support/contracts/simple_storage.sol'
]
2015-07-04 03:23:21 +00:00
var _blockchainConfig = (new Config.Blockchain()).loadConfigFile('test/support/blockchain.yml');
var blockchainConfig = _blockchainConfig.config("development");
var compiler = new Compiler(_blockchainConfig);
var contractsConfig = new Config.Contracts(blockchainConfig, compiler);
2015-07-04 02:27:17 +00:00
contractsConfig.loadConfigFile('test/support/contracts.yml');
contractsConfig.init(files);
describe('simple test', function() {
var embarkSpec = new Test(contractsConfig, files);
it('execute simple test', function() {
var SimpleStorage = embarkSpec.request('SimpleStorage', [100])
assert.equal(SimpleStorage.storedData(), '100');
});
});
});