javascript - passthru real request with pretender.js -


i trying pass through real webservice in acceptance test in project. pretender intercepts xhr request i'm trying tell pass through example.com

according docs should able this.

var server = new pretender(function(){   this.get('https://www.example.com/:catchall', this.passthrough); }); 

or this

var server = new pretender(); server.get('https://www.example.com', server.passthrough); 

but in console.

uncaught typeerror: pretender intercepted https://www.example.com/foo/bar encountered error: handler.handler not function(…)

because

handler.handler server.passthrough , server.passthrough object?

> server.passthrough   object {numberofcalls: 1, async: undefined} 

the test passes in isolation fails when run full suite on console npm test. passes in browser. think have either race condition.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -