* Mocks Window.fetch in the given environment and exposes `env.fetchMock`. For * convenience, also exposes fetch-mock's mock() function as * `env.expectFetch(matcher, response)`. * * @param {!Object} env * @see http://www.wheresrhys.co.uk/fetch-mock/quickstart
(env)
| 281 | * @see http://www.wheresrhys.co.uk/fetch-mock/quickstart |
| 282 | */ |
| 283 | function attachFetchMock(env) { |
| 284 | fetchMock.global = env.win; |
| 285 | fetchMock._mock(); |
| 286 | |
| 287 | env.fetchMock = fetchMock; |
| 288 | env.expectFetch = fetchMock.mock.bind(fetchMock); |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Returns a wrapped version of Mocha's describe(), it() and only() methods |