From d83d7e7f860c4e4573eef5792587b2c0df6e5f66 Mon Sep 17 00:00:00 2001 From: Robert Ing Date: Wed, 29 Nov 2023 16:56:12 -0500 Subject: [PATCH] Rename files --- rollup.test.config.js | 2 +- test/jest/sideloadedKit.spec.ts | 2 +- test/src/{_index.ts => __test.index.ts} | 2 +- test/src/{config.ts => config/constants.ts} | 2 +- test/src/{_test.setup.ts => config/setup.ts} | 4 ++-- test/src/{ => config}/utils.js | 4 ++-- test/src/tests-apiClient.ts | 2 +- test/src/tests-batchUploader.ts | 6 +++--- test/src/tests-beaconUpload.ts | 4 ++-- test/src/tests-config-api-client.ts | 4 ++-- test/src/tests-consent.ts | 6 +++--- test/src/tests-cookie-syncing.js | 4 ++-- test/src/tests-core-sdk.js | 5 ++--- test/src/tests-eCommerce.js | 4 ++-- test/src/tests-event-logging.js | 4 ++-- test/src/tests-forwarders.js | 5 ++--- test/src/tests-helpers.js | 2 +- test/src/tests-identities-attributes.js | 4 ++-- test/src/tests-identity.js | 4 ++-- test/src/tests-kit-blocking.ts | 6 +++--- test/src/tests-mParticleUser.js | 4 ++-- test/src/tests-mparticle-instance-manager.js | 4 ++-- test/src/tests-native-sdk.js | 4 ++-- test/src/tests-persistence.ts | 4 ++-- test/src/tests-queue-public-methods.js | 2 +- test/src/tests-runtimeToBatchEventsDTO.ts | 4 ++-- test/src/tests-self-hosting-specific.js | 4 ++-- test/src/tests-serverModel.ts | 2 +- test/src/tests-session-manager.ts | 2 +- test/src/tests-store.ts | 4 ++-- 30 files changed, 54 insertions(+), 56 deletions(-) rename test/src/{_index.ts => __test.index.ts} (97%) rename test/src/{config.ts => config/constants.ts} (97%) rename test/src/{_test.setup.ts => config/setup.ts} (90%) rename test/src/{ => config}/utils.js (99%) diff --git a/rollup.test.config.js b/rollup.test.config.js index 453e4766..d5f11801 100644 --- a/rollup.test.config.js +++ b/rollup.test.config.js @@ -10,7 +10,7 @@ const extensions = ['.js', '.ts']; const builds = { main: { - input: 'test/src/_index.ts', + input: 'test/src/__test.index.ts', output: { file: 'test/test-bundle.js', format: 'iife', diff --git a/test/jest/sideloadedKit.spec.ts b/test/jest/sideloadedKit.spec.ts index 0bda032f..5086c70d 100644 --- a/test/jest/sideloadedKit.spec.ts +++ b/test/jest/sideloadedKit.spec.ts @@ -3,7 +3,7 @@ import { IMPSideloadedKitConstructor } from "../../src/sideloadedKit"; import { EventTypeEnum, IdentityType } from "../../src/types.interfaces"; import { UnregisteredKit } from '../../src/forwarders.interfaces'; import { IKitFilterSettings } from '../../src/configAPIClient'; -import { mParticle } from "../src/config"; +import { mParticle } from "../src/config/constants"; const mockKitInstance: UnregisteredKit = { register: function() {} diff --git a/test/src/_index.ts b/test/src/__test.index.ts similarity index 97% rename from test/src/_index.ts rename to test/src/__test.index.ts index 65d06132..d7134b5c 100644 --- a/test/src/_index.ts +++ b/test/src/__test.index.ts @@ -1,5 +1,5 @@ // Import set up logic -import './_test.setup'; +import './config/setup'; // Import each test module import './tests-core-sdk'; diff --git a/test/src/config.ts b/test/src/config/constants.ts similarity index 97% rename from test/src/config.ts rename to test/src/config/constants.ts index 7f4aade4..869e8fb9 100644 --- a/test/src/config.ts +++ b/test/src/config/constants.ts @@ -1,4 +1,4 @@ -import { SDKInitConfig } from "../../src/sdkRuntimeModels"; +import { SDKInitConfig } from "../../../src/sdkRuntimeModels"; export const urls = { events: 'https://jssdks.mparticle.com/v3/JS/test_key/events', diff --git a/test/src/_test.setup.ts b/test/src/config/setup.ts similarity index 90% rename from test/src/_test.setup.ts rename to test/src/config/setup.ts index 2611ea48..9d630d7f 100644 --- a/test/src/_test.setup.ts +++ b/test/src/config/setup.ts @@ -1,5 +1,5 @@ -import { MPConfig, workspaceToken } from './config'; -import { MParticleWebSDK } from '../../src/sdkRuntimeModels'; +import { MPConfig, workspaceToken } from './constants'; +import { MParticleWebSDK } from '../../../src/sdkRuntimeModels'; declare global { interface Window { diff --git a/test/src/utils.js b/test/src/config/utils.js similarity index 99% rename from test/src/utils.js rename to test/src/config/utils.js index 4dc27e89..e2183398 100644 --- a/test/src/utils.js +++ b/test/src/config/utils.js @@ -1,4 +1,4 @@ -import * as Utils from '../../src/utils'; +import * as Utils from '../../../src/utils'; import { apiKey, testMPID, @@ -8,7 +8,7 @@ import { workspaceToken, workspaceCookieName, das, -} from './config'; +} from './constants'; var pluses = /\+/g, getLocalStorageProducts = function getLocalStorageProducts() { diff --git a/test/src/tests-apiClient.ts b/test/src/tests-apiClient.ts index bf271027..af2bd57c 100644 --- a/test/src/tests-apiClient.ts +++ b/test/src/tests-apiClient.ts @@ -1,6 +1,6 @@ import Types from '../../src/types'; import Constants from '../../src/constants'; -import { apiKey, MPConfig } from './config'; +import { apiKey, MPConfig } from './config/constants'; import { MParticleWebSDK } from '../../src/sdkRuntimeModels'; import { expect } from 'chai'; diff --git a/test/src/tests-batchUploader.ts b/test/src/tests-batchUploader.ts index 5742bcab..43d2905a 100644 --- a/test/src/tests-batchUploader.ts +++ b/test/src/tests-batchUploader.ts @@ -1,6 +1,6 @@ import sinon from 'sinon'; -import { urls } from './config'; -import { apiKey, MPConfig, testMPID } from './config'; +import { urls } from './config/constants'; +import { apiKey, MPConfig, testMPID } from './config/constants'; import { BaseEvent, MParticleWebSDK, @@ -8,7 +8,7 @@ import { SDKProductActionType, } from '../../src/sdkRuntimeModels'; import { Batch, CustomEventData } from '@mparticle/event-models'; -import Utils from './utils'; +import Utils from './config/utils'; import { BatchUploader } from '../../src/batchUploader'; import { expect } from 'chai'; import _BatchValidator from '../../src/mockBatchCreator'; diff --git a/test/src/tests-beaconUpload.ts b/test/src/tests-beaconUpload.ts index 608adba8..3bb85484 100644 --- a/test/src/tests-beaconUpload.ts +++ b/test/src/tests-beaconUpload.ts @@ -1,8 +1,8 @@ import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; import { expect } from 'chai'; -import { urls } from './config'; -import { apiKey, MPConfig, testMPID } from './config'; +import { urls } from './config/constants'; +import { apiKey, MPConfig, testMPID } from './config/constants'; import { MParticleWebSDK } from '../../src/sdkRuntimeModels'; import { event0 } from '../fixtures/events'; import { batch1, batch2, batch3 } from '../fixtures/batches'; diff --git a/test/src/tests-config-api-client.ts b/test/src/tests-config-api-client.ts index 3141e364..f101e4df 100644 --- a/test/src/tests-config-api-client.ts +++ b/test/src/tests-config-api-client.ts @@ -1,6 +1,6 @@ import sinon from 'sinon'; -import { urls } from './config'; -import { apiKey, MPConfig } from './config'; +import { urls } from './config/constants'; +import { apiKey, MPConfig } from './config/constants'; import { expect } from 'chai'; import ConfigAPIClient, { IConfigAPIClient, diff --git a/test/src/tests-consent.ts b/test/src/tests-consent.ts index a28364ac..e76d7e2f 100644 --- a/test/src/tests-consent.ts +++ b/test/src/tests-consent.ts @@ -1,8 +1,8 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls } from './config'; -import { apiKey, MPConfig, testMPID } from './config'; +import { urls } from './config/constants'; +import { apiKey, MPConfig, testMPID } from './config/constants'; import { MParticleWebSDK } from '../../src/sdkRuntimeModels'; import { expect } from 'chai'; import { GDPRConsentState, PrivacyConsentState } from '@mparticle/web-sdk'; diff --git a/test/src/tests-cookie-syncing.js b/test/src/tests-cookie-syncing.js index 6fea0cb7..39bcb878 100644 --- a/test/src/tests-cookie-syncing.js +++ b/test/src/tests-cookie-syncing.js @@ -1,7 +1,7 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls, testMPID, MPConfig, v4LSKey, apiKey } from './config'; +import { urls, testMPID, MPConfig, v4LSKey, apiKey } from './config/constants'; const { setLocalStorage, MockForwarder, getLocalStorage } = Utils; diff --git a/test/src/tests-core-sdk.js b/test/src/tests-core-sdk.js index 5fc409dc..d7a4ec6f 100644 --- a/test/src/tests-core-sdk.js +++ b/test/src/tests-core-sdk.js @@ -1,10 +1,9 @@ -import Utils from './utils'; +import Utils from './config/utils'; import Store from '../../src/store'; import Constants from '../../src/constants'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls } from './config'; -import { apiKey, das, MPConfig, testMPID, workspaceCookieName } from './config'; +import { urls, apiKey, das, MPConfig, testMPID, workspaceCookieName } from './config/constants'; const DefaultConfig = Constants.DefaultConfig, setLocalStorage = Utils.setLocalStorage, diff --git a/test/src/tests-eCommerce.js b/test/src/tests-eCommerce.js index 9082f213..19d3a248 100644 --- a/test/src/tests-eCommerce.js +++ b/test/src/tests-eCommerce.js @@ -1,7 +1,7 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls, apiKey, workspaceToken, MPConfig, testMPID, ProductActionType, PromotionActionType } from './config'; +import { urls, apiKey, workspaceToken, MPConfig, testMPID, ProductActionType, PromotionActionType } from './config/constants'; const getLocalStorageProducts = Utils.getLocalStorageProducts, forwarderDefaultConfiguration = Utils.forwarderDefaultConfiguration, diff --git a/test/src/tests-event-logging.js b/test/src/tests-event-logging.js index 1aa54847..60a05f28 100644 --- a/test/src/tests-event-logging.js +++ b/test/src/tests-event-logging.js @@ -1,10 +1,10 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; import { urls, apiKey, testMPID, MPConfig, - MessageType } from './config'; + MessageType } from './config/constants'; const getIdentityEvent = Utils.getIdentityEvent, findEventFromRequest = Utils.findEventFromRequest, diff --git a/test/src/tests-forwarders.js b/test/src/tests-forwarders.js index d80f7ec3..633056c0 100644 --- a/test/src/tests-forwarders.js +++ b/test/src/tests-forwarders.js @@ -1,9 +1,8 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls } from './config'; -import { apiKey, MPConfig, testMPID, MessageType } from './config'; +import { urls, apiKey, MPConfig, testMPID, MessageType } from './config/constants'; import { expect } from 'chai'; const findEventFromRequest = Utils.findEventFromRequest, diff --git a/test/src/tests-helpers.js b/test/src/tests-helpers.js index fe737b1b..bd09b39b 100644 --- a/test/src/tests-helpers.js +++ b/test/src/tests-helpers.js @@ -1,4 +1,4 @@ -import { apiKey } from './config'; +import { apiKey } from './config/constants'; import sinon from 'sinon'; describe('helpers', function() { diff --git a/test/src/tests-identities-attributes.js b/test/src/tests-identities-attributes.js index a1e98b84..60c8148d 100644 --- a/test/src/tests-identities-attributes.js +++ b/test/src/tests-identities-attributes.js @@ -1,9 +1,9 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; import { urls, apiKey, testMPID, - MPConfig } from './config'; + MPConfig } from './config/constants'; const findEventFromRequest = Utils.findEventFromRequest, findBatch = Utils.findBatch, diff --git a/test/src/tests-identity.js b/test/src/tests-identity.js index 91f54fe4..43af8746 100644 --- a/test/src/tests-identity.js +++ b/test/src/tests-identity.js @@ -1,11 +1,11 @@ import Constants from '../../src/constants'; -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; import { urls, apiKey, testMPID, MPConfig, - workspaceCookieName } from './config'; + workspaceCookieName } from './config/constants'; const getLocalStorage = Utils.getLocalStorage, setLocalStorage = Utils.setLocalStorage, diff --git a/test/src/tests-kit-blocking.ts b/test/src/tests-kit-blocking.ts index ded3721d..ed744ebf 100644 --- a/test/src/tests-kit-blocking.ts +++ b/test/src/tests-kit-blocking.ts @@ -1,9 +1,9 @@ import sinon from 'sinon'; -import { urls } from './config'; -import { apiKey, MPConfig, testMPID } from './config'; +import { urls } from './config/constants'; +import { apiKey, MPConfig, testMPID } from './config/constants'; import { MParticleWebSDK, SDKEvent, SDKProductActionType, DataPlanResult, KitBlockerDataPlan } from '../../src/sdkRuntimeModels'; import * as dataPlan from './dataPlan.json'; -import Utils from './utils'; +import Utils from './config/utils'; import KitBlocker from '../../src/kitBlocking'; import Types from '../../src/types'; import { DataPlanVersion } from '@mparticle/data-planning-models'; diff --git a/test/src/tests-mParticleUser.js b/test/src/tests-mParticleUser.js index cbd60f3b..4087cd8e 100644 --- a/test/src/tests-mParticleUser.js +++ b/test/src/tests-mParticleUser.js @@ -1,6 +1,6 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; -import { urls, apiKey, MPConfig } from './config'; +import { urls, apiKey, MPConfig } from './config/constants'; const forwarderDefaultConfiguration = Utils.forwarderDefaultConfiguration, MockForwarder = Utils.MockForwarder; diff --git a/test/src/tests-mparticle-instance-manager.js b/test/src/tests-mparticle-instance-manager.js index 55299dab..463cddb3 100644 --- a/test/src/tests-mparticle-instance-manager.js +++ b/test/src/tests-mparticle-instance-manager.js @@ -1,7 +1,7 @@ import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls, MPConfig } from './config'; -import Utils from './utils'; +import { urls, MPConfig } from './config/constants'; +import Utils from './config/utils'; const findEventFromRequest = Utils.findEventFromRequest; let mockServer; diff --git a/test/src/tests-native-sdk.js b/test/src/tests-native-sdk.js index 72fa6d1e..8b98c87f 100644 --- a/test/src/tests-native-sdk.js +++ b/test/src/tests-native-sdk.js @@ -1,5 +1,5 @@ -import Utils from './utils'; -import { apiKey, MPConfig } from './config'; +import Utils from './config/utils'; +import { apiKey, MPConfig } from './config/constants'; import Constants from '../../src/constants'; const getLocalStorage = Utils.getLocalStorage, diff --git a/test/src/tests-persistence.ts b/test/src/tests-persistence.ts index a575845c..246df899 100644 --- a/test/src/tests-persistence.ts +++ b/test/src/tests-persistence.ts @@ -1,4 +1,4 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; @@ -12,7 +12,7 @@ import { LocalStorageProductsV4WithWorkSpaceName, workspaceCookieName, v4LSKey, -} from './config'; +} from './config/constants'; import { expect } from 'chai'; import { IGlobalStoreV2MinifiedKeys, diff --git a/test/src/tests-queue-public-methods.js b/test/src/tests-queue-public-methods.js index e2858897..442fda64 100644 --- a/test/src/tests-queue-public-methods.js +++ b/test/src/tests-queue-public-methods.js @@ -1,5 +1,5 @@ import sinon from 'sinon'; -import { apiKey, MPConfig, testMPID, urls } from './config'; +import { apiKey, MPConfig, testMPID, urls } from './config/constants'; import { SDKProductActionType } from '../../src/sdkRuntimeModels'; describe('Queue Public Methods', function () { diff --git a/test/src/tests-runtimeToBatchEventsDTO.ts b/test/src/tests-runtimeToBatchEventsDTO.ts index 2f6490f6..cbb32563 100644 --- a/test/src/tests-runtimeToBatchEventsDTO.ts +++ b/test/src/tests-runtimeToBatchEventsDTO.ts @@ -3,8 +3,8 @@ import { expect } from 'chai'; import Types from '../../src/types'; import { SDKEvent, MParticleWebSDK } from '../../src/sdkRuntimeModels'; import * as EventsApi from '@mparticle/event-models'; -import Utils from './utils'; -import { urls, MPConfig, apiKey } from './config'; +import Utils from './config/utils'; +import { urls, MPConfig, apiKey } from './config/constants'; declare global { interface Window { diff --git a/test/src/tests-self-hosting-specific.js b/test/src/tests-self-hosting-specific.js index 0262fc0d..a14e266a 100644 --- a/test/src/tests-self-hosting-specific.js +++ b/test/src/tests-self-hosting-specific.js @@ -1,7 +1,7 @@ -import Utils from './utils'; +import Utils from './config/utils'; import sinon from 'sinon'; import fetchMock from 'fetch-mock/esm/client'; -import { urls, apiKey, MPConfig } from './config'; +import { urls, apiKey, MPConfig } from './config/constants'; const { findEventFromRequest, findBatch } = Utils; diff --git a/test/src/tests-serverModel.ts b/test/src/tests-serverModel.ts index bed7af09..bdbd2798 100644 --- a/test/src/tests-serverModel.ts +++ b/test/src/tests-serverModel.ts @@ -1,6 +1,6 @@ import Types from '../../src/types'; import sinon from 'sinon'; -import { urls, testMPID, apiKey } from './config'; +import { urls, testMPID, apiKey } from './config/constants'; import { expect } from 'chai'; import { IUploadObject } from '../../src/serverModel'; import { AllUserAttributes, IdentityApiData } from '@mparticle/web-sdk'; diff --git a/test/src/tests-session-manager.ts b/test/src/tests-session-manager.ts index 571fc693..56af5f4b 100644 --- a/test/src/tests-session-manager.ts +++ b/test/src/tests-session-manager.ts @@ -8,7 +8,7 @@ import { urls, MessageType, MILLISECONDS_IN_ONE_MINUTE, -} from './config'; +} from './config/constants'; import { IdentityApiData } from '@mparticle/web-sdk'; import Constants from '../../src/constants'; diff --git a/test/src/tests-store.ts b/test/src/tests-store.ts index b9a5d079..f81a5fd5 100644 --- a/test/src/tests-store.ts +++ b/test/src/tests-store.ts @@ -2,8 +2,8 @@ import { expect } from 'chai'; import sinon from 'sinon'; import { SDKInitConfig } from '../../src/sdkRuntimeModels'; import Store, { IStore } from '../../src/store'; -import { MPConfig, apiKey } from './config'; -import Utils from './utils'; +import { MPConfig, apiKey } from './config/constants'; +import Utils from './config/utils'; const MockSideloadedKit = Utils.MockSideloadedKit; describe('Store', () => {