-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.tk.yaml
52 lines (48 loc) · 1.29 KB
/
test.tk.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
- title: post todo - POST
POST: http://localhost:3000/todos
headers:
Content-Type: application/json
json:
number: 5
asserts:
- ok: $.resp.json.number == 5
- ok: $.resp.status == $.env.STATUS
- number: $.resp.json.number
- title: fetches TODO items - GET
GET: http://localhost:3000/todos
asserts:
- ok: $.resp.status == 200
- array: $.resp.json.tasks
- ok: $.resp.json.tasks[0] == "task one"
- number: $.resp.json.tasks[1]
- empty: $.resp.json.empty_str
- empty: $.resp.json.empty_arr
- null: $.resp.json.resp_null
exports:
header: $.resp.json.tasks[0]
- title: TODO ad items - POST
POST: http://localhost:3000/todos
headers:
Content-Type: application/json
Authorization: "{{header}}"
X-Target: $.env.STATUS
json:
task: run tests
asserts:
- ok: $.resp.status == 201
exports:
todoItem: $.resp.json.id
- title: deletes TODO items - DELETE
DELETE: "http://localhost:3000/todos/{{todoItem}}"
asserts:
- string: $.resp.json.task
- number: $.resp.json.id
- ok: $.resp.json.id == {{todoItem}}
- title: Adds Todo item - POST
POST: http://localhost:3000/todos/
json:
task: "run tests"
asserts:
- ok: $.resp.status == 201
- ok: $.resp.json.task == "run tests"
# - ok: $.resp.json.completed