Merge pull request #100 from strongloop/fix/loopback-remote-invoke-updateAll
Add a test to verify PersistedModel updateAll
This commit is contained in:
commit
c03161dfe0
|
@ -32,7 +32,7 @@
|
|||
"homepage": "http://loopback.io",
|
||||
"dependencies": {
|
||||
"loopback-datasource-juggler": "^3.0.0",
|
||||
"strong-remoting": "^3.0.0"
|
||||
"strong-remoting": "^3.15.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"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