Skip to content
Permalink
Browse files
fix(local-server): More readable API for the ManageALocalServer ability
  • Loading branch information
jan-molak committed Mar 18, 2019
1 parent 3c98923 commit 5dfe0e540c7d0fb75043c7f8faf1f172b4466868
@@ -18,7 +18,7 @@ describe('@serenity-js/local-server', () => {
stageManager = createStubInstance(StageManager);

const nadia = new Actor('Nadia', stageManager as any, frozenClock).whoCan(
ManageALocalServer.using(function(request, response) {
ManageALocalServer.running(function(request, response) {
response.setHeader('Connection', 'close');
response.end('Hello World!');
}),
@@ -23,7 +23,7 @@ describe('ManageALocalServer', () => {
}

Nadia = Actor.named('Nadia').whoCan(
ManageALocalServer.using(handler()),
ManageALocalServer.running(handler()),
CallAnApi.using(axios.create()),
);

@@ -48,7 +48,7 @@ export class ManageALocalServer implements Ability {
*
* @returns {ManageALocalServer}
*/
static using(listener: (request: http.IncomingMessage, response: http.ServerResponse) => void | net.Server) {
static running(listener: (request: http.IncomingMessage, response: http.ServerResponse) => void | net.Server) {
const server = typeof listener === 'function'
? http.createServer(listener)
: listener;

0 comments on commit 5dfe0e5

Please sign in to comment.