@@ -4,14 +4,14 @@ import {
44 AutoEnvAttributes ,
55 EventSourceCapabilities ,
66 EventSourceInitDict ,
7- Hasher ,
87 LDLogger ,
98 PlatformData ,
109 Requests ,
1110 SdkData ,
1211} from '@launchdarkly/js-client-sdk-common' ;
1312
1413import { BrowserClient } from '../src/BrowserClient' ;
14+ import { MockHasher } from './MockHasher' ;
1515
1616function mockResponse ( value : string , statusCode : number ) {
1717 const response : Response = {
@@ -79,18 +79,6 @@ function makeRequests(): Requests {
7979 } ;
8080}
8181
82- class MockHasher implements Hasher {
83- update ( _data : string ) : Hasher {
84- return this ;
85- }
86- digest ?( _encoding : string ) : string {
87- return 'hashed' ;
88- }
89- async asyncDigest ?( _encoding : string ) : Promise < string > {
90- return 'hashed' ;
91- }
92- }
93-
9482describe ( 'given a mock platform for a BrowserClient' , ( ) => {
9583 const logger : LDLogger = {
9684 debug : jest . fn ( ) ,
@@ -141,7 +129,7 @@ describe('given a mock platform for a BrowserClient', () => {
141129 'client-side-id' ,
142130 AutoEnvAttributes . Disabled ,
143131 {
144- initialConnectionMode : 'polling' ,
132+ streaming : false ,
145133 logger,
146134 diagnosticOptOut : true ,
147135 } ,
@@ -169,7 +157,7 @@ describe('given a mock platform for a BrowserClient', () => {
169157 'client-side-id' ,
170158 AutoEnvAttributes . Disabled ,
171159 {
172- initialConnectionMode : 'polling' ,
160+ streaming : false ,
173161 logger,
174162 diagnosticOptOut : true ,
175163 eventUrlTransformer : ( url : string ) =>
@@ -202,7 +190,7 @@ describe('given a mock platform for a BrowserClient', () => {
202190 'client-side-id' ,
203191 AutoEnvAttributes . Disabled ,
204192 {
205- initialConnectionMode : 'polling' ,
193+ streaming : false ,
206194 logger,
207195 diagnosticOptOut : true ,
208196 eventUrlTransformer : ( url : string ) =>
@@ -245,7 +233,7 @@ describe('given a mock platform for a BrowserClient', () => {
245233 'client-side-id' ,
246234 AutoEnvAttributes . Disabled ,
247235 {
248- initialConnectionMode : 'polling' ,
236+ streaming : false ,
249237 logger,
250238 diagnosticOptOut : true ,
251239 eventUrlTransformer : ( url : string ) =>
0 commit comments