2023-07-05 19:06:21 +02:00
|
|
|
function removeStub(service: string, method: string) {
|
2023-06-15 22:42:13 +02:00
|
|
|
return cy.request({
|
|
|
|
|
url: "http://localhost:22220/v1/stubs",
|
|
|
|
|
method: "DELETE",
|
|
|
|
|
qs: {
|
2023-07-04 13:25:40 +02:00
|
|
|
service,
|
|
|
|
|
method,
|
2023-06-15 22:42:13 +02:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-05 19:06:21 +02:00
|
|
|
export function stub(service: string, method: string, out?: any) {
|
|
|
|
|
removeStub(service, method)
|
2023-06-15 22:42:13 +02:00
|
|
|
return cy.request({
|
|
|
|
|
url: "http://localhost:22220/v1/stubs",
|
|
|
|
|
method: "POST",
|
|
|
|
|
body: {
|
|
|
|
|
stubs: [
|
|
|
|
|
{
|
2023-07-04 13:25:40 +02:00
|
|
|
service,
|
|
|
|
|
method,
|
|
|
|
|
out,
|
2023-06-15 22:42:13 +02:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|