Skip to content

Commit 24eb000

Browse files
Update ts tests and changelog entry
1 parent 24137dc commit 24eb000

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
10.29.0 (September XX, 2024)
2+
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
23
- Updated @splitsoftware/splitio-commons package to version 1.18.0 that includes minor updates:
34
- Added support for targeting rules based on large segments for browsers.
45
- Updated some transitive dependencies for vulnerability fixes.

ts-tests/index.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ const b: number = client.listenerCount(splitEvent);
240240
let nodeEventEmitter: NodeJS.EventEmitter = client;
241241

242242
// Ready, destroy and flush
243-
const readyPromise: Promise<void> = client.ready();
244-
const destroyPromise: Promise<void> = client.destroy();
245-
// @ts-ignore
246-
const flushPromise: Promise<void> = client.flush();
243+
let promise: Promise<void> = client.ready();
244+
promise = client.destroy();
245+
promise = SDK.destroy();
246+
// @TODO not public yet
247+
// promise = client.flush();
247248

248249
// We can call getTreatment with or without a key.
249250
treatment = client.getTreatment(splitKey, 'mySplit');
@@ -332,10 +333,11 @@ const b1: number = asyncClient.listenerCount(splitEvent);
332333
nodeEventEmitter = asyncClient;
333334

334335
// Ready, destroy and flush (same as for sync client, just for interface checking)
335-
const readyPromise1: Promise<void> = asyncClient.ready();
336-
asyncClient.destroy();
337-
// @ts-ignore
338-
asyncClient.flush();
336+
promise = asyncClient.ready();
337+
promise = asyncClient.destroy();
338+
promise = AsyncSDK.destroy();
339+
// @TODO not public yet
340+
// promise = asyncClient.flush();
339341

340342
// We can call getTreatment but always with a key.
341343
asyncTreatment = asyncClient.getTreatment(splitKey, 'mySplit');
@@ -391,7 +393,7 @@ splitView = manager.split('mySplit');
391393
splitViews = manager.splits();
392394

393395
// Manager implements ready promise.
394-
const managerReadyPromise: Promise<void> = manager.ready();
396+
promise = manager.ready();
395397

396398
// Manager implements methods from NodeJS.Events. Testing a few.
397399
manager = manager.on(splitEvent, () => { });
@@ -415,7 +417,7 @@ splitViewAsync = asyncManager.split('mySplit');
415417
splitViewsAsync = asyncManager.splits();
416418

417419
// asyncManager implements ready promise.
418-
const asyncManagerReadyPromise: Promise<void> = asyncManager.ready();
420+
promise = asyncManager.ready();
419421

420422
// asyncManager implements methods from NodeJS.Events. Testing a few.
421423
asyncManager = asyncManager.on(splitEvent, () => { });

0 commit comments

Comments
 (0)