Skip to content

Commit 1264555

Browse files
committed
test: fix array tests to handle List values
Array properties are represented as juggler `List` instance, we need to modify test assertions to convert them via `toArray()` before applying `.should.eql` check. Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
1 parent 96415ea commit 1264555

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/postgresql.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('postgresql connector', function() {
218218
post.should.have.property('tags');
219219
post.tags.should.be.Array();
220220
post.tags.length.should.eql(2);
221-
post.tags.should.eql(['AA', 'AB']);
221+
post.tags.toArray().should.eql(['AA', 'AB']);
222222
return Post.updateAll({where: {id: postId}}, {tags: ['AA', 'AC']});
223223
})
224224
.then(()=> {
@@ -228,7 +228,7 @@ describe('postgresql connector', function() {
228228
post.should.have.property('tags');
229229
post.tags.should.be.Array();
230230
post.tags.length.should.eql(2);
231-
post.tags.should.eql(['AA', 'AC']);
231+
post.tags.toArray().should.eql(['AA', 'AC']);
232232
done();
233233
})
234234
.catch((error) => {
@@ -245,7 +245,7 @@ describe('postgresql connector', function() {
245245
post.should.have.property('categories');
246246
post.categories.should.be.Array();
247247
post.categories.length.should.eql(2);
248-
post.categories.should.eql(['AA', 'AB']);
248+
post.categories.toArray().should.eql(['AA', 'AB']);
249249
return Post.updateAll({where: {id: postId}}, {categories: ['AA', 'AC']});
250250
})
251251
.then(()=> {
@@ -255,7 +255,7 @@ describe('postgresql connector', function() {
255255
post.should.have.property('categories');
256256
post.categories.should.be.Array();
257257
post.categories.length.should.eql(2);
258-
post.categories.should.eql(['AA', 'AC']);
258+
post.categories.toArray().should.eql(['AA', 'AC']);
259259
done();
260260
})
261261
.catch((error) => {

0 commit comments

Comments
 (0)