embark-area-51/test/test.js

30 lines
1022 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');
2015-08-01 15:19:21 +00:00
contractsConfig.init(files, 'development');
2015-07-04 02:27:17 +00:00
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');
});
});
});