-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make services easy to test + docs #1311
Comments
Is this a proposal on the service we generate through the CLI tooling? |
let service: GeoService;
beforeEach(() => service = new GeoService()); ☝️ that's out of scope of DP3, as we agreed between @bajtos and @raymondfeng . However, @bajtos would still like to see an easy way how to test service configuration without App, Context, Controller. To do so, we need to figure a way how to:
Then the rest of the test can remain as described in the original issue description. |
FWIW, I have already started to look into implementing this user story. |
@bajtos For the dev experience of writing integration tests, is something like this sufficient enough? https://github.com/strongloop/loopback-next/blob/master/packages/service-proxy/test/integration/service-proxy.integration.ts. If it isn't, what kind of other functions should we provide so that the users may be able to write their tests more easily? |
IMO, the example tests in
That's something I am trying to figure out in #1347. My conclusion so far is that the story "Make services easy to test + docs #1311" is not well defined yet and we need a spike (which I am working on in #1347). |
@bajtos , since this is in the June milestone, we'd like to get it estimated soon. Is the acceptance criteria good for estimation? From the above comment, it seems like we might need to modify? thanks. |
@dhmlau added two more items to the acceptance criteria. LGTY now? |
Done 🎉 |
This is a follow-up for #1267
When consuming a service using REST connector with template-based configuration: As an app developer, I would definitely want to have few smoke tests to verify that my templates work as intended and match the API provided by the service at the other side. I would like to write an integration test that's using only the service (not the full app!), something along the following lines:
Acceptance criteria
npm test
fast enough. The tricky part: how to configure the Service datasource to use our proxy in the test, but not in production? A poor-man's workaround that may work until we implement proper support for per-env config: the tests can useprocess.env.PROXY
to instruct the underlyingrequest
module which is backing our service connectors like loopback-connector-rest.The text was updated successfully, but these errors were encountered: