2019-02-21 13:05:05 +00:00
|
|
|
export default function(scenario, respondWith, set) {
|
|
|
|
// respondWith should set the url to return a certain response shape
|
|
|
|
scenario
|
2020-01-24 12:26:28 +00:00
|
|
|
.given(['the url "$endpoint" responds with a $status status'], function(url, status) {
|
2019-02-21 13:05:05 +00:00
|
|
|
respondWith(url, {
|
|
|
|
status: parseInt(status),
|
|
|
|
});
|
|
|
|
})
|
2020-01-24 12:26:28 +00:00
|
|
|
.given(['the url "$endpoint" responds with from yaml\n$yaml'], function(url, data) {
|
2019-02-21 13:05:05 +00:00
|
|
|
respondWith(url, data);
|
|
|
|
})
|
|
|
|
.given('a network latency of $number', function(number) {
|
|
|
|
set('CONSUL_LATENCY', number);
|
|
|
|
});
|
|
|
|
}
|