1
- const chalk = require ( 'chalk' )
1
+ module . exports = ( api , options ) => {
2
+ const { info, chalk, execa } = require ( '@vue/cli-shared-utils' )
2
3
3
- function removeArg ( rawArgs , arg ) {
4
- const matchRE = new RegExp ( `^--${ arg } ` )
5
- const equalRE = new RegExp ( `^--${ arg } =` )
6
- const i = rawArgs . findIndex ( arg => matchRE . test ( arg ) )
7
- if ( i > - 1 ) {
8
- rawArgs . splice ( i , equalRE . test ( rawArgs [ i ] ) ? 1 : 2 )
9
- }
10
- }
4
+ console . log ( require ( '@vue/cli-shared-utils' ) )
11
5
12
- module . exports = ( api , options ) => {
13
6
api . registerCommand ( 'test:e2e' , {
14
7
description : 'run e2e tests with Cypress' ,
15
8
usage : 'vue-cli-service test:e2e [options]' ,
@@ -27,7 +20,6 @@ module.exports = (api, options) => {
27
20
removeArg ( rawArgs , 'mode' )
28
21
removeArg ( rawArgs , 'url' )
29
22
30
- const { info } = require ( '@vue/cli-shared-utils' )
31
23
info ( `Starting e2e tests...` )
32
24
33
25
const { url, server } = args . url
@@ -40,7 +32,6 @@ module.exports = (api, options) => {
40
32
...rawArgs
41
33
]
42
34
43
- const execa = require ( 'execa' )
44
35
const cypressBinPath = require . resolve ( 'cypress/bin/cypress' )
45
36
const runner = execa ( cypressBinPath , cyArgs , { stdio : 'inherit' } )
46
37
if ( server ) {
@@ -68,3 +59,12 @@ module.exports = (api, options) => {
68
59
module . exports . defaultModes = {
69
60
'test:e2e' : 'production'
70
61
}
62
+
63
+ function removeArg ( rawArgs , arg ) {
64
+ const matchRE = new RegExp ( `^--${ arg } ` )
65
+ const equalRE = new RegExp ( `^--${ arg } =` )
66
+ const i = rawArgs . findIndex ( arg => matchRE . test ( arg ) )
67
+ if ( i > - 1 ) {
68
+ rawArgs . splice ( i , equalRE . test ( rawArgs [ i ] ) ? 1 : 2 )
69
+ }
70
+ }
0 commit comments