Skip to content

Commit

Permalink
test(query-typorm): Added test for withDeleted option of findById
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Sep 10, 2022
1 parent 6056386 commit 83e3eb8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,9 @@ describe('TypeOrmQueryService', (): void => {
const foundEntity = await queryService.findById(entity.testEntityPk)
expect(foundEntity).toBeUndefined()

const foundDeletedEntity = await queryService.findById(entity.testEntityPk, { withDeleted: true })
expect(foundDeletedEntity).toEqual({ ...entity, deletedAt: expect.any(Date) })

const deletedEntity = await queryService.repo.findOne({
where: { testEntityPk: entity.testEntityPk },
withDeleted: true
Expand Down

0 comments on commit 83e3eb8

Please sign in to comment.