@@ -31,17 +31,20 @@ module.exports = (api, options) => {
31
31
return serverPromise . then ( ( { server, url } ) => {
32
32
// expose dev server url to tests
33
33
process . env . VUE_DEV_SERVER_URL = url
34
- // expose user options to config file
35
- const fs = require ( 'fs' )
36
- let userOptionsPath , userOptions
37
- if ( fs . existsSync ( userOptionsPath = api . resolve ( 'nightwatch.config.js' ) ) ) {
38
- userOptions = require ( userOptionsPath )
39
- } else if ( fs . existsSync ( userOptionsPath = api . resolve ( 'nightwatch.json' ) ) ) {
40
- userOptions = require ( userOptionsPath )
34
+ if ( rawArgs . indexOf ( '--config' ) === - 1 ) {
35
+ // expose user options to config file
36
+ const fs = require ( 'fs' )
37
+ let userOptionsPath , userOptions
38
+ if ( fs . existsSync ( userOptionsPath = api . resolve ( 'nightwatch.config.js' ) ) ) {
39
+ userOptions = require ( userOptionsPath )
40
+ } else if ( fs . existsSync ( userOptionsPath = api . resolve ( 'nightwatch.json' ) ) ) {
41
+ userOptions = require ( userOptionsPath )
42
+ }
43
+ process . env . VUE_NIGHTWATCH_USER_OPTIONS = JSON . stringify ( userOptions || { } )
44
+
45
+ rawArgs . push ( '--config' , require . resolve ( './nightwatch.config.js' ) )
41
46
}
42
- process . env . VUE_NIGHTWATCH_USER_OPTIONS = JSON . stringify ( userOptions || { } )
43
47
44
- rawArgs . push ( '--config' , require . resolve ( './nightwatch.config.js' ) )
45
48
if ( rawArgs . indexOf ( '--env' ) === - 1 ) {
46
49
rawArgs . push ( '--env' , 'chrome' )
47
50
}
0 commit comments