Skip to content

Commit

Permalink
Upgrade JS-commons. Updated type definitions & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Oct 8, 2024
1 parent 4a58e9e commit 9eefd1b
Show file tree
Hide file tree
Showing 23 changed files with 226 additions and 1,675 deletions.
20 changes: 0 additions & 20 deletions karma/e2e.gaIntegration.karma.conf.js

This file was deleted.

100 changes: 44 additions & 56 deletions package-lock.json

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

8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio",
"version": "10.28.1-rc.2",
"version": "11.0.0-rc.0",
"description": "Split SDK",
"files": [
"README.md",
Expand All @@ -11,7 +11,6 @@
"types",
"esm",
"src",
"scripts/ga-to-split-autorequire.js",
"client",
"server"
],
Expand Down Expand Up @@ -39,8 +38,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@splitsoftware/splitio-commons": "1.17.1-rc.1",
"@types/google.analytics": "0.0.40",
"@splitsoftware/splitio-commons": "2.0.0-rc.0",
"@types/ioredis": "^4.28.0",
"bloom-filters": "^3.0.0",
"ioredis": "^4.28.0",
Expand Down Expand Up @@ -90,7 +88,6 @@
"postbuild-cjs": "cross-env NODE_ENV=cjs node scripts/copy.packages.json.js && ./scripts/build_cjs_replace_imports.sh",
"build-umd": "rimraf umd && webpack --config webpack.dev.js --env branch=$BUILD_BRANCH && webpack --config webpack.prod.js --env branch=$BUILD_BRANCH && ./scripts/clean_umd_build.sh",
"build:npm": "npm run build-cjs && npm run build-esm",
"build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js && cp ./scripts/ga-to-split-autorequire.js umd/ga-to-split-autorequire.js",
"build": "npm run build-cjs && npm run build-esm && npm run build-umd",
"check": "npm run check:lint && npm run check:version",
"check:lint": "eslint src",
Expand All @@ -103,7 +100,6 @@
"test-browser-e2e-destroy": "cross-env NODE_ENV=test karma start karma/e2e.destroy.karma.conf.js",
"test-browser-e2e-errorCatching": "cross-env NODE_ENV=test karma start karma/e2e.errorCatching.karma.conf.js",
"test-browser-e2e-push": "cross-env NODE_ENV=test karma start karma/e2e.push.karma.conf.js",
"test-browser-e2e-gaIntegration": "cross-env NODE_ENV=test karma start karma/e2e.gaIntegration.karma.conf.js",
"test-node": "npm run test-node-unit && npm run test-node-e2e",
"test-node-unit": "cross-env NODE_ENV=test tape -r ./ts-node.register \"src/*/**/__tests__/**/!(browser).spec.js\" | tap-min",
"test-node-e2e": "npm run test-node-e2e-online && npm run test-node-e2e-offline && npm run test-node-e2e-destroy && npm run test-node-e2e-errorCatching && npm run test-node-e2e-push && npm run test-node-e2e-redis",
Expand Down
1 change: 0 additions & 1 deletion scripts/ga-to-split-autorequire.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/__tests__/browserSuites/telemetry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default async function telemetryBrowserSuite(fetchMock, t) {
oM: 0, st: 'memory', aF: 1, rF: 0, sE: false,
rR: { sp: 99999, ms: 60, im: 300, ev: 60, te: 1 } /* override featuresRefreshRate */,
uO: { s: true, e: true, a: false, st: false, t: true } /* override sdk, events and telemetry URLs */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], i: [], uC: 2 /* Default GRANTED */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], uC: 2 /* Default GRANTED */,
fsT: 0, fsI: 0
}, 'metrics/config JSON payload should be the expected');

Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/browserSuites/user-consent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function mockSubmittersRequests(fetchMock, assert, impressionFeature, eventTypeI

export default function userConsent(fetchMock, t) {

// Validate trackers, submitters and browser listener behaviour on different consent status transitions
// Validate trackers, submitters and browser listener behavior on different consent status transitions
t.test(async (assert) => {
const sendBeaconSpy = sinon.spy(window.navigator, 'sendBeacon');
let expectedTrackedImpressions = 0;
Expand All @@ -97,7 +97,7 @@ export default function userConsent(fetchMock, t) {
], ['on', 'on', 'on', 'on', 'on', 'on', 'on', 'on'], 'evaluating on SDK ready');
if (isTracking) expectedTrackedImpressions += 8;

// Trigger pagehide event to validate browser listener behaviour
// Trigger pagehide event to validate browser listener behavior
// Beacon API is used only if user consent is GRANTED
triggerPagehideEvent();
if (factory.UserConsent.getStatus() === factory.UserConsent.Status.GRANTED) {
Expand Down Expand Up @@ -137,9 +137,9 @@ export default function userConsent(fetchMock, t) {
assert.equal(trackedImpressions.length, expectedTrackedImpressions, 'Tracked impressions are the expected');
sendBeaconSpy.restore();
assert.end();
}, 'Validate trackers, submitters and browser listener behaviour on different consent status transitions');
}, 'Validate trackers, submitters and browser listener behavior on different consent status transitions');

// Validate submitter's behaviour with full queues and with events first push window
// Validate submitter's behavior with full queues and with events first push window
t.test(async (assert) => {
const config = {
...baseConfig,
Expand Down Expand Up @@ -182,6 +182,6 @@ export default function userConsent(fetchMock, t) {
await client.destroy();

assert.end();
}, 'Validate submitter\'s behaviour with full queues and with events first push window');
}, 'Validate submitter\'s behavior with full queues and with events first push window');

}
Loading

0 comments on commit 9eefd1b

Please sign in to comment.