File tree Expand file tree Collapse file tree 4 files changed +17
-22
lines changed
Expand file tree Collapse file tree 4 files changed +17
-22
lines changed Original file line number Diff line number Diff line change 3636 "@mdi/font" : " 4.7.95" ,
3737 "@types/lodash" : " 4.14.149" ,
3838 "axios" : " 0.19.0" ,
39+ "axios-mock-adapter" : " 1.17.0" ,
3940 "class-validator" : " 0.11.0" ,
4041 "core-js" : " 3.6.1" ,
4142 "lodash" : " 4.17.15" ,
42- "mockjs" : " ^1.1.0" ,
4343 "roboto-fontface" : " *" ,
4444 "vue" : " 2.6.11" ,
4545 "vue-class-component" : " 7.1.0" ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import '@mdi/font/css/materialdesignicons.css'
88import '@/directives/throttled-click'
99import '@/directives/debounced-click'
1010import { listenToColorScheme } from '@/plugins/adaptive-color-scheme'
11- import '@/plugins/mock'
11+ import '@/plugins/axios- mock-adapter '
1212
1313Vue . config . productionTip = false
1414
Original file line number Diff line number Diff line change 1+ const axios = require ( 'axios' )
2+ const MockAdapter = require ( 'axios-mock-adapter' )
3+
4+ // All requests using this instance will have a 2 seconds delay:
5+ const mock = new MockAdapter ( axios , { delayResponse : 2000 } )
6+
7+ // Mock GET request to /users when param `searchText` is 'John'
8+ // arguments for reply are (status, data, headers)
9+ mock . onGet ( '/api/getDemo' ) . reply ( 200 , {
10+ message : '/api/getDemo success!'
11+ } )
12+
13+ mock . onGet ( '/api/delay' ) . reply ( 200 , {
14+ message : 'delay message'
15+ } )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments