Refactoring: Add PreScript.http

This commit is contained in:
2023-12-09 10:01:30 +03:30
parent 3cd00d74bf
commit 9e20ac6ec1
4 changed files with 18 additions and 50 deletions

View File

@@ -1,19 +1,4 @@
{{
const axios = require('axios');
const wait = axios.get(`${host}/products`).then(res => {
let length = res.data.length;
let exists = res.data.find(item => item.id === 78);
if(length===78 && exists){
return axios.delete(`${host}/products?id=eq.78`)
.then(res => {
return null;
})
}
return null;
})
exports.wait = wait;
}}
# @import ./PreScript.http
###
GET /products/1
@@ -22,7 +7,6 @@ GET /products/1
?? body id == 1
###
GET /products
?? status == 200
?? body length == 77