-
Notifications
You must be signed in to change notification settings - Fork 63
Node Tagging: #88
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
Node Tagging: #88
Conversation
lib/models/tags.js
Outdated
| 'Promise' | ||
| ]; | ||
|
|
||
| function TagModelFactory (Model, _, assert, Validatable, Anchor, Promise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Promise' is defined but never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning on using Promise later in here, or was this a "just in case" that didn't get used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take it out. I can add it back in later if/when I need it.
|
|
test this please |
|
test this please |
|
| }; | ||
|
|
||
| before(function() { | ||
| sinon.stub(this.model, "native", function(cb) { cb(null, collection); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teachme question - why stub out model.native like this? Not cluing in how it's used by the tests.... (not clear on what model.native is - are we just using it to make sure the collections got called and invoked?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is stubbed out with this pattern so the underlying code can promisify the function. It is being stubbed out to remove the mongodb dependency from the unittest. Functional/integration testing would be used to validate MongoDB behavior/interactions, not unittests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No qualms with the tactics, just trying to grok where .native normally resides. I'm not clear on where it's getting promisified. Is native something that's already in the waterline model objects and is a convenient hook for capturing the flow that would otherwise go down into the MongoDB drivers?
b1664f0 to
d6bf667
Compare
|
👍 |
|
test this please |
1 similar comment
|
test this please |
- Modify node model to have a tags array and add $addToSet and $pull native mongo commands to modify the array - Create a tags model with SKU model based rules
d6bf667 to
4207256
Compare
|
test this please |
|
|
test this please |
|
|
@zyoung51 looks like on-taskgraph is failing unit-tests with on-core applied to it. Would you mind checking it out locally? |
|
@jlongever It is passing on-taskgraph master w. on-core add-tagging locally. |
|
test this please |
|
|
test this please |
|
|
test this please |
|
test this please |
|
+1 |
|
👍 |
Add vagrant example configuration variables.
mongo commands to modify the array