open-consul/ui-v2/tests/steps/doubles/http.js
John Cowen eabb308ac2 UI: Add ember steps:list command for listing available steps (#5255)
* ui: Add ember steps:list command for listing available steps

1. Adds `command` addon to house the new command
2. Start to organize out the steps themselves, bring a bit more order to
things ready to dedupe and cleanup
2019-05-01 18:22:08 +00:00

16 lines
528 B
JavaScript

export default function(scenario, respondWith, set) {
// respondWith should set the url to return a certain response shape
scenario
.given(['the url "$url" responds with a $status status'], function(url, status) {
respondWith(url, {
status: parseInt(status),
});
})
.given(['the url "$url" responds with from yaml\n$yaml'], function(url, data) {
respondWith(url, data);
})
.given('a network latency of $number', function(number) {
set('CONSUL_LATENCY', number);
});
}