chore(@embark/deploy-tracker): fix tests and make them run in CI

This commit is contained in:
Jonathan Rainville 2019-11-08 17:19:55 -05:00 committed by Michael Bradley
parent 1c44a52027
commit 8733ca911c
2 changed files with 10 additions and 7 deletions

View File

@ -33,7 +33,7 @@
"ci": "npm run qa",
"clean": "npm run reset",
"lint": "eslint src/",
"qa": "npm-run-all lint _build",
"qa": "npm-run-all lint _build test",
"reset": "npx rimraf .nyc_output coverage dist embark-*.tgz package",
"solo": "embark-solo",
"test": "nyc --reporter=html --reporter=json mocha \"dist/test/**/*.js\" --exit --no-timeouts --require source-map-support/register"

View File

@ -60,9 +60,9 @@ describe('embark.trackingFunctions', function () {
config: {
contractsConfig: {
tracking: undefined
}
},
env: "development",
env: "development"
},
fs,
events,
logger,
@ -111,9 +111,9 @@ describe('embark.trackingFunctions', function () {
config: {
contractsConfig: {
tracking: undefined
}
},
env: "development",
env: "development"
},
fs,
events,
logger,
@ -138,11 +138,14 @@ describe('embark.trackingFunctions', function () {
expect(currentChain).to.be(null);
});
it("should return undefined when there is no chains file", async function () {
it("should return a basic chain when there is no chains file", async function () {
exists.restore();
exists = sinon.stub(fs, 'exists').returns(false);
const currentChain = await trackingFunctions.currentChain;
expect(currentChain).to.be(undefined);
expect(currentChain).to.eql({
contracts: {},
name: 'development'
});
});
});