forked from and-digital/and-workshop-corejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path14_async_await.test.js
36 lines (27 loc) · 1.03 KB
/
14_async_await.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
describe('About async/await', () => {
//** EXERCISE
/*
1 - create an http server in node using node platform, no external npm packages: https://nodejs.org/api/http.html#http_class_http_server
the web server will return a json { message: "hello world" }
2 - create an http client using `got` https://github.com/sindresorhus/got
3 - use a promise approach to output the response to the console + test
4 - use a promise + generator approach to output the response to the console + test
5 - use an aysnc/await approach to output the response to the console + test
Note: Remove the .skip when ready to run the tests
*/
it.skip('should return { hello : "world"} with promises', done => {
expect().toEqual({
hello: 'world'
});
});
it.skip('should return { hello : "world"} with generators and promises', done => {
expect().toEqual({
hello: 'world'
});
});
it.skip('should return { hello : "world"} with async/await', done => {
expect().toEqual({
hello: 'world'
});
});
});