Skip to content

Commit 689f19b

Browse files
author
Al Pal
committed
fix test server
- `mapping[request.method + “ “ + request.url];` never finds anything - mappings in mock server require base (ex: `/v1/`) in key (url)
1 parent 6d5340f commit 689f19b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var instance = delighted('DUMMY_API_KEY', {
109109
});
110110

111111
var mapping = {
112-
'/people': {
112+
'/v1/people': {
113113
status: 201,
114114
body: { email: 'foo@example.com' }
115115
}

test/support/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var http = require('http');
22

33
module.exports = function(port, mapping) {
44
var handler = function(request, response) {
5-
var mapped = mapping[request.method + " " + request.url];
5+
var mapped = mapping[request.url];
66
var body = mapped.body_raw !== undefined ? mapped.body_raw : JSON.stringify(mapped.body);
77

88
response.writeHead(mapped.status);

0 commit comments

Comments
 (0)