Skip to content

Commit

Permalink
Update ts tests and changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Sep 20, 2024
1 parent 24137dc commit 24eb000
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
10.29.0 (September XX, 2024)
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
- Updated @splitsoftware/splitio-commons package to version 1.18.0 that includes minor updates:
- Added support for targeting rules based on large segments for browsers.
- Updated some transitive dependencies for vulnerability fixes.
Expand Down
22 changes: 12 additions & 10 deletions ts-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,11 @@ const b: number = client.listenerCount(splitEvent);
let nodeEventEmitter: NodeJS.EventEmitter = client;

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

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

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

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

// Manager implements ready promise.
const managerReadyPromise: Promise<void> = manager.ready();
promise = manager.ready();

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

// asyncManager implements ready promise.
const asyncManagerReadyPromise: Promise<void> = asyncManager.ready();
promise = asyncManager.ready();

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

0 comments on commit 24eb000

Please sign in to comment.