1- const chalk = require ( 'chalk' )
1+ module . exports = ( api , options ) => {
2+ const { info, chalk, execa } = require ( '@vue/cli-shared-utils' )
23
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' ) )
115
12- module . exports = ( api , options ) => {
136 api . registerCommand ( 'test:e2e' , {
147 description : 'run e2e tests with Cypress' ,
158 usage : 'vue-cli-service test:e2e [options]' ,
@@ -27,7 +20,6 @@ module.exports = (api, options) => {
2720 removeArg ( rawArgs , 'mode' )
2821 removeArg ( rawArgs , 'url' )
2922
30- const { info } = require ( '@vue/cli-shared-utils' )
3123 info ( `Starting e2e tests...` )
3224
3325 const { url, server } = args . url
@@ -40,7 +32,6 @@ module.exports = (api, options) => {
4032 ...rawArgs
4133 ]
4234
43- const execa = require ( 'execa' )
4435 const cypressBinPath = require . resolve ( 'cypress/bin/cypress' )
4536 const runner = execa ( cypressBinPath , cyArgs , { stdio : 'inherit' } )
4637 if ( server ) {
@@ -68,3 +59,12 @@ module.exports = (api, options) => {
6859module . exports . defaultModes = {
6960 'test:e2e' : 'production'
7061}
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