-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Run LB3 tests from LB4 when LB3 is mounted on the LB4 app #5403
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
Conversation
| it mounted on with command `npm test`. | ||
|
|
||
| We want the LoopBack 3 tests to use the LoopBack 4 server rather than the | ||
| LoopBack 3 application. The following guide shows how to run |
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.
Do we want to briefly explain why here? e.g circular dependency or something else. Feel free to ignore :D
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.
@agnes512 Taking the CoffeeShopApplication as an example, when you run the app, it sets up a LB4 rest server and mounts the LB3 app as its component. Therefore all endpoints from the LB3 app are exposed on that server.
And that's why to test those LB3 endpoints, we want to guarantee ^ as well 🙂.
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.
You can run tests in an LoopBack 3 application from the LoopBack 4 application
it mounted on with commandnpm test.
The statement is confusing. It's not clear in which directory the test would be run.
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.
We want the LoopBack 3 tests to use the LoopBack 4 server rather than the
LoopBack 3 application.
Does it use the LoopBack 3 application otherwise?
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's not clear in which directory the test would be run.
@hacksparrow The tests are kept in the LB3 application.
lb3-apptests// we want to run the tests here
srclb4app__tests__
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.
@hacksparrow I looked at the doc again, and I believe
You can run tests in an LoopBack 3 application from the LoopBack 4 application
it mounted on with commandnpm test.
says clearly which directory the test would be run: "tests in an LoopBack 3 application". Or did you mean anything else?
agnes512
left a comment
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.
Thanks for providing such clear steps! :D
|
|
||
| In your test file: | ||
|
|
||
| 1. When launch the Express server |
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.
As someone who's interested in running my LB3 app tests, I'd be confused why I need Express server.
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.
@hacksparrow see my comment in #5403 (comment)
I think you are confused because you are new to this example. Please note the doc is added in the README.md file of the example repo.
This example demos two scenarios: "mounts lb3 app to lb4" and "mounts lb4 including lb3 to express server"
Implements #5298 and #5300
Based on the spike in #5004
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈