mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-30 15:37:39 +00:00
b021689387
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'); ```
24 lines
466 B
JavaScript
24 lines
466 B
JavaScript
/*global artifacts, contract, config, it*/
|
|
const assert = require('assert');
|
|
const Test2 = artifacts.require('Test2');
|
|
|
|
config({
|
|
contracts: {
|
|
deploy: {
|
|
"Test2": {},
|
|
"ZAMyLib": {},
|
|
"ZAMyLib2": {
|
|
"deploy": true
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
contract("Test", function() {
|
|
it("should call library correctly", async function() {
|
|
let result = await Test2.methods.testAdd().call();
|
|
assert.strictEqual(parseInt(result, 10), 3);
|
|
});
|
|
|
|
});
|