Skip to content

Commit f02fbfc

Browse files
committed
Add response for partial match
1 parent b51b6bd commit f02fbfc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/mockserver.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ async function mockserver() {
111111
requestXml.includes('<Surname>')
112112
) {
113113
const match = requestXml.match('<Surname>(.*?)<');
114-
if(match == 'Carlsson' || match == 'Beckley' || match == 'Nilsson'){
115-
responsePath = 'src/responses/user/' + method + '/' + match + '.xml';
114+
if('Carlsson'.includes(match)){
115+
responsePath = 'src/responses/user/Carlsson.xml';
116+
}
117+
else if('Beckley'.includes(match)){
118+
responsePath = 'src/responses/user/Beckley.xml';
119+
}
120+
else if ('Nilsson'.includes(match)){
121+
responsePath = 'src/responses/user/Nilsson.xml';
116122
}
117123
else{
118124
responsePath = 'src/responses/user/' + method + '.xml';

0 commit comments

Comments
 (0)