embark-area-51/demo/test/simple_storage_spec.js

35 lines
869 B
JavaScript

var assert = require('assert');
//var Embark = require('embark-framework');
var Embark = require('../../lib/index.js');
var EmbarkSpec = Embark.initTests();
var web3 = EmbarkSpec.web3;
describe("SimpleStorage", function() {
before(function(done) {
//EmbarkSpec.deployContract('SimpleStorage', [100], done);
var contractsConfig = {
"SimpleStorage": {
args: [100, '0x123']
}
};
EmbarkSpec.deployAll(contractsConfig, done);
});
it("should set constructor value", function(done) {
SimpleStorage.storedData(function(err, result) {
assert.equal(result.toNumber(), 100);
done();
});
});
it("set storage value", function(done) {
SimpleStorage.set(150, function() {
SimpleStorage.get(function(err, result) {
assert.equal(result.toNumber(), 150);
done();
});
});
});
});