diff --git a/src/entity-factory.test.ts b/src/entity-factory.test.ts index 5a266820..5649c5c3 100644 --- a/src/entity-factory.test.ts +++ b/src/entity-factory.test.ts @@ -18,7 +18,7 @@ describe('make', () => { expect(newUser.name).toBe('Steve') }) - test('Should override the enitys props', async () => { + test('Should override the entity props', async () => { const mockUserFactory = jest.fn() const userFactory = new EntityFactory('User', User, mockUserFactory) mockUserFactory.mockReturnValue(new User('Steve')) diff --git a/src/entity-factory.ts b/src/entity-factory.ts index 75cc13d0..b1c53670 100644 --- a/src/entity-factory.ts +++ b/src/entity-factory.ts @@ -32,7 +32,7 @@ export class EntityFactory { * Make a new entity, but does not persist it */ public async make(overrideParams: EntityProperty = {}): Promise { - return this.makeEnity(overrideParams, false) + return this.makeEntity(overrideParams, false) } /** @@ -44,7 +44,7 @@ export class EntityFactory { if (connection && connection.isConnected) { const em = connection.createEntityManager() try { - const entity = await this.makeEnity(overrideParams, true) + const entity = await this.makeEntity(overrideParams, true) return await em.save(entity, saveOptions) } catch (error) { const message = 'Could not save entity' @@ -92,7 +92,7 @@ export class EntityFactory { // Private Helpers // ------------------------------------------------------------------------- - private async makeEnity(overrideParams: EntityProperty = {}, isSeeding = false): Promise { + private async makeEntity(overrideParams: EntityProperty = {}, isSeeding = false): Promise { if (!this.factory) { throw new Error('Could not found entity') } diff --git a/src/utils/factory.test.ts b/src/utils/factory.test.ts index 4752203a..9175f6a0 100644 --- a/src/utils/factory.test.ts +++ b/src/utils/factory.test.ts @@ -1,19 +1,19 @@ import { getNameOfEntity, isPromiseLike } from './factory.util' describe('getNameOfClass', () => { - test('Passing UserEnity class should return the name of the class', () => { + test('Passing UserEntity class should return the name of the class', () => { class UserEntity {} expect(getNameOfEntity(UserEntity)).toBe('UserEntity') }) - test('Passing UserEnity function should return the name of the function', () => { + test('Passing UserEntity function should return the name of the function', () => { const UserEntity = (): any => void 0 expect(getNameOfEntity(UserEntity)).toBe('UserEntity') }) - test('Passing undefinde as a enity-class should throw an error', () => { + test('Passing undefinde as a entity-class should throw an error', () => { try { getNameOfEntity(undefined) } catch (error) { - expect(error.message).toBe('Enity is not defined') + expect(error.message).toBe('Entity is not defined') } }) }) diff --git a/src/utils/factory.util.ts b/src/utils/factory.util.ts index 06b3311a..92952604 100644 --- a/src/utils/factory.util.ts +++ b/src/utils/factory.util.ts @@ -6,7 +6,7 @@ export const getNameOfEntity = (entity: ObjectType): string => { } else if (entity) { return new (entity as any)().constructor.name } - throw new Error('Enity is not defined') + throw new Error('Entity is not defined') } export const isPromiseLike = (o: any): boolean =>