Add a test to verify PersistedModel updateAll
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This commit is contained in:
parent
4ff55feb24
commit
39771be12f
|
@ -32,7 +32,7 @@
|
||||||
"homepage": "http://loopback.io",
|
"homepage": "http://loopback.io",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"loopback-datasource-juggler": "^3.0.0",
|
"loopback-datasource-juggler": "^3.0.0",
|
||||||
"strong-remoting": "^3.0.0"
|
"strong-remoting": "^3.15.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"assert": "^1.4.1",
|
"assert": "^1.4.1",
|
||||||
|
|
|
@ -373,4 +373,17 @@ describe('Remote model tests', function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Model.updateAll([where], [data])', () => {
|
||||||
|
it('returns the count of updated instances in data source', async () => {
|
||||||
|
await ServerModel.create({first: 'baby', age: 1});
|
||||||
|
await ServerModel.create({first: 'grandma', age: 80});
|
||||||
|
|
||||||
|
const result = await ClientModel.updateAll(
|
||||||
|
{age: {lt: 6}},
|
||||||
|
{last: 'young'},
|
||||||
|
);
|
||||||
|
assert.deepEqual(result, {count: 1});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue