1- import { parseArgs } from 'node:util'
21import { printLog , runMain } from '../lib/executionUtils.ts'
32import { command } from '../lib/command.ts'
43import { fetchPR , getLastCommonCommit , LOCAL_BRANCH } from '../lib/gitUtils.ts'
@@ -17,20 +16,9 @@ const RELEVANT_FILE_PATTERNS = [
1716]
1817
1918runMain ( async ( ) => {
20- const {
21- values : { browser } ,
22- positionals,
23- } = parseArgs ( {
24- args : process . argv . slice ( 2 ) ,
25- options : {
26- browser : { type : 'string' } ,
27- } ,
28- allowPositionals : true ,
29- } )
30-
31- const testCommand = positionals [ 0 ]
19+ const testCommand = process . argv [ 2 ]
3220 if ( ! testCommand ) {
33- throw new Error ( 'Usage: ci-bs.ts <test:unit> [--browser <id>] ' )
21+ throw new Error ( 'Usage: ci-bs.ts <test:unit>' )
3422 }
3523
3624 const pr = await fetchPR ( LOCAL_BRANCH ! )
@@ -42,16 +30,13 @@ runMain(async () => {
4230 return
4331 }
4432
45- const environment : Record < string , string > = {
46- BS_USERNAME : getBrowserStackUsername ( ) ,
47- BS_ACCESS_KEY : getBrowserStackAccessKey ( ) ,
48- }
49-
50- if ( browser ) {
51- environment . BS_BROWSER = browser
52- }
53-
54- command `yarn ${ testCommand } :bs` . withEnvironment ( environment ) . withLogs ( ) . run ( )
33+ command `yarn ${ testCommand } :bs`
34+ . withEnvironment ( {
35+ BS_USERNAME : getBrowserStackUsername ( ) ,
36+ BS_ACCESS_KEY : getBrowserStackAccessKey ( ) ,
37+ } )
38+ . withLogs ( )
39+ . run ( )
5540} )
5641
5742function hasRelevantChanges ( baseCommit : string ) : boolean {
0 commit comments