@@ -2,6 +2,7 @@ import * as fs from 'fs-extra';
22import * as path from 'path' ;
33import { DbConfigStore } from '../../../src/databases/db-config-store' ;
44import { expect } from 'chai' ;
5+ import { createMockApp } from '../../__mocks__/appMock' ;
56
67describe ( 'db config store' , async ( ) => {
78 const extensionPath = path . join ( __dirname , '../../..' ) ;
@@ -17,9 +18,14 @@ describe('db config store', async () => {
1718 } ) ;
1819
1920 it ( 'should create a new config if one does not exist' , async ( ) => {
21+ const app = createMockApp ( {
22+ extensionPath,
23+ workspaceStoragePath : tempWorkspaceStoragePath
24+ } ) ;
25+
2026 const configPath = path . join ( tempWorkspaceStoragePath , 'workspace-databases.json' ) ;
2127
22- const configStore = new DbConfigStore ( tempWorkspaceStoragePath , extensionPath ) ;
28+ const configStore = new DbConfigStore ( app ) ;
2329 await configStore . initialize ( ) ;
2430
2531 expect ( await fs . pathExists ( configPath ) ) . to . be . true ;
@@ -32,7 +38,11 @@ describe('db config store', async () => {
3238 } ) ;
3339
3440 it ( 'should load an existing config' , async ( ) => {
35- const configStore = new DbConfigStore ( testDataStoragePath , extensionPath ) ;
41+ const app = createMockApp ( {
42+ extensionPath,
43+ workspaceStoragePath : testDataStoragePath
44+ } ) ;
45+ const configStore = new DbConfigStore ( app ) ;
3646 await configStore . initialize ( ) ;
3747
3848 const config = configStore . getConfig ( ) . value ;
@@ -70,7 +80,11 @@ describe('db config store', async () => {
7080 } ) ;
7181
7282 it ( 'should not allow modification of the config' , async ( ) => {
73- const configStore = new DbConfigStore ( testDataStoragePath , extensionPath ) ;
83+ const app = createMockApp ( {
84+ extensionPath,
85+ workspaceStoragePath : testDataStoragePath
86+ } ) ;
87+ const configStore = new DbConfigStore ( app ) ;
7488 await configStore . initialize ( ) ;
7589
7690 const config = configStore . getConfig ( ) . value ;
0 commit comments