node-modules / mm

An simple but flexible mock(or say stub) package, mock mate
Other
158 stars 16 forks source link

matchURL() 判断不确准 #15

Closed gxcsoccer closed 9 years ago

gxcsoccer commented 9 years ago
var reqError = null;
var resError = 'mock res error';
mm.http.requestError('http://xxx.com/foo/bar.htm', reqError, resError);

urllib.request('http://xxx.com/foo/bar.htm', { type: 'GET' }, function(err) {
...
});

hook不了,因为经过urllib处理后path变成 /foo/bar.htm

fengmk2 commented 9 years ago

这个mock是判断pathname的,不需要写域名

Sent from my iPhone

On Dec 5, 2014, at 1:43 PM, GaoXiaochen notifications@github.com wrote:

var reqError = null; var resError = 'mock res error'; mm.http.requestError('http://xxx.com/foo/bar.htm', reqError, resError);

urllib.request('http://xxx.com/foo/bar.htm', { type: 'GET' }, function(err) { ... }); hook不了,因为经过urllib处理后path变成 /foo/bar.htm

— Reply to this email directly or view it on GitHub.

gxcsoccer commented 9 years ago

好吧,是我理解错了