Update tests to use registry for model creation [2.x]#2782
Merged
Conversation
Contributor
Author
|
@bajtos : Could you please review this backport PR? Thank you. |
bajtos
suggested changes
Sep 23, 2016
Member
bajtos
left a comment
There was a problem hiding this comment.
Looks mostly good, please check two comments related to remoting.errorHandler config.
test/acl.test.js
Outdated
| var beforeHookCalled = false; | ||
|
|
||
| app.use(loopback.rest()); | ||
| app.set('remoting', { errorHandler: { debug: true, log: false }}); |
Member
There was a problem hiding this comment.
I think this errorHandler configuration was added in LB 3.x only, could you please check?
Contributor
Author
There was a problem hiding this comment.
I am not sure as I see both, errorHandler & `strong-error-handler' in package.json for 2.x. Checking that.
Contributor
Author
There was a problem hiding this comment.
I'm removing these lines as they weren't present in 2.x
test/app.test.js
Outdated
| beforeEach(function() { | ||
| app = loopback(); | ||
| db = loopback.createDataSource({connector: loopback.Memory}); | ||
| app.set('remoting', { errorHandler: { debug: true, log: false }}); |
5d88033 to
827dd12
Compare
Contributor
Author
|
@bajtos : Addressed your comments, removed use of |
Contributor
|
test please |
Current implementation of `app.model(modelName, settings)` works as a sugar for model creation. In LB 3.0, this is not supported anymore. This backporting: - keeps the sugar method for model creation for backward compatibility - updates test cases to use `app.registry.createModel()` for model creation Backport of #2401
827dd12 to
e244153
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current implementation of
app.model(modelName, settings)works as a sugar for model creation. From LB 3.0 onwards, this is
not supported.
This backporting:
compatibility
app.registry.createModel()for model creation
Backport of #2401
Connect to strongloop-internal/scrum-loopback#772