-
Notifications
You must be signed in to change notification settings - Fork 458
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
test example with 'before' starting server #36
Comments
I wrote Using ava: import test from 'ava';
import listen from 'test-listen';
test('it works', async t => {
// initialize `srv` using `serve` from `micro` first!
const url = await listen(srv);
t.ok(/http:\/\/localhost:\d+/.test(url));
const data = await request(url);
t.same('1', data);
}); Example: |
Tnx! But than I would have to rewrite my code to fit the test...that's not what you meant, right? Your example shows a simple export:
Which is served using the micro cli. So why use the micro cli at all if we have to write tests that consume I am disliking the convenience abstraction more and more...it obfuscates stuff and does not educate people, and it leads to maintenance you don't want Why not just put out a great manual/stack on how to set it up without micro?
|
Nevermind, I figured it out...I can just start it with would be nice to have it in the readme tho ;) |
@Morriz I agree it would be nice. Also having a complete project example repository with tests. |
Hi, I was wondering if you can provide an example in the docs how to start a service from a test environment for integration testing.
The text was updated successfully, but these errors were encountered: