Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabriskie committed May 26, 2016
1 parent ce10986 commit 15e6066
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
@@ -1,11 +1,11 @@
# moxios
# moxios [![build status](https://img.shields.io/travis/mzabriskie/moxios.svg?style=flat-square)](https://travis-ci.org/mzabriskie/moxios)

Mock axios requests for testing

## Installing

```bash
$ npm install moxios
$ npm install moxios --save-dev
```

## Example
Expand All @@ -19,6 +19,7 @@ import { equal } from 'assert'
describe('mocking axios requests', function () {

describe('across entire suite', function () {

beforeEach(function () {
moxios.install()
})
Expand Down Expand Up @@ -72,9 +73,10 @@ describe('mocking axios requests', function () {
done()
})
})

})

describe('just for a single spec', function (done) {
it('just for a single spec', function (done) {
moxios.withMock(function () {
let onFulfilled = sinon.spy()
axios.get('/users/12345').then(onFulfilled)
Expand All @@ -93,5 +95,14 @@ describe('mocking axios requests', function () {
})
})
})

})
```

## Thanks

moxios is heavily inspired by [jasmine-ajax](https://github.com/jasmine/jasmine-ajax)

## License

MIT

0 comments on commit 15e6066

Please sign in to comment.