Skip to content

Commit 77db4e7

Browse files
committed
fix(test): revert findOneOrFail where test expects null after rollback
1 parent 98f01ad commit 77db4e7

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎test/functional/transaction/nested-transaction/transaction-in-entity-manager.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ describe("transaction > nested transaction", () => {
130130
}).should.not.be.rejected
131131

132132
for (const condition of conditions) {
133-
const post = await dataSource.manager.findOneOrFail(Post, {
133+
const post = await dataSource.manager.findOne(Post, {
134134
where: { title: condition.title },
135135
})
136136
if (condition.shouldExist) {
137137
expect(post).not.to.be.null
138-
post.should.be.eql({
138+
post!.should.be.eql({
139139
id: condition.id,
140140
title: condition.title,
141141
})

‎test/functional/transaction/transaction-in-entity-manager/transaction-in-entity-manager.test.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,14 @@ describe("transaction > transaction with entity manager", () => {
111111
/* skip error */
112112
}
113113

114-
const post = await dataSource.manager.findOneOrFail(Post, {
114+
const post = await dataSource.manager.findOne(Post, {
115115
where: { title: "Post #1" },
116116
})
117117
expect(post).to.be.null
118118

119-
const category = await dataSource.manager.findOneOrFail(
120-
Category,
121-
{
122-
where: { name: "Category #1" },
123-
},
124-
)
119+
const category = await dataSource.manager.findOne(Category, {
120+
where: { name: "Category #1" },
121+
})
125122
expect(category).to.be.null
126123
}),
127124
))

0 commit comments

Comments
 (0)