Skip to content

Commit 34bd68d

Browse files
committed
Bump new version 0.1.6 😆
1 parent 4d7a520 commit 34bd68d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ So, I create one by myself.
1616
__ mocks__/index.js
1717
```
1818
export default {
19-
'/api/path': ({ method, url, params, headers }) => {
19+
'/api/path': ({ method, url, params, urlparams, headers }) => {
2020
const all = Mock.mock({
2121
'list|2': [{
2222
'id|+1': 1,
@@ -27,7 +27,20 @@ export default {
2727
return Promise.resolve({
2828
data: all,
2929
});
30-
}
30+
},
31+
'/api/path/{id}': ({ method, url, params, urlparams, headers }) => {
32+
const all = Mock.mock({
33+
'list|2': [{
34+
'id|+1': 1,
35+
'name': '@first @last',
36+
'age|18-54': 1,
37+
'urlid': urlparams.id,
38+
}]
39+
}).list;
40+
return Promise.resolve({
41+
data: all,
42+
});
43+
},
3144
}
3245
```
3346
index.js

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-fetch-mock",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "fetch mock for react-native",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)