mirror of https://github.com/embarklabs/embark.git
test(@embark/plugins/solidity-tests): supply mock options object to SolidityTestRunner constructor
When an options object is not supplied the tests fail because the constructor expects the options argument to be an object, i.e. referencing `options.plugins` should not cause a TypeError
This commit is contained in:
parent
2900e04cae
commit
c057695b09
|
@ -34,15 +34,17 @@ const cleanCode = (code) => {
|
|||
|
||||
describe("SolidityTestRunner", () => {
|
||||
let embark;
|
||||
let options;
|
||||
|
||||
beforeEach(() => {
|
||||
const events = { request: sinon.spy() };
|
||||
embark = { events: events };
|
||||
options = {};
|
||||
});
|
||||
|
||||
describe("constructor", () => {
|
||||
it("registers the runner", () => {
|
||||
const _ = new SolidityTestRunner(embark);
|
||||
const _ = new SolidityTestRunner(embark, options);
|
||||
assert(embark.events.request.called);
|
||||
});
|
||||
});
|
||||
|
@ -50,7 +52,7 @@ describe("SolidityTestRunner", () => {
|
|||
describe("methods", () => {
|
||||
let instance;
|
||||
|
||||
beforeEach(() => { instance = new SolidityTestRunner(embark); });
|
||||
beforeEach(() => { instance = new SolidityTestRunner(embark, options); });
|
||||
|
||||
describe("match", () => {
|
||||
it("matches .sol files", () => {
|
||||
|
|
Loading…
Reference in New Issue