-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datastore: make query objects mutable #808
Conversation
* var query = dataset.createQuery('Lion'); | ||
* var limitedQuery = query.clone().limit(10); | ||
*/ | ||
Query.prototype.clone = function() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Do any of the tests test for |
var operatorRegex = /[><=]/g; | ||
filter = filter.trim(); | ||
var fieldName = filter.replace(operatorRegex, '').trim(); | ||
var op = filter.substr(fieldName.length, filter.length).trim(); | ||
query.filters = query.filters || []; | ||
query.filters.push({ | ||
this.filters = this.filters || []; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
👏 |
They don't explicitly test that what is returned is the same as the original object e.g. var query = new Query(['kind1']);
var limited = query.limit(10);
assert.strictEqual(query, limited); However, there are tests that make use of the chaining - https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/test/datastore/query.js#L345 |
It's better to test for it explicitly, in case something random goes wrong with that catch all test. (maybe the last one in the chain doesn't return |
cloned query when creating nextQuery object added unit tests for return values
Sure, tests have been created! |
datastore: make query objects mutable
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: googleapis/googleapis@cfa1b37 Source-Link: googleapis/googleapis-gen@09b7666 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9
chore: relocate owl bot post processor
chore: relocate owl bot post processor
Related to #806
This makes
Query
objects mutable.