Skip to content

Commit fb15912

Browse files
committed
change winstonLogger to syncCliLogger in test cases
1 parent b3e3590 commit fb15912

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

test/unit/bin/helpers/syncRunner.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ const chai = require("chai"),
33
chaiAsPromised = require("chai-as-promised"),
44
rewire = require("rewire");
55

6-
const logger = require("../../../../bin/helpers/logger").winstonLogger,
6+
const logger = require("../../../../bin/helpers/logger").syncCliLogger,
77
testObjects = require("../../support/fixtures/testObjects");
88

99
const syncRunner = rewire("../../../../bin/helpers/syncRunner");
1010

1111
chai.use(chaiAsPromised);
12-
logger.transports["console.info"].silent = true;
1312

1413
logBuildDetails = syncRunner.__get__("logBuildDetails");
1514

1615
describe("syncRunner", () => {
17-
var sandbox, winstonLoggerStub;
16+
var sandbox, loggerStub;
1817

1918
beforeEach(() => {
2019
sandbox = sinon.createSandbox();
21-
winstonLoggerStub = sinon.stub(logger, "log").callsFake(() => {});
20+
loggerStub = sinon.stub(logger, "log").callsFake(() => {});
2221
});
2322

2423
afterEach(() => {
@@ -36,18 +35,18 @@ describe("syncRunner", () => {
3635
it("parallels defined", () => {
3736
logBuildDetails(testObjects.sampleBsConfigWithParallels, buildDetails);
3837

39-
sinon.assert.calledThrice(winstonLoggerStub);
40-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `Browser Combinations: ${buildDetails.combinations}`);
41-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `Run in parallel: enabled (attempting to run on ${buildDetails.machines} machines)`);
42-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `BrowserStack Dashboard: ${buildDetails.dashboard_url}`);
38+
sinon.assert.calledThrice(loggerStub);
39+
sinon.assert.calledWithMatch(loggerStub, 'info', `Browser Combinations: ${buildDetails.combinations}`);
40+
sinon.assert.calledWithMatch(loggerStub, 'info', `Run in parallel: enabled (attempting to run on ${buildDetails.machines} machines)`);
41+
sinon.assert.calledWithMatch(loggerStub, 'info', `BrowserStack Dashboard: ${buildDetails.dashboard_url}`);
4342
});
4443
it("parallels not defined", () => {
4544
logBuildDetails(testObjects.sampleBsConfig, buildDetails);
4645

47-
sinon.assert.calledThrice(winstonLoggerStub);
48-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `Browser Combinations: ${buildDetails.combinations}`);
49-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `Run in parallel: disabled`);
50-
sinon.assert.calledWithMatch(winstonLoggerStub, 'info', `BrowserStack Dashboard: ${buildDetails.dashboard_url}`);
46+
sinon.assert.calledThrice(loggerStub);
47+
sinon.assert.calledWithMatch(loggerStub, 'info', `Browser Combinations: ${buildDetails.combinations}`);
48+
sinon.assert.calledWithMatch(loggerStub, 'info', `Run in parallel: disabled`);
49+
sinon.assert.calledWithMatch(loggerStub, 'info', `BrowserStack Dashboard: ${buildDetails.dashboard_url}`);
5150
});
5251
});
5352
});

0 commit comments

Comments
 (0)