1.2.2 • Published 8 months ago
@jbscript/rest-runner v1.2.2
Getting Started
A simple REST API runner using Axios
Installation
Below is an example of how you can install and setup this package.
import RestRunner from "@jbscript/rest-runner";
const executor = new RestRunner();
const response = await executor.send(payload);Payload Sample
{
"url": "https://postman-echo.com/post",
"method": "POST",
"body": {
"type": "application/json",
"data": "{\n \"id\":123,\n \"name\":\"jabir\"\n}",
"form": [
{
"id": "6DZo29cPhzx6gHlobQRK6",
"key": "",
"value": "",
"enable": true
}
]
},
"authorization": {
"type": "none",
"token": "",
"username": "",
"password": ""
},
"parameters": [
{
"id": "3lZxqD5dgJJnL-SEDLziy",
"key": "",
"value": "",
"enable": true
}
],
"headers": [
{
"id": "FLMQdu6-tG_Uht495mpcv",
"key": "",
"value": "",
"enable": true
}
],
"testscript": "aq.test(\"Status code is 200\", () => {\n return aq.expect(aq.response.status).toBe(200);\n}); \n\naq.test(\"Status code is 4xx\", () => {\n return aq.expect(Math.floor(aq.response.status / 100) === 4).toBe(true);\n}); \n\n",
"timeout": 50000,
"maxRedirects": 5,
"withCredentials": false
}Roadmap
- Form Data (since form is a browser specific object / we can use form-data npm in node )
- Form Upload File
- Isolating Test Script (if browser run using webworker / in node VM2 or other alternative (Not sure maybe worker_threads or childprocess is also an option))
- Pre Script run
- tv4 for schema validation
- chai for assertion
Tips
- (browser-or-node) can be used to identify where the code is running
- (tsup) compile to commonjs and esm
1.2.0
9 months ago
1.0.19
1 year ago
1.0.18
1 year ago
1.0.17
1 year ago
1.0.16
1 year ago
1.2.2
8 months ago
1.2.1
8 months ago
1.0.22
1 year ago
1.0.20
1 year ago
1.0.25
1 year ago
1.0.24
1 year ago
1.0.23
1 year ago
1.0.29
1 year ago
1.0.28
1 year ago
1.0.27
1 year ago
1.0.33
1 year ago
1.0.32
1 year ago
1.0.31
1 year ago
1.0.30
1 year ago
1.0.37
1 year ago
1.0.36
1 year ago
1.0.35
1 year ago
1.0.34
1 year ago
1.1.1
12 months ago
1.1.0
12 months ago
1.0.39
1 year ago
1.0.38
1 year ago
1.1.9
9 months ago
1.1.8
9 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
11 months ago
1.1.3
11 months ago
1.1.2
11 months ago
1.0.40
1 year ago
1.0.44
12 months ago
1.0.43
1 year ago
1.0.42
1 year ago
1.0.41
1 year ago
1.0.45
12 months ago
1.0.11
1 year ago
1.0.15
1 year ago
1.0.14
1 year ago
1.0.13
1 year ago
1.0.12
1 year ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago