embark/dapps/tests/app/test/plugin_storage_spec.js
Pascal Precht b021689387 feat(@embark/test-runner): introduce artifacts.require API
This commit adds a convenience API `artifacts.require(name)` that aims to make
requiring artifacts a little bit more straight forward.

Usage:

```
const SimpleStorage = artifacts.require('SimpleStorage');
const EmbarkJS = artifacts.require('EmbarkJS');
```
2020-02-12 14:17:30 -05:00

29 lines
643 B
JavaScript

/*global artifacts, contract, config, it*/
const assert = require('assert');
const PluginStorage = artifacts.require('PluginStorage');
const SimpleStorage = artifacts.require('SimpleStorage');
config({
contracts: {
deploy: {
"SimpleStorage": {
args: [100]
},
"PluginStorage": {
args: ["$SimpleStorage"]
}
}
}
});
contract("PluginSimpleStorage", function () {
this.timeout(0);
it("set SimpleStorage address", async function () {
let result = await PluginStorage.methods.simpleStorageAddress().call();
assert.equal(result.toString(), SimpleStorage.options.address);
});
});