Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions karma/e2e.consumer.karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module.exports = function(config) {
config.set(assign({}, require('./config'), {
// list of files / patterns to load in the browser
files: [
'__tests__/consumerMode/browser_consumer.spec.js',
'__tests__/consumerMode/browser_consumer_partial.spec.js'
'__tests__/consumer/browser_consumer.spec.js',
'__tests__/consumer/browser_consumer_partial.spec.js'
],
// prepare code for the browser using rollup
preprocessors: {
'__tests__/consumerMode/*.spec.js': ['rollup']
'__tests__/consumer/*.spec.js': ['rollup']
},

// level of logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ module.exports = function(config) {
config.set(assign({}, require('./config'), {
// list of files / patterns to load in the browser
files: [
'__tests__/errors/browser.spec.js'
'__tests__/errorCatching/browser.spec.js'
],
// prepare code for the browser using rollup
preprocessors: {
'__tests__/errors/browser.spec.js': ['rollup']
'__tests__/errorCatching/browser.spec.js': ['rollup']
},

// level of logging
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js",
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "jest",
"test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errors && npm run test:e2e-push && npm run test:e2e-gaintegration && npm run test:e2e-consumer",
"test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errorCatching && npm run test:e2e-push && npm run test:e2e-gaIntegration && npm run test:e2e-consumer",
"test:e2e-logger": "karma start karma/e2e.logger.karma.conf.js",
"test:e2e-offline": "karma start karma/e2e.offline.karma.conf.js",
"test:e2e-online": "karma start karma/e2e.online.karma.conf.js",
"test:e2e-destroy": "karma start karma/e2e.destroy.karma.conf.js",
"test:e2e-errors": "karma start karma/e2e.errors.karma.conf.js",
"test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
"test:e2e-gaintegration": "karma start karma/e2e.gaintegration.karma.conf.js",
"test:e2e-gaIntegration": "karma start karma/e2e.gaIntegration.karma.conf.js",
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
"test-ts-decls": "./scripts/ts-tests.sh",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SplitFactory } from '../../index';
import { SplitFactory } from '../../';

const SDK_INSTANCES_TO_TEST = 4;

Expand Down Expand Up @@ -362,7 +362,6 @@ export default function (config, fetchMock, assert) {

};


for (i; i < SDK_INSTANCES_TO_TEST; i++) {
let splitio = SplitFactory(config);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SplitFactory } from '../../index';
import { settingsValidator } from '../../settings';
import { SplitFactory } from '../../';
import { settingsFactory } from '../../settings';
import { url } from '../testUtils';

const settings = settingsValidator({
const settings = settingsFactory({
core: {
key: 'asd'
},
Expand Down Expand Up @@ -93,6 +93,7 @@ export function withoutBindingTT(fetchMock, assert) {
assert.notOk(client.track('othertraffictype', 'my.checkout.event', null, 'asd'), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.');
}

// Not for JS Browser SDK, because it doesn't let bind traffic types to clients
export function bindingTT(fetchMock, assert) {
const localSettings = Object.assign({}, baseSettings);
localSettings.core.trafficType = 'binded_tt';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SplitFactory } from '../../index';
import { SplitFactory } from '../../';
import { splitFilters, queryStrings, groupedFilters } from '../mocks/fetchSpecificSplits';

const baseConfig = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SplitFactory } from '../../index';
import { settingsValidator } from '../../settings';
import { SplitFactory } from '../../';
import { settingsFactory } from '../../settings';
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';
import { DEBUG } from '@splitsoftware/splitio-commons/src/utils/constants';
import { url } from '../testUtils';
Expand Down Expand Up @@ -100,7 +100,7 @@ export default function (fetchMock, assert) {
};

// Mock GET endpoints before creating the client
const settings = settingsValidator(config);
const settings = settingsFactory(config);
fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 });
fetchMock.getOnce(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: { splits: [], since: 1457552620999, till: 1457552620999 } });
fetchMock.getOnce(url(settings, `/mySegments/${encodeURIComponent(config.core.key)}`), { status: 200, body: { mySegments: [] } });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import sinon from 'sinon';
import { SplitFactory } from '../../index';
import { settingsValidator } from '../../settings';

const settings = settingsValidator({
import { SplitFactory } from '../../';
import { settingsFactory } from '../../settings';

const settings = settingsFactory({
core: {
key: '<fake id>'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SplitFactory } from '../../index';
import { settingsValidator } from '../../settings';
import { SplitFactory } from '../../';
import { settingsFactory } from '../../settings';
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';
import splitChangesMock2 from '../mocks/splitchanges.since.1457552620999.json';
import mySegmentsFacundo from '../mocks/mysegments.facundo@split.io.json';
Expand All @@ -11,7 +11,7 @@ const baseUrls = {
events: 'https://events.baseurl/impressionsDebugSuite'
};

const settings = settingsValidator({
const settings = settingsFactory({
core: {
key: 'asd'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SplitFactory } from '../../index';
import { settingsValidator } from '../../settings';
import { SplitFactory } from '../../';
import { settingsFactory } from '../../settings';
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';
import splitChangesMock2 from '../mocks/splitchanges.since.1457552620999.json';
import mySegmentsFacundo from '../mocks/mysegments.facundo@split.io.json';
Expand All @@ -12,7 +12,7 @@ const baseUrls = {
events: 'https://events.baseurl/impressionsSuite'
};

const settings = settingsValidator({
const settings = settingsFactory({
core: {
key: 'asd'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SplitFactory } from '../../index';
import { SplitFactory } from '../../';
import splitChangesMockReal from '../mocks/splitchanges.real.json';
import map from 'lodash/map';
import { url } from '../testUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import EventSourceMock, { setMockListener } from '../testUtils/eventSourceMock';
window.EventSource = EventSourceMock;

import { SplitFactory, InLocalStorage } from '../../';
import { settingsValidator } from '../../settings';
import { settingsFactory } from '../../settings';

const userKey = 'nicolas@split.io';

Expand All @@ -27,7 +27,7 @@ const config = {
prefix: 'pushCornerCase'
}),
};
const settings = settingsValidator(config);
const settings = settingsFactory(config);

const MILLIS_SSE_OPEN = 100;
const MILLIS_SPLIT_KILL_EVENT = 200;
Expand Down Expand Up @@ -95,6 +95,6 @@ export function testSplitKillOnReadyFromCache(fetchMock, assert) {
const lapse = Date.now() - start;
assert.true(nearlyEqual(lapse, MILLIS_SPLIT_CHANGES_RESPONSE), 'SDK_READY once split changes arrives');

client.destroy().then(()=> { assert.end();});
client.destroy().then(() => { assert.end(); });
});
}
Loading