mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-08-11 00:57:17 +01:00
Fix resizeTerminal success test: stub a successful fetch response
This commit is contained in:
@@ -348,6 +348,16 @@ describe("CloudShellClient", () => {
|
||||
const terminalId = "terminal-id";
|
||||
const size = { rows: 40, cols: 120 };
|
||||
|
||||
global.fetch = jest.fn().mockImplementationOnce(() => {
|
||||
return {
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: jest.fn().mockResolvedValue({}),
|
||||
text: jest.fn().mockResolvedValue(""),
|
||||
headers: new Headers(),
|
||||
} as unknown as Promise<Response>;
|
||||
});
|
||||
|
||||
await resizeTerminal(consoleUri, terminalId, size);
|
||||
|
||||
expect(global.fetch).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user