Skip to content

Commit

Permalink
Add some tests. use [email protected]. remove unnecesary undefined ty…
Browse files Browse the repository at this point in the history
…pes. update changes file.
  • Loading branch information
Emmanuel Zamora committed Dec 15, 2023
1 parent 36af988 commit e3199ce
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 61 deletions.
9 changes: 8 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
2.0.0 (Dec XX, 2023)
- Updated @splitsoftware/splitio-browserjs package to version 0.13.0
- Updated the minimum Angular version to match Angular's support up to date. Breaking change version is regarding the Angular minimum version update, there are no breaking changes to Split's plugin API or functionality itself.
- Updated @splitsoftware/splitio-browserjs package to version 0.12.0
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.
- getTreatmentsByFlagSet and getTreatmentsByFlagSets
- getTreatmentsWithConfigByFlagSets and getTreatmentsWithConfigByFlagSets
- Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
- Added `sets` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager to expose flag sets on flag views.
- Added `defaultTreatment` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager (Related to issue https://github.com/splitio/javascript-commons/issues/225).

1.0.2 (May 16, 2023)
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and JSDocs tags.
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-angular",
"version": "2.0.0",
"version": "1.0.3-rc.0",
"description": "Split Angular utilities to simplify Split SDK browser client usage",
"scripts": {
"ng": "ng",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@angular-eslint/eslint-plugin-template": "15.2.1",
"@angular-eslint/schematics": "15.2.1",
"@angular-eslint/template-parser": "15.2.1",
"@splitsoftware/splitio-browserjs": "0.12.0",
"@splitsoftware/splitio-browserjs": "0.13.0",
"@types/jest": "^29.0.0",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
Expand Down
4 changes: 2 additions & 2 deletions projects/splitio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-angular",
"version": "2.0.0",
"version": "1.0.3-rc.0",
"description": "Split Angular utilities to simplify Split SDK browser client usage",
"repository": {
"type": "git",
Expand All @@ -21,7 +21,7 @@
"bugs": "https://github.com/splitio/angular-sdk-plugin/issues",
"homepage": "https://github.com/splitio/angular-sdk-plugin#readme",
"dependencies": {
"@splitsoftware/splitio-browserjs": "0.12.0"
"@splitsoftware/splitio-browserjs": "0.13.0"
},
"peerDependencies": {
"@angular/core": ">=15.2.1",
Expand Down
6 changes: 2 additions & 4 deletions projects/splitio/src/lib/__tests__/mocks/SplitView.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ export const mockedFeatureFlagView = [
'changeNumber': 0,
'configs': {},
'killed': false,
'name':
'test_split',
'name': 'test_split',
'trafficType': 'localhost',
'treatments': ['on'],
'defaultTreatment': 'control',
Expand All @@ -16,8 +15,7 @@ export const mockedFeatureFlagView = [
'off': '{"bannerText":"Click here."}'
},
'killed': false,
'name':
'test_split2',
'name': 'test_split2',
'trafficType': 'localhost',
'treatments': ['off'],
'defaultTreatment': 'control',
Expand Down
17 changes: 17 additions & 0 deletions projects/splitio/src/lib/__tests__/splitio.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ describe('SplitService', () => {

test('Flag sets', (done) => {
expect(service.isSDKReady).toEqual(false);

expect(service.getTreatmentsByFlagSet('set_a')).toEqual({});
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] plugin should be initialized');
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] client should be initialized first.');

expect(service.getTreatmentsWithConfigByFlagSet('set_a')).toEqual({});
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] plugin should be initialized');
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] client should be initialized first.');

expect(service.getTreatmentsByFlagSets(['set_a','set_b'])).toEqual({});
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] plugin should be initialized');
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] client should be initialized first.');

expect(service.getTreatmentsWithConfigByFlagSets(['set_a','set_b'])).toEqual({});
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] plugin should be initialized');
expect(logSpy.mock.calls[logCalls++][0]).toEqual('[ERROR] client should be initialized first.');

service.init(localhostConfig).subscribe(() => {

const mainClient = service.getSDKClient();
Expand Down
Loading

0 comments on commit e3199ce

Please sign in to comment.