Merge pull request #100 from strongloop/fix/loopback-remote-invoke-updateAll

Add a test to verify PersistedModel updateAll
This commit is contained in:
Miroslav Bajtoš 2019-10-07 11:12:09 +02:00 committed by GitHub
commit c03161dfe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -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",

View File

@ -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});
});
});
});