Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a2e2b
commit d5ba01b
Showing
7 changed files
with
259 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v1-req-v0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"v": 1, | ||
"name": "coll-v1", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"url": "https://httpbin.org", | ||
"path": "/get", | ||
"headers": [ | ||
{ "key": "Inactive-Header", "value": "Inactive Header", "active": false }, | ||
{ "key": "Authorization", "value": "Bearer token123", "active": true } | ||
], | ||
"params": [ | ||
{ "key": "key", "value": "value", "active": true }, | ||
{ "key": "inactive-key", "value": "inactive-param", "active": false } | ||
], | ||
"name": "req-v0", | ||
"method": "GET", | ||
"preRequestScript": "", | ||
"testScript": "pw.test(\"Asserts request params\", () => {\n pw.expect(pw.response.body.args.key).toBe(\"value\")\n pw.expect(pw.response.body.args[\"inactive-key\"]).toBe(undefined)\n})\n\npw.test(\"Asserts request headers\", () => {\n pw.expect(pw.response.body.headers[\"Authorization\"]).toBe(\"Bearer token123\")\n pw.expect(pw.response.body.headers[\"Inactive-Header\"]).toBe(undefined)\n})", | ||
"contentType": "application/json", | ||
"body": "", | ||
"auth": "Bearer Token", | ||
"bearerToken": "token123" | ||
} | ||
] | ||
} |
48 changes: 48 additions & 0 deletions
48
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v1-req-v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"v": 1, | ||
"name": "coll-v1", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"v": "1", | ||
"endpoint": "https://httpbin.org/get", | ||
"headers": [ | ||
{ | ||
"key": "Inactive-Header", | ||
"value": "Inactive Header", | ||
"active": false | ||
}, | ||
{ | ||
"key": "Authorization", | ||
"value": "Bearer token123", | ||
"active": true | ||
} | ||
], | ||
"params": [ | ||
{ | ||
"key": "key", | ||
"value": "value", | ||
"active": true | ||
}, | ||
{ | ||
"key": "inactive-key", | ||
"value": "inactive-param", | ||
"active": false | ||
} | ||
], | ||
"name": "req-v1", | ||
"method": "GET", | ||
"preRequestScript": "", | ||
"testScript": "pw.test(\"Asserts request params\", () => {\n pw.expect(pw.response.body.args.key).toBe(\"value\")\n pw.expect(pw.response.body.args[\"inactive-key\"]).toBe(undefined)\n})\n\npw.test(\"Asserts request headers\", () => {\n pw.expect(pw.response.body.headers[\"Authorization\"]).toBe(\"Bearer token123\")\n pw.expect(pw.response.body.headers[\"Inactive-Header\"]).toBe(undefined)\n})", | ||
"body": { | ||
"contentType": null, | ||
"body": null | ||
}, | ||
"auth": { | ||
"authType": "bearer", | ||
"authActive": true, | ||
"token": "token123" | ||
} | ||
} | ||
] | ||
} |
54 changes: 54 additions & 0 deletions
54
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v2-req-v2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"v": 2, | ||
"name": "coll-v2", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"v": "2", | ||
"endpoint": "https://httpbin.org/get", | ||
"headers": [ | ||
{ | ||
"key": "Inactive-Header", | ||
"value": "Inactive Header", | ||
"active": false | ||
}, | ||
{ | ||
"key": "Authorization", | ||
"value": "Bearer token123", | ||
"active": true | ||
} | ||
], | ||
"params": [ | ||
{ | ||
"key": "key", | ||
"value": "value", | ||
"active": true | ||
}, | ||
{ | ||
"key": "inactive-key", | ||
"value": "inactive-param", | ||
"active": false | ||
} | ||
], | ||
"name": "req-v2", | ||
"method": "GET", | ||
"preRequestScript": "", | ||
"testScript": "pw.test(\"Asserts request params\", () => {\n pw.expect(pw.response.body.args.key).toBe(\"value\")\n pw.expect(pw.response.body.args[\"inactive-key\"]).toBe(undefined)\n})\n\npw.test(\"Asserts request headers\", () => {\n pw.expect(pw.response.body.headers[\"Authorization\"]).toBe(\"Bearer token123\")\n pw.expect(pw.response.body.headers[\"Inactive-Header\"]).toBe(undefined)\n})", | ||
"body": { | ||
"contentType": null, | ||
"body": null | ||
}, | ||
"auth": { | ||
"authType": "bearer", | ||
"authActive": true, | ||
"token": "token123" | ||
}, | ||
"requestVariables": [] | ||
} | ||
], | ||
"auth": { | ||
"authType": "inherit", | ||
"authActive": true | ||
}, | ||
"headers": [] | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/hoppscotch-cli/src/__tests__/samples/collections/sample-coll.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"v": 1, | ||
"name": "tests", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"v": "2", | ||
"endpoint": "<<baseUrl>>", | ||
"name": "", | ||
"params": [], | ||
"headers": [], | ||
"method": "GET", | ||
"auth": { | ||
"authType": "none", | ||
"authActive": true | ||
}, | ||
"preRequestScript": "", | ||
"testScript": "// Check status code is 200\npw.test(\"Status code is 200\", ()=> {\n pw.expect(pw.response.status).toBe(200);\n});\n\n// Check JSON response property\npw.test(\"Check JSON response property\", ()=> {\n pw.expect(pw.response.body.method).toBe(\"GET\");\n pw.expect(pw.response.body.headers).toBeType(\"object\");\n});", | ||
"body": { | ||
"contentType": null, | ||
"body": null | ||
}, | ||
"requestVariables": [] | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/hoppscotch-cli/src/__tests__/samples/environments/env-v0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "env-v0", | ||
"variables": [ | ||
{ | ||
"key": "baseUrl", | ||
"value": "https://echo.hoppscotch.io" | ||
} | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/hoppscotch-cli/src/__tests__/samples/environments/env-v1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "env-v0", | ||
"variables": [ | ||
{ | ||
"key": "baseUrl", | ||
"value": "https://echo.hoppscotch.io", | ||
"secret": false | ||
} | ||
] | ||
} |