Skip to content

Commit 4f03a76

Browse files
committed
Use correct initialization function for contract tests.
1 parent f04de7f commit 4f03a76

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

packages/sdk/browser/contract-tests/entity/src/ClientEntity.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { init, LDClient, LDLogger, LDOptions } from '@launchdarkly/js-client-sdk';
1+
import { initialize, LDClient, LDLogger, LDOptions } from '@launchdarkly/js-client-sdk';
22

33
import { CommandParams, CommandType, ValueType } from './CommandParams';
44
import { CreateInstanceParams, SDKConfigParams } from './ConfigParams';
@@ -19,7 +19,6 @@ function makeSdkConfig(options: SDKConfigParams, tag: string) {
1919
withReasons: options.clientSide.evaluationReasons,
2020
logger: makeLogger(`${tag}.sdk`),
2121
// useReport: options.clientSide.useReport,
22-
// sendEventsOnlyForVariation: true,
2322
};
2423

2524
if (options.serviceEndpoints) {
@@ -198,7 +197,7 @@ export async function newSdkClientEntity(options: CreateInstanceParams) {
198197
options.configuration.clientSide?.initialUser ||
199198
options.configuration.clientSide?.initialContext ||
200199
makeDefaultInitialContext();
201-
const client = init(options.configuration.credential || 'unknown-env-id', sdkConfig);
200+
const client = initialize(options.configuration.credential || 'unknown-env-id', sdkConfig);
202201
let failed = false;
203202
try {
204203
await Promise.race([

packages/sdk/browser/contract-tests/entity/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import './style.css';
33
import TestHarnessWebSocket from './TestHarnessWebSocket';
44

5-
// const client = init('618959580d89aa15579acf1d', AutoEnvAttributes.Enabled);
6-
75
async function runContractTests() {
86
const ws = new TestHarnessWebSocket('ws://localhost:8001');
97
ws.connect();

packages/sdk/browser/src/index.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
import {
1414
AutoEnvAttributes,
15-
BasicLogger,
1615
EvaluationSeriesContext,
1716
EvaluationSeriesData,
1817
Hook,
@@ -89,33 +88,3 @@ export function initialize(clientSideId: string, options?: LDOptions): LDClient
8988
// AutoEnvAttributes are not supported yet in the browser SDK.
9089
return new BrowserClient(clientSideId, AutoEnvAttributes.Disabled, options);
9190
}
92-
93-
/**
94-
* Provides a simple {@link LDLogger} implementation.
95-
*
96-
* This logging implementation uses a simple format that includes only the log level
97-
* and the message text. By default, output is written to `console` methods (`console.info`
98-
* for normal informational messages, `console.warn` for warnings, `console.error` for
99-
* errors, and `console.log` for debug output) and the default minimum level is `info`
100-
* (that is, debug output is suppressed). You can filter by log level or change the output
101-
* destination with [[BasicLoggerOptions]].
102-
*
103-
* To use the logger created by this function, put it into [[LDOptions.logger]]. If
104-
* you do not set [[LDOptions.logger]] to anything, the SDK uses a default logger
105-
* that is equivalent to `ld.basicLogger({ level: 'info' })`.
106-
*
107-
* @param options Configuration for the logger. If no options are specified, the
108-
* logger uses `{ level: 'info' }`.
109-
*
110-
* @example
111-
* This example shows how to use `basicLogger` in your SDK options to enable console
112-
* logging only at `warn` and `error` levels.
113-
* ```javascript
114-
* const ldOptions = {
115-
* logger: ld.basicLogger({ level: 'warn' }),
116-
* };
117-
* ```
118-
*/
119-
export function basicLogger(options: BasicLoggerOptions): LDLogger {
120-
return new BasicLogger(options);
121-
}

0 commit comments

Comments
 (0)