File tree Expand file tree Collapse file tree
server/src/language-service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,16 +330,22 @@ export interface ComparisonSettings {
330330 attributes : string [ ] ;
331331 } [ ] ;
332332}
333- const defaultFilePath = path . join (
334- __dirname ,
335- `../../../public/defaultComparisonSetting.yaml`
336- ) ;
333+
334+ function getDefaultSettingsPath ( ) : string {
335+ if ( process . env . NODE_ENV === "test" ) {
336+ return path . join ( __dirname , `../../../public/defaultComparisonSetting.yaml` ) ;
337+ }
338+ return path . join (
339+ __dirname ,
340+ `../public/defaultComparisonSetting.yaml`
341+ ) ;
342+ }
337343
338344function loadComparisonSettings (
339345 filePath : string
340346) : ComparisonSettings | undefined {
341347 if ( filePath === "Default" ) {
342- filePath = defaultFilePath ;
348+ filePath = getDefaultSettingsPath ( ) ;
343349 }
344350 const fileStream = fs . readFileSync ( filePath , "utf-8" ) ;
345351 const comparisonSettingsInput : ComparisonSettingsInput = YAML . load (
You can’t perform that action at this time.
0 commit comments