Skip to content

Commit

Permalink
Fix flaky unit test failures (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
OsvaldoRosado authored Jun 14, 2017
1 parent ce12998 commit 9c366e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/EndToEnd.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ describe("EndToEnd", () => {

describe("Offline mode", () => {
var AppInsights = require("../applicationinsights");
var CorrelationIdManager = require("../Library/CorrelationIdManager");
var cidStub: sinon.SinonStub = null;


beforeEach(() => {
AppInsights.client = undefined;
cidStub = sinon.stub(CorrelationIdManager, 'queryCorrelationId'); // TODO: Fix method of stubbing requests to allow CID to be part of E2E tests
this.request = sinon.stub(https, 'request');
this.writeFile = sinon.stub(fs, 'writeFile');
this.writeFileSync = sinon.stub(fs, 'writeFileSync');
Expand All @@ -219,6 +222,7 @@ describe("EndToEnd", () => {
});

afterEach(()=> {
cidStub.restore();
this.request.restore();
this.writeFile.restore();
this.exists.restore();
Expand Down

0 comments on commit 9c366e5

Please sign in to comment.