Skip to content

Commit a8af963

Browse files
committed
Fix tests
1 parent 17715f1 commit a8af963

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

test/functional/repository/delete-by-criteria/repository-delete-by-criteria.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("repository > delete methods", function () {
5454
const loadedPosts = await postRepository.find()
5555

5656
// assert
57-
loadedPosts.length.should.be.equal(3)
57+
expect(loadedPosts.length).to.equal(3)
5858
expect(loadedPosts.find((p) => p.id === 1)).to.be.undefined
5959
expect(loadedPosts.find((p) => p.id === 2)).not.to.be.undefined
6060
expect(loadedPosts.find((p) => p.id === 3)).not.to.be.undefined
@@ -89,7 +89,7 @@ describe("repository > delete methods", function () {
8989
const loadedPosts = await postRepository.find()
9090

9191
// assert
92-
loadedPosts.length.should.be.equal(2)
92+
expect(loadedPosts.length).to.equal(2)
9393
expect(loadedPosts.find((p) => p.id === 1)).not.to.be.undefined
9494
expect(loadedPosts.find((p) => p.id === 2)).to.be.undefined
9595
expect(loadedPosts.find((p) => p.id === 3)).to.be.undefined
@@ -124,7 +124,7 @@ describe("repository > delete methods", function () {
124124
const loadedPosts = await postRepository.find()
125125

126126
// assert
127-
loadedPosts.length.should.be.equal(3)
127+
expect(loadedPosts.length).to.equal(3)
128128
expect(loadedPosts.find((p) => p.title === "Super post #1")).not
129129
.to.be.undefined
130130
expect(loadedPosts.find((p) => p.title === "Super post #2")).not
@@ -163,7 +163,7 @@ describe("repository > delete methods", function () {
163163
const loadedPosts = await postRepository.find()
164164

165165
// assert
166-
loadedPosts.length.should.be.equal(0)
166+
expect(loadedPosts.length).to.equal(0)
167167
expect(loadedPosts.find((p) => p.title === "Super post #1")).to
168168
.be.undefined
169169
expect(loadedPosts.find((p) => p.title === "Super post #2")).to

test/functional/repository/update-by-criteria/repository-update-by-criteria.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ describe("repository > update methods", function () {
5555
const loadedPosts = await postRepository.find()
5656

5757
// assert
58-
loadedPosts.length.should.be.equal(4)
58+
expect(loadedPosts.length).to.equal(4)
5959
expect(
60-
loadedPosts.filter(
61-
(p) => p.title === "Super duper post #1",
62-
),
63-
).length.should.be.equal(1)
60+
loadedPosts.filter((p) => p.title === "Super duper post #1")
61+
.length,
62+
).to.equal(1)
6463
}),
6564
))
6665

@@ -93,10 +92,11 @@ describe("repository > update methods", function () {
9392
const loadedPosts = await postRepository.find()
9493

9594
// assert
96-
loadedPosts.length.should.be.equal(4)
95+
expect(loadedPosts.length).to.equal(4)
9796
expect(
98-
loadedPosts.filter((p) => p.title === "Updated post title"),
99-
).length.should.be.equal(2)
97+
loadedPosts.filter((p) => p.title === "Updated post title")
98+
.length,
99+
).to.equal(2)
100100
}),
101101
))
102102

@@ -130,10 +130,11 @@ describe("repository > update methods", function () {
130130
const loadedPosts = await postRepository.find()
131131

132132
// assert
133-
loadedPosts.length.should.be.equal(4)
133+
expect(loadedPosts.length).to.equal(4)
134134
expect(
135-
loadedPosts.filter((p) => p.title === "Updated post title"),
136-
).length.should.be.equal(2)
135+
loadedPosts.filter((p) => p.title === "Updated post title")
136+
.length,
137+
).to.equal(2)
137138
}),
138139
))
139140

@@ -164,10 +165,11 @@ describe("repository > update methods", function () {
164165
const loadedPosts = await postRepository.find()
165166

166167
// assert
167-
loadedPosts.length.should.be.equal(4)
168+
expect(loadedPosts.length).to.equal(4)
168169
expect(
169-
loadedPosts.filter((p) => p.title === "Updated post title"),
170-
).length.should.be.equal(4)
170+
loadedPosts.filter((p) => p.title === "Updated post title")
171+
.length,
172+
).to.equal(4)
171173
}),
172174
))
173175
})

0 commit comments

Comments
 (0)