@@ -13,6 +13,8 @@ import type { ModeConfig } from "@roo-code/types"
1313import { fileExistsAtPath } from "../../../utils/fs"
1414import { getWorkspacePath , arePathsEqual } from "../../../utils/path"
1515import { GlobalFileNames } from "../../../shared/globalFileNames"
16+ import { clearAllMocks } from "../../../test-utils/reset"
17+ import { makeExtensionContext , makeUri } from "../../../test-utils/vscode"
1618
1719import { CustomModesManager } from "../CustomModesManager"
1820
@@ -53,20 +55,11 @@ describe("CustomModesManager", () => {
5355
5456 beforeEach ( ( ) => {
5557 mockOnUpdate = vi . fn ( )
56- mockContext = {
57- globalState : {
58- get : vi . fn ( ) ,
59- update : vi . fn ( ) ,
60- keys : vi . fn ( ( ) => [ ] ) ,
61- setKeysForSync : vi . fn ( ) ,
62- } ,
63- globalStorageUri : {
64- fsPath : mockStoragePath ,
65- } ,
66- } as unknown as vscode . ExtensionContext
58+ mockContext = makeExtensionContext ( { globalStorageUri : makeUri ( mockStoragePath ) } )
59+ mockContext . globalState . setKeysForSync = vi . fn ( )
6760
6861 // mockWorkspacePath is now defined at the top level
69- mockWorkspaceFolders = [ { uri : { fsPath : mockWorkspacePath } } ]
62+ mockWorkspaceFolders = [ { uri : makeUri ( mockWorkspacePath ) } ]
7063 ; ( vscode . workspace as any ) . workspaceFolders = mockWorkspaceFolders
7164 ; ( vscode . workspace . onDidSaveTextDocument as Mock ) . mockReturnValue ( { dispose : vi . fn ( ) } )
7265 ; ( getWorkspacePath as Mock ) . mockReturnValue ( mockWorkspacePath )
@@ -90,7 +83,7 @@ describe("CustomModesManager", () => {
9083 } )
9184
9285 afterEach ( ( ) => {
93- vi . clearAllMocks ( )
86+ clearAllMocks ( )
9487 } )
9588
9689 describe ( "getCustomModes" , ( ) => {
0 commit comments