From 3d9c4ec4afcbf928f2a268bccc4c6f3b33f0911e Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 4 Dec 2024 12:35:31 -0300 Subject: [PATCH] Fix some typos --- src/listeners/node.ts | 4 ++-- src/logger/__tests__/index.spec.ts | 8 ++++---- src/readiness/__tests__/readinessManager.spec.ts | 2 ++ src/readiness/__tests__/sdkReadinessManager.spec.ts | 2 +- src/storages/inRedis/__tests__/RedisAdapter.spec.ts | 2 +- src/trackers/eventTracker.ts | 2 +- src/trackers/impressionsTracker.ts | 2 +- src/utils/settingsValidation/index.ts | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/listeners/node.ts b/src/listeners/node.ts index 5089f0b5..cd957a40 100644 --- a/src/listeners/node.ts +++ b/src/listeners/node.ts @@ -56,7 +56,7 @@ export class NodeSignalListener implements ISignalListener { // Cleaned up, remove handlers. this.stop(); - // This handler prevented the default behaviour, start again. + // This handler prevented the default behavior, start again. // eslint-disable-next-line no-undef process.kill(process.pid, SIGTERM); }; @@ -72,7 +72,7 @@ export class NodeSignalListener implements ISignalListener { } if (thenable(handlerResult)) { - // Always exit, even with errors. The promise is returned for UT purposses. + // Always exit, even with errors. The promise is returned for UT purposes. return handlerResult.then(wrapUp).catch(wrapUp); } else { wrapUp(); diff --git a/src/logger/__tests__/index.spec.ts b/src/logger/__tests__/index.spec.ts index 3b6e7dec..6e76c0a5 100644 --- a/src/logger/__tests__/index.spec.ts +++ b/src/logger/__tests__/index.spec.ts @@ -97,22 +97,22 @@ function testLogLevels(levelToTest: SplitIO.LogLevel) { } -test('SPLIT LOGGER / Logger class public methods behaviour - instance.debug', () => { +test('SPLIT LOGGER / Logger class public methods behavior - instance.debug', () => { testLogLevels(LogLevels.DEBUG); }); -test('SPLIT LOGGER / Logger class public methods behaviour - instance.info', () => { +test('SPLIT LOGGER / Logger class public methods behavior - instance.info', () => { testLogLevels(LogLevels.INFO); }); -test('SPLIT LOGGER / Logger class public methods behaviour - instance.warn', () => { +test('SPLIT LOGGER / Logger class public methods behavior - instance.warn', () => { testLogLevels(LogLevels.WARN); }); -test('SPLIT LOGGER / Logger class public methods behaviour - instance.error', () => { +test('SPLIT LOGGER / Logger class public methods behavior - instance.error', () => { testLogLevels(LogLevels.ERROR); }); diff --git a/src/readiness/__tests__/readinessManager.spec.ts b/src/readiness/__tests__/readinessManager.spec.ts index e59a3cba..9e2cf34a 100644 --- a/src/readiness/__tests__/readinessManager.spec.ts +++ b/src/readiness/__tests__/readinessManager.spec.ts @@ -214,6 +214,8 @@ test('READINESS MANAGER / Cancel timeout if ready fired', (done) => { const readinessManager = readinessManagerFactory(EventEmitter, settingsWithTimeout); readinessManager.init(); // Start the timeout + readinessManager.destroy(); // Should cancel the timeout + readinessManager.init(); // Start the timeout again readinessManager.gate.on(SDK_READY_TIMED_OUT, () => { sdkReadyTimedoutCalled = true; }); readinessManager.gate.once(SDK_READY, () => { sdkReadyCalled = true; }); diff --git a/src/readiness/__tests__/sdkReadinessManager.spec.ts b/src/readiness/__tests__/sdkReadinessManager.spec.ts index 17d98102..9044fc72 100644 --- a/src/readiness/__tests__/sdkReadinessManager.spec.ts +++ b/src/readiness/__tests__/sdkReadinessManager.spec.ts @@ -201,7 +201,7 @@ describe('SDK Readiness Manager - Event emitter', () => { describe('SDK Readiness Manager - Ready promise', () => { - test('.ready() promise behaviour for clients', async () => { + test('.ready() promise behavior for clients', async () => { const sdkReadinessManager = sdkReadinessManagerFactory(EventEmitterMock, fullSettings); const ready = sdkReadinessManager.sdkStatus.ready(); diff --git a/src/storages/inRedis/__tests__/RedisAdapter.spec.ts b/src/storages/inRedis/__tests__/RedisAdapter.spec.ts index 6668803c..dba01b33 100644 --- a/src/storages/inRedis/__tests__/RedisAdapter.spec.ts +++ b/src/storages/inRedis/__tests__/RedisAdapter.spec.ts @@ -181,7 +181,7 @@ describe('STORAGE Redis Adapter', () => { expect(ioredisMock.once).toBeCalledTimes(2); // If the method was called, it should have called the `once` function twice. If that it the case we can assume that the method was called on creation. - // Reset stubs again, we'll check the behaviour calling the method directly. + // Reset stubs again, we'll check the behavior calling the method directly. clearAllMocks(); expect(ioredisMock.once).not.toBeCalled(); // Control assertion expect(ioredisMock[METHODS_TO_PROMISE_WRAP[METHODS_TO_PROMISE_WRAP.length - 1]]).not.toBeCalled(); // Control assertion diff --git a/src/trackers/eventTracker.ts b/src/trackers/eventTracker.ts index 335baf8d..8bf9a133 100644 --- a/src/trackers/eventTracker.ts +++ b/src/trackers/eventTracker.ts @@ -36,7 +36,7 @@ export function eventTrackerFactory( whenInit(() => { // Wrap in a timeout because we don't want it to be blocking. setTimeout(() => { - // copy of event, to avoid unexpected behaviour if modified by integrations + // copy of event, to avoid unexpected behavior if modified by integrations const eventDataCopy = objectAssign({}, eventData); if (properties) eventDataCopy.properties = objectAssign({}, properties); // integrationsManager does not throw errors (they are internally handled by each integration module) diff --git a/src/trackers/impressionsTracker.ts b/src/trackers/impressionsTracker.ts index 485d0694..19b42c98 100644 --- a/src/trackers/impressionsTracker.ts +++ b/src/trackers/impressionsTracker.ts @@ -60,7 +60,7 @@ export function impressionsTrackerFactory( if (impressionListener || integrationsManager) { for (let i = 0; i < impressionsToListenerCount; i++) { const impressionData: SplitIO.ImpressionData = { - // copy of impression, to avoid unexpected behaviour if modified by integrations or impressionListener + // copy of impression, to avoid unexpected behavior if modified by integrations or impressionListener impression: objectAssign({}, impressionsToListener[i]), attributes, ip, diff --git a/src/utils/settingsValidation/index.ts b/src/utils/settingsValidation/index.ts index 17fed4ea..3c7ecfe7 100644 --- a/src/utils/settingsValidation/index.ts +++ b/src/utils/settingsValidation/index.ts @@ -159,7 +159,7 @@ export function settingsValidation(config: unknown, validationParams: ISettingsV if (withDefaults.mode === LOCALHOST_MODE && maybeKey === undefined) { withDefaults.core.key = 'localhost_key'; } else { - // Keeping same behaviour than JS SDK: if settings key or TT are invalid, + // Keeping same behavior than JS SDK: if settings key or TT are invalid, // `false` value is used as bound key/TT of the default client, which leads to some issues. // @ts-ignore, @TODO handle invalid keys as a non-recoverable error? withDefaults.core.key = validateKey(log, maybeKey, LOG_PREFIX_CLIENT_INSTANTIATION);