1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+
6+ import * as vscode from 'vscode' ;
7+ import { assert } from "chai" ;
8+ import { resourcesToLaunchTargets , vsls , vslsTarget } from "../../src/omnisharp/launcher" ;
9+
10+ const chai = require ( 'chai' ) ;
11+ chai . use ( require ( 'chai-arrays' ) ) ;
12+ chai . use ( require ( 'chai-fs' ) ) ;
13+
14+ suite ( `launcher:` , ( ) => {
15+
16+ test ( `Returns the LiveShare launch target when processing vsls resources` , ( ) => {
17+ const testResources : vscode . Uri [ ] = [
18+ vscode . Uri . parse ( `${ vsls } :/test.sln` ) ,
19+ vscode . Uri . parse ( `${ vsls } :/test/test.csproj` ) ,
20+ vscode . Uri . parse ( `${ vsls } :/test/Program.cs` ) ,
21+ ] ;
22+
23+ const launchTargets = resourcesToLaunchTargets ( testResources ) ;
24+
25+ const liveShareTarget = launchTargets . find ( target => target === vslsTarget ) ;
26+ assert . exists ( liveShareTarget , "Launch targets was not the Visual Studio Live Share target." ) ;
27+ } ) ;
28+
29+ test ( `Does not return the LiveShare launch target when processing local resources` , ( ) => {
30+ const testResources : vscode . Uri [ ] = [
31+ vscode . Uri . parse ( `/test.sln` ) ,
32+ vscode . Uri . parse ( `/test/test.csproj` ) ,
33+ vscode . Uri . parse ( `/test/Program.cs` ) ,
34+ ] ;
35+
36+ const launchTargets = resourcesToLaunchTargets ( testResources ) ;
37+
38+ const liveShareTarget = launchTargets . find ( target => target === vslsTarget ) ;
39+ assert . notExists ( liveShareTarget , "Launch targets contained the Visual Studio Live Share target." ) ;
40+ } ) ;
41+ } ) ;
0 commit comments