MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / stubFileManager

Function stubFileManager

front_end/testing/FileManagerHelpers.ts:15–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13};
14
15export function stubFileManager(): StubbedFileManager {
16 const fileManager = Workspace.FileManager.FileManager.instance() as StubbedFileManager;
17 sinon.stub(fileManager, 'save').callsFake(async (file, _2, _3) => ({fileSystemPath: file}));
18 sinon.stub(fileManager, 'append').callsFake(file => {
19 fileManager.dispatchEventToListeners(Workspace.FileManager.Events.APPENDED_TO_URL, file);
20 });
21 sinon.stub(fileManager, 'close');
22
23 return fileManager;
24}

Callers 7

testsFunction · 0.85

Calls 2

instanceMethod · 0.45

Tested by 1

testsFunction · 0.68