Skip to content

Commit

Permalink
fix dist not build of 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatAKitty committed Feb 4, 2018
1 parent 208cfd7 commit 5576f33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-fetch-mock",
"version": "0.6.0",
"version": "0.6.1",
"description": "fetch mock for react-native",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import expect from 'expect.js';
import FetchMock, { Mock } from '../src';

const fetch = new FetchMock(require('../__mocks__'), {
delay: 2000, // delay 5s
delay: 200, // delay 200ms
fetch: require('isomorphic-fetch'),
exclude: [
'https://www.amazon.com',
Expand Down Expand Up @@ -173,23 +173,23 @@ describe('test fetch mock', () => {
it('global delay', async () => {
const start = new Date().getTime();
await fetch('/api/users');
expect(new Date().getTime() - start).to.greaterThan(2000);
expect(new Date().getTime() - start).to.greaterThan(199).lessThan(210);
}).timeout(20000);

it('method delay 30ms', async () => {
const start = new Date().getTime();
await fetch('/api/users', {
delay: 30,
});
expect(new Date().getTime() - start).to.greaterThan(30);
expect(new Date().getTime() - start).to.greaterThan(29).lessThan(40);
}).timeout(20000);

it('method delay 3000ms', async () => {
const start = new Date().getTime();
await fetch('/api/users', {
delay: 3000,
});
expect(new Date().getTime() - start).to.greaterThan(3000);
expect(new Date().getTime() - start).to.greaterThan(2999).lessThan(3100);
}).timeout(20000);

});
Expand Down

0 comments on commit 5576f33

Please sign in to comment.