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", () => {
|
describe("SolidityTestRunner", () => {
|
||||||
let embark;
|
let embark;
|
||||||
|
let options;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const events = { request: sinon.spy() };
|
const events = { request: sinon.spy() };
|
||||||
embark = { events: events };
|
embark = { events: events };
|
||||||
|
options = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("constructor", () => {
|
describe("constructor", () => {
|
||||||
it("registers the runner", () => {
|
it("registers the runner", () => {
|
||||||
const _ = new SolidityTestRunner(embark);
|
const _ = new SolidityTestRunner(embark, options);
|
||||||
assert(embark.events.request.called);
|
assert(embark.events.request.called);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -50,7 +52,7 @@ describe("SolidityTestRunner", () => {
|
||||||
describe("methods", () => {
|
describe("methods", () => {
|
||||||
let instance;
|
let instance;
|
||||||
|
|
||||||
beforeEach(() => { instance = new SolidityTestRunner(embark); });
|
beforeEach(() => { instance = new SolidityTestRunner(embark, options); });
|
||||||
|
|
||||||
describe("match", () => {
|
describe("match", () => {
|
||||||
it("matches .sol files", () => {
|
it("matches .sol files", () => {
|
||||||
|
|
Loading…
Reference in New Issue