chore(deps): update typeorm

This commit is contained in:
renovate[bot] 2022-06-25 13:48:25 +00:00 committed by Julian Tölle
parent 9900bc641d
commit ef84800ce8
22 changed files with 232 additions and 242 deletions

View file

@ -1,5 +1,6 @@
/* eslint-disable max-classes-per-file */
import { EntityRepository, Repository, SelectQueryBuilder } from "typeorm";
import { Repository, SelectQueryBuilder } from "typeorm";
import { EntityRepository } from "../database/entity-repository";
import { User } from "../users/user.entity";
import { AuthSession } from "./auth-session.entity";

View file

@ -2,8 +2,8 @@ import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { JwtModule } from "@nestjs/jwt";
import { PassportModule } from "@nestjs/passport";
import { TypeOrmModule } from "@nestjs/typeorm";
import { CookieParserMiddleware } from "../cookie-parser";
import { TypeOrmRepositoryModule } from "../database/entity-repository/typeorm-repository.module";
import { UsersModule } from "../users/users.module";
import { AuthSessionRepository } from "./auth-session.repository";
import { AuthController } from "./auth.controller";
@ -14,7 +14,7 @@ import { SpotifyStrategy } from "./strategies/spotify.strategy";
@Module({
imports: [
TypeOrmModule.forFeature([AuthSessionRepository]),
TypeOrmRepositoryModule.for([AuthSessionRepository]),
PassportModule.register({ defaultStrategy: "jwt" }),
JwtModule.registerAsync({
useFactory: (config: ConfigService) => ({

View file

@ -248,7 +248,7 @@ describe("AuthService", () => {
beforeEach(() => {
session = { id: "AUTH_SESSION" } as AuthSession;
authSessionRepository.findOne = jest.fn().mockResolvedValue(session);
authSessionRepository.findOneBy = jest.fn().mockResolvedValue(session);
});
it("returns the session", async () => {
@ -256,10 +256,10 @@ describe("AuthService", () => {
session
);
expect(authSessionRepository.findOne).toHaveBeenCalledTimes(1);
expect(authSessionRepository.findOne).toHaveBeenLastCalledWith(
"AUTH_SESSION"
);
expect(authSessionRepository.findOneBy).toHaveBeenCalledTimes(1);
expect(authSessionRepository.findOneBy).toHaveBeenLastCalledWith({
id: "AUTH_SESSION",
});
});
});

View file

@ -98,7 +98,7 @@ export class AuthService {
}
async findSession(id: string): Promise<AuthSession> {
return this.authSessionRepository.findOne(id);
return this.authSessionRepository.findOneBy({ id });
}
async findUser(id: string): Promise<User> {