MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / captureScreenShot

Function captureScreenShot

src/test/common.node.ts:185–202  ·  view source on GitHub ↗
(contextOrFileName: string | Mocha.Context)

Source from the content-addressed store, hash-verified

183 * If there's a failure, it will be logged (errors are swallowed).
184 */
185export async function captureScreenShot(contextOrFileName: string | Mocha.Context) {
186 if (!isCI) {
187 return;
188 }
189 fs.ensureDirSync(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'logs'));
190 const filename = path.join(
191 EXTENSION_ROOT_DIR_FOR_TESTS,
192 'logs',
193 await generateScreenShotFileName(contextOrFileName)
194 );
195 try {
196 // @ts-expect-error - screenshot-desktop doesn't have type definitions
197 const screenshot = await import('screenshot-desktop');
198 await screenshot.default({ filename });
199 } catch (ex) {
200 console.error(`Failed to capture screenshot into ${filename}`, ex);
201 }
202}
203
204let remoteUrisCleared = false;
205export function initializeCommonNodeApi() {

Calls 3

joinMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected