diff --git a/src/mock-service.ts b/src/mock-service.ts index 69b0639..8c46f0b 100644 --- a/src/mock-service.ts +++ b/src/mock-service.ts @@ -156,7 +156,6 @@ export function start(port = 4300) { if(foundMatch) { fullyMatchingMocks.push(checkMock); - break; } } diff --git a/src/test-mock-impl.ts b/src/test-mock-impl.ts index 5e1f484..64c22fa 100644 --- a/src/test-mock-impl.ts +++ b/src/test-mock-impl.ts @@ -10,4 +10,46 @@ mock({ } }); +mock({ + priority: 1, + method: 'POST', + url: '/test', + requestBody: { + testValue1: 'hello', + testValue2: 'world' + }, + responseStatus: 200, + responseBody: { + text: 'Hello world!' + } +}); + +mock({ + priority: 2, + method: 'POST', + url: '/test', + requestBody: { + testValue1: /^(.*)$/, + testValue2: /^(.*)$/ + }, + responseStatus: 401, + responseBody: { + text: 'Unauthorized' + } +}); + +mock({ + priority: 1, + method: 'POST', + url: '/test', + requestBody: { + testValue1: 'big', + testValue2: 'boss' + }, + responseStatus: 200, + responseBody: { + text: 'Hello world!' + } +}); + start();