mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 06:45:47 -04:00
refactor: adapt for typeorm 0.3
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a07b5f54d1
commit
c4975e4783
21 changed files with 131 additions and 69 deletions
|
@ -115,7 +115,7 @@ describe('UsersService', () => {
|
|||
expect(getUser.displayName).toEqual(displayname);
|
||||
});
|
||||
it('fails when user does not exits', async () => {
|
||||
jest.spyOn(userRepo, 'findOne').mockResolvedValueOnce(undefined);
|
||||
jest.spyOn(userRepo, 'findOne').mockResolvedValueOnce(null);
|
||||
await expect(service.getUserByUsername(username)).rejects.toThrow(
|
||||
NotInDBError,
|
||||
);
|
||||
|
|
|
@ -89,7 +89,7 @@ export class UsersService {
|
|||
where: { username: username },
|
||||
relations: withRelations,
|
||||
});
|
||||
if (user === undefined) {
|
||||
if (user === null) {
|
||||
throw new NotInDBError(`User with username '${username}' not found`);
|
||||
}
|
||||
return user;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue