Skip to content

Commit

Permalink
v2.2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas committed Jan 30, 2021
1 parent ba1cd9f commit a015315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "objection",
"version": "2.2.13",
"version": "2.2.14",
"description": "An SQL-friendly ORM for Node.js",
"main": "lib/objection.js",
"license": "MIT",
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/model/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2009,8 +2009,9 @@ describe('Model', () => {

const model1 = Model1.fromJson({});

model1.$setRelated('hasMany', Model2.fromJson({ id: 1 }));
const setResult = model1.$setRelated('hasMany', Model2.fromJson({ id: 1 }));
expect(model1.hasMany).to.eql([{ id: 1 }]);
expect(setResult === model1).to.equal(true);

model1.$setRelated('hasMany', [Model2.fromJson({ id: 2 })]);
expect(model1.hasMany).to.eql([{ id: 2 }]);
Expand Down Expand Up @@ -2065,8 +2066,9 @@ describe('Model', () => {

const model1 = Model1.fromJson({});

model1.$appendRelated('hasMany', Model2.fromJson({ id: 1 }));
const appendResult = model1.$appendRelated('hasMany', Model2.fromJson({ id: 1 }));
expect(model1.hasMany).to.eql([{ id: 1 }]);
expect(appendResult === model1).to.equal(true);

model1.$appendRelated('hasMany', [Model2.fromJson({ id: 2 })]);
expect(model1.hasMany).to.eql([{ id: 1 }, { id: 2 }]);
Expand Down

0 comments on commit a015315

Please sign in to comment.