@@ -9,6 +9,7 @@ import * as Extensions from '../../vscode/extensions'
99import * as Python from '../../extensions/python'
1010import * as WorkspaceFolders from '../../vscode/workspaceFolders'
1111import { ConfigKey , setConfigValue } from '../../vscode/config'
12+ import { dvcDemoPath } from '../util'
1213
1314suite ( 'Config Test Suite' , ( ) => {
1415 const disposable = Disposable . fn ( )
@@ -76,15 +77,13 @@ suite('Config Test Suite', () => {
7677 setupTriggeredCount = setupTriggeredCount + 1
7778 } )
7879 )
79- const mockDvcMonoRepo = Uri . file ( resolve ( 'mono-repo' ) ) . fsPath
80+ const mockDvcMonoRepo = Uri . file ( resolve ( dvcDemoPath ) ) . fsPath
8081 const mockGetWorkspaceFolders = stub (
8182 WorkspaceFolders ,
8283 'getWorkspaceFolders'
8384 ) . returns ( [ mockDvcMonoRepo ] )
84- const mockDvcSubRoot1 = Uri . file ( join ( mockDvcMonoRepo , 'subroot1' ) ) . fsPath
85- const mockDvcSubRoot2 = Uri . file (
86- join ( mockDvcMonoRepo , 'subroot2' , 'deep' , 'root' )
87- ) . fsPath
85+ const mockDvcSubRoot1 = Uri . file ( join ( mockDvcMonoRepo , 'data' ) ) . fsPath
86+ const mockDvcSubRoot2 = Uri . file ( join ( mockDvcMonoRepo , '.dvc' ) ) . fsPath
8887
8988 await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , mockDvcSubRoot1 )
9089 await configUpdated
@@ -117,7 +116,7 @@ suite('Config Test Suite', () => {
117116 expect (
118117 config . getFocusedProjects ( ) ,
119118 'should be able to focus multiple sub-projects'
120- ) . to . deep . equal ( [ mockDvcSubRoot1 , mockDvcSubRoot2 ] )
119+ ) . to . deep . equal ( [ mockDvcSubRoot1 , mockDvcSubRoot2 ] . sort ( ) )
121120 expect ( setupTriggeredCount ) . to . equal ( 2 )
122121
123122 await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , [
@@ -129,7 +128,7 @@ suite('Config Test Suite', () => {
129128 expect (
130129 config . getFocusedProjects ( ) ,
131130 'should not call setup if the value(s) inside of the option have not changed'
132- ) . to . deep . equal ( [ mockDvcSubRoot1 , mockDvcSubRoot2 ] )
131+ ) . to . deep . equal ( [ mockDvcSubRoot1 , mockDvcSubRoot2 ] . sort ( ) )
133132 expect ( setupTriggeredCount ) . to . equal ( 2 )
134133
135134 await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , [
@@ -142,7 +141,7 @@ suite('Config Test Suite', () => {
142141 expect (
143142 config . getFocusedProjects ( ) ,
144143 'should be able to focus multiple sub-projects along with the monorepo root'
145- ) . to . deep . equal ( [ mockDvcMonoRepo , mockDvcSubRoot1 , mockDvcSubRoot2 ] )
144+ ) . to . deep . equal ( [ mockDvcMonoRepo , mockDvcSubRoot1 , mockDvcSubRoot2 ] . sort ( ) )
146145 expect ( setupTriggeredCount ) . to . equal ( 3 )
147146
148147 await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , undefined )
@@ -165,11 +164,7 @@ suite('Config Test Suite', () => {
165164
166165 mockGetWorkspaceFolders . restore ( )
167166
168- await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , [
169- mockDvcSubRoot2 ,
170- mockDvcSubRoot1 ,
171- mockDvcMonoRepo
172- ] )
167+ await setConfigValue ( ConfigKey . FOCUSED_PROJECTS , [ 'a' , 'b' , 'c' ] )
173168 await configUpdated
174169
175170 expect (
0 commit comments