File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,10 +190,11 @@ yargs( process.argv.slice( 2 ) )
190190 "Pass multiple by repeating the option."
191191 } ) ;
192192 } ,
193- handler : async ( { baseUrl , configFile, quiet, ...argv } ) => {
193+ handler : async ( { configFile, quiet, ...argv } ) => {
194194 console . log ( "Starting server..." ) ;
195195 const config = await readYAML ( configFile ) ;
196196 const middleware = await parseMiddleware ( config , argv ) ;
197+ const baseUrl = config . baseUrl ?? argv . baseUrl ?? "/test/" ;
197198
198199 /**
199200 * Run a simple server for loading tests in a browser.
Original file line number Diff line number Diff line change @@ -35,14 +35,6 @@ export async function run( {
3535 runId,
3636 verbose
3737} ) {
38- if ( ! baseUrl ) {
39- throw new Error ( "No baseUrl specified." ) ;
40- }
41-
42- // Ensure baseUrl ends with a slash
43- if ( ! rendsWithSlash . test ( baseUrl ) ) {
44- baseUrl += "/" ;
45- }
4638 if ( ! browserNames . length ) {
4739 browserNames = [ "chrome" ] ;
4840 }
@@ -52,6 +44,11 @@ export async function run( {
5244 ) ;
5345 }
5446
47+ // Ensure baseUrl ends with a slash
48+ if ( ! rendsWithSlash . test ( baseUrl ) ) {
49+ baseUrl += "/" ;
50+ }
51+
5552 if ( verbose ) {
5653 console . log ( browserstack ? "Running in BrowserStack." : "Running locally." ) ;
5754 }
You can’t perform that action at this time.
0 commit comments