Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function () {
let data = {
headerTemplate: http.file(headerFile, "header.html"),
html: http.file(pageFile, "page.html"),
format: "A4",
};
let res = http.post(__ENV.BASE_URL + "/convert", data);
check(res, {
"is status 200": (r) => r.status === 200,
"is not status 504": (r) => r.status !== 504,
"is not status 500": (r) => r.status !== 500,
"is not status 429": (r) => r.status !== 429,
});
if (res.status !== 200) {
failCounter.add(1);
}
}
export default function () {
let data = {
headerTemplate: http.file(headerFile, "header.html"),
format: "A4",
url: "http://localhost:3001/page.html",
};
let res = http.post(__ENV.BASE_URL + "/convert", data);
check(res, {
"is status 200": (r) => r.status === 200,
"is not status 504": (r) => r.status !== 504,
"is not status 500": (r) => r.status !== 500,
"is not status 429": (r) => r.status !== 429,
});
if (res.status !== 200) {
failCounter.add(1);
}
}
export default function () {
let data = {
headerTemplate: http.file(headerFile, "header.html"),
html: http.file(pageFile, "page.html"),
format: "A4",
};
let res = http.post(__ENV.BASE_URL + "/convert", data);
check(res, {
"is status 200": (r) => r.status === 200,
"is not status 504": (r) => r.status !== 504,
"is not status 500": (r) => r.status !== 500,
"is not status 429": (r) => r.status !== 429,
});
if (res.status !== 200) {
failCounter.add(1);
}
}