You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new option called defaultDocuments that is a map from collection name to base document. An example:
require('api-test')('test/api-test',{// other options heredefaultDocuments: {Order: {// the collection name is the keyitems: [],totalPrice: 0,IsActive: true}}})
Every DB insertion would mixin with the base document (if present).
Most documents inserted into a given collection have the same base structure (like Schema in mongoose).
By now, the test writer must explicitly declare all those default values and this creates a lots of repeating boring boilerplate, like:
It would be nice not to have to repeat myself in those cases 😜
The text was updated successfully, but these errors were encountered: