File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 44
55describe ( 'Vue CLI Plugin' , ( ) => {
66
7- const createService = require ( '../src/utils/createService ' ) ;
7+ const silentService = require ( '../src/utils/silentService ' ) ;
88
9- it ( 'createService' , async ( ) => {
10- const service = createService ( ) ;
9+ it ( 'silentService' , async ( ) => {
10+ const result = await silentService ( async service => {
11+ expect ( typeof service === 'object' ) . toBeTruthy ( ) ;
1112
12- expect ( typeof service === 'object' ) . toBeTruthy ( ) ;
13+ await service . run ( 'help' ) ;
1314
14- await service . run ( 'help' ) ;
15+ return true ;
16+ } ) ;
17+ expect ( result ) . toBeTruthy ( ) ;
1518 } ) ;
1619
1720 it ( 'getConfig' , ( ) => {
18- const service = createService ( ) ;
19-
21+ const config = silentService ( service => {
2022 // 加载获取所有配置
21- service . initSync ( ) ;
22- const config = service . config ;
23+ service . initSync ( ) ;
24+ return service . config ;
25+ } ) ;
2326
2427 expect ( typeof config === 'object' ) . toBeTruthy ( ) ;
2528
You can’t perform that action at this time.
0 commit comments