@@ -5,6 +5,10 @@ import * as assert from "assert";
55import * as vscode from "vscode" ;
66import * as path from "path" ;
77import * as fs from "fs" ;
8+ import * as BrowserHelper from "vscode-js-debug-browsers" ;
9+ import * as sinon from "sinon" ;
10+ import * as child_process from "child_process" ;
11+ import * as os from "os" ;
812import { AppLauncher } from "../../src/extension/appLauncher" ;
913import { ProjectsStorage } from "../../src/extension/projectsStorage" ;
1014import { activate , deactivate } from "../../src/extension/rn-extension" ;
@@ -174,4 +178,28 @@ suite("appLauncher", function () {
174178 assert . notStrictEqual ( nodeModulesRoot1 , nodeModulesRoot2 ) ;
175179 } ) ;
176180 } ) ;
181+ suite ( "launchBrowser" , function ( ) {
182+ test ( "expo web launch on edge browser" , async function ( ) {
183+ // test for windows only
184+ if ( os . platform ( ) === "win32" ) {
185+ try {
186+ const browserPath = {
187+ path : "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" ,
188+ } ;
189+ const browserFinderStub = sinon . stub (
190+ BrowserHelper . EdgeBrowserFinder . prototype ,
191+ "findAll" ,
192+ ) ;
193+ browserFinderStub . returns ( Promise . resolve ( [ browserPath ] ) ) ;
194+ child_process . spawn ( browserPath . path , {
195+ detached : true ,
196+ stdio : [ "ignore" ] ,
197+ } ) ;
198+ browserFinderStub . restore ( ) ;
199+ } catch ( err ) {
200+ assert . fail ( err ) ;
201+ }
202+ }
203+ } ) ;
204+ } ) ;
177205} ) ;
0 commit comments