Skip to content

Commit 87402da

Browse files
authored
fix (umd script test): Default logger calls console.info when logging at info level (#218)
Summary: Update UMD script test to reflect the latest expected behavior of the default logger (when the level is INFO, it calls `console.info`) Test plan: Run UMD script tests (`npm run test-umdbrowser`)
1 parent de83b9b commit 87402da

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/optimizely-sdk/lib/index.browser.umdtests.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,15 @@ describe('javascript-sdk', function() {
233233

234234
describe('automatically created logger instances', function() {
235235
beforeEach(function() {
236-
sinon.spy(console, 'log')
236+
sinon.spy(console, 'log');
237+
sinon.spy(console, 'info');
238+
sinon.spy(console, 'warn');
237239
});
238240

239241
afterEach(function() {
240242
console.log.restore();
243+
console.info.restore();
244+
console.warn.restore();
241245
});
242246

243247
it('should instantiate the logger with a custom logLevel when provided', function() {
@@ -264,10 +268,10 @@ describe('javascript-sdk', function() {
264268
datafile: testData.getTestProjectConfig(),
265269
skipJSONValidation: true
266270
});
267-
assert.strictEqual(console.log.getCalls().length, 1)
268-
call = console.log.getCalls()[0]
269-
assert.strictEqual(call.args.length, 1)
270-
assert(call.args[0].indexOf('OPTIMIZELY: Skipping JSON schema validation.') > -1)
271+
assert.strictEqual(console.info.getCalls().length, 1);
272+
call = console.info.getCalls()[0];
273+
assert.strictEqual(call.args.length, 1);
274+
assert(call.args[0].indexOf('OPTIMIZELY: Skipping JSON schema validation.') > -1);
271275
});
272276
});
273277
});

0 commit comments

Comments
 (0)