Skip to content

Commit 9ba83d8

Browse files
committed
upd
1 parent 5694d72 commit 9ba83d8

File tree

2 files changed

+5
-45
lines changed

2 files changed

+5
-45
lines changed

lib/index.browser.tests.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -543,38 +543,6 @@ describe('javascript-sdk (Browser)', function() {
543543
// );
544544
// });
545545

546-
// it('should log a warning when attempting to use an event batch size other than 1', async () => {
547-
// const config = createProjectConfig(testData.getTestProjectConfigWithFeatures());
548-
// const projectConfigManager = getMockProjectConfigManager({
549-
// initConfig: config,
550-
// onRunning: Promise.resolve(),
551-
// });
552-
553-
// const client = optimizelyFactory.createInstance({
554-
// projectConfigManager,
555-
// errorHandler: fakeErrorHandler,
556-
// eventDispatcher: fakeEventDispatcher,
557-
// eventBatchSize: null,
558-
// logger,
559-
// odpOptions: {
560-
// eventBatchSize: 5,
561-
// },
562-
// });
563-
564-
// projectConfigManager.pushUpdate(config);
565-
566-
// await client.onReady();
567-
568-
// client.sendOdpEvent(ODP_EVENT_ACTION.INITIALIZED);
569-
570-
// sinon.assert.calledWith(
571-
// logger.log,
572-
// optimizelyFactory.enums.LOG_LEVEL.WARNING,
573-
// 'ODP event batch size must be 1 in the browser.'
574-
// );
575-
// assert(client.odpManager.eventManager.batchSize, 1);
576-
// });
577-
578546
// it('should send odp client_initialized on client instantiation', async () => {
579547
// const odpConfig = new OdpConfig('key', 'host', 'pixel', []);
580548
// const apiManager = new BrowserOdpEventApiManager(mockRequestHandler, logger);

lib/optimizely/index.spec.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import testData from '../tests/test_data';
2525
import { getForwardingEventProcessor } from '../event_processor/forwarding_event_processor';
2626
import { LoggerFacade } from '../modules/logging';
2727
import { createProjectConfig } from '../project_config/project_config';
28+
import { getMockLogger } from '../tests/mock/mock_logger';
2829

29-
describe('lib/optimizely', () => {
30+
describe('Optimizely', () => {
3031
const errorHandler = { handleError: function() {} };
3132

3233
const eventDispatcher = {
@@ -35,18 +36,9 @@ describe('lib/optimizely', () => {
3536

3637
const eventProcessor = getForwardingEventProcessor(eventDispatcher);
3738

38-
const createdLogger: LoggerFacade = {
39-
...logger.createLogger({
40-
logLevel: LOG_LEVEL.INFO,
41-
}),
42-
info: () => {},
43-
debug: () => {},
44-
warn: () => {},
45-
error: () => {},
46-
log: () => {},
47-
};
39+
const logger = getMockLogger();
4840

49-
const notificationCenter = createNotificationCenter({ logger: createdLogger, errorHandler });
41+
const notificationCenter = createNotificationCenter({ logger, errorHandler });
5042

5143
it('should pass ssr to the project config manager', () => {
5244
const projectConfigManager = getMockProjectConfigManager({
@@ -60,7 +52,7 @@ describe('lib/optimizely', () => {
6052
projectConfigManager,
6153
errorHandler,
6254
jsonSchemaValidator,
63-
logger: createdLogger,
55+
logger,
6456
notificationCenter,
6557
eventProcessor,
6658
isSsr: true,

0 commit comments

Comments
 (0)