A / superagent-mocker

Pretty simple in-browser mocks for CRUD and REST API
132 stars 32 forks source link

WIP: resolve gh-39 #40

Open jamesplease opened 8 years ago

jamesplease commented 8 years ago

This is part of, but not all of, resolving gh-39


Superagent allows you to abort requests by using req.abort(). The way this usually works is...

const req = superagent
   .get()
   .whatevs()
   .end();

// later on..
req.abort()

superagent-mocker doesn't return this from its mocked end, so this adds that back in. However, req.abort doesn't seem to be working, so I'm still investigating that.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 20de1e3bd526dc05d16a229066a470050fbda28e on jmeas:patch-1 into e42c9043e72aa420bca0514feb77e8fc1840cd6a on A:master.

jamesplease commented 8 years ago

This will require more work, but...I'm surprised this lib doesn't support this! Aborting requests is pretty important. @A, any clues as to the changes required to make this lib work with aborting?