diff --git a/src/errors.ts b/src/errors.ts index 7d47399..66593a7 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -47,9 +47,9 @@ export class NoelEventListenerError extends NoelEventError { } } -export class NoelBuffeSizeNotValidError extends NoelEventError { +export class NoelBufferSizeNotValidError extends NoelEventError { constructor(message: string) { super(message); - this.name = 'NoelBuffeSizeNotValidError'; + this.name = 'NoelBufferSizeNotValidError'; } } diff --git a/src/event.ts b/src/event.ts index fd51763..7ebde89 100644 --- a/src/event.ts +++ b/src/event.ts @@ -4,7 +4,7 @@ import { NoelEvent, NoelEventConfig, NoelEventListenerManager, NoelLogger } from './interfaces'; import { NoelEventListener } from './types'; import { NoelEventListenerManagerImp } from './event-listener-manager'; -import { NoelBuffeSizeNotValidError, NoelEventConfigError, NoelEventListenerError, NoelEventReplayNotEnabled } from './errors'; +import { NoelBufferSizeNotValidError, NoelEventConfigError, NoelEventListenerError, NoelEventReplayNotEnabled } from './errors'; import NoelImp from './noel'; export class NoelEventImp implements NoelEvent { @@ -84,7 +84,7 @@ export class NoelEventImp implements NoelEvent { setReplayBufferSize(replayBufferSize: number): void { if (!this.replayEnabled) throw new NoelEventReplayNotEnabled(this); - if (replayBufferSize <= 0) throw new NoelBuffeSizeNotValidError('Replay buffer size needs to be >=1'); + if (replayBufferSize <= 0) throw new NoelBufferSizeNotValidError('Replay buffer size needs to be >=1'); this.replayBufferSize = replayBufferSize; const replayBuffer = this.replayBuffer; if (!replayBuffer) return; diff --git a/src/noel.ts b/src/noel.ts index f3dfc51..cd5fa30 100644 --- a/src/noel.ts +++ b/src/noel.ts @@ -4,7 +4,7 @@ import { Noel, NoelConfig, NoelEvent, NoelEventListenerManager, NoelLogger } from './interfaces'; import { NoelEventListener } from './types'; -import { NoelBuffeSizeNotValidError, NoelReplayNotEnabledError } from './errors'; +import { NoelBufferSizeNotValidError, NoelReplayNotEnabledError } from './errors'; import { NoelEventImp } from './event'; import { NoelLoggerImp } from './logger'; @@ -106,7 +106,7 @@ export class NoelImp implements Noel { setReplayBufferSize(replayBufferSize: number) { if (!this.replayEnabled) throw new NoelReplayNotEnabledError(); - if (replayBufferSize <= 0) throw new NoelBuffeSizeNotValidError('Replay buffer size needs to be >=1'); + if (replayBufferSize <= 0) throw new NoelBufferSizeNotValidError('Replay buffer size needs to be >=1'); this.replayBufferSize = replayBufferSize; this.setEventsReplayBuffersSize(this.replayBufferSize); } diff --git a/test/noel.test.ts b/test/noel.test.ts index a2a0c70..92a2a9d 100644 --- a/test/noel.test.ts +++ b/test/noel.test.ts @@ -1,6 +1,6 @@ import Noel from '../src/noel'; import { NoelLoggerImp } from '../src/logger'; -import { NoelBuffeSizeNotValidError, NoelEventConfigError, NoelEventListenerError, NoelEventReplayNotEnabled, NoelReplayNotEnabledError } from '../src/errors'; +import { NoelBufferSizeNotValidError, NoelEventConfigError, NoelEventListenerError, NoelEventReplayNotEnabled, NoelReplayNotEnabledError } from '../src/errors'; import { NoelEventListenerManagerImp } from '../src/event-listener-manager'; import { NoelEventImp } from '../src/event'; @@ -412,7 +412,7 @@ describe('Noel', () => { }); describe('when bufferSize <=0', () => { - it('should throw a NoelBuffeSizeNotValidError', () => { + it('should throw a NoelBufferSizeNotValidError', () => { const noel = new Noel({ replay: true, replayBufferSize: generateRandomIntegerBetween(1, 100) @@ -420,7 +420,7 @@ describe('Noel', () => { expect(() => { const newReplayBufferSize = generateRandomIntegerBetween(-100, 0); noel.setReplayBufferSize(newReplayBufferSize); - }).toThrow(NoelBuffeSizeNotValidError); + }).toThrow(NoelBufferSizeNotValidError); }); }); });