CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-electron-debug

Adds useful debug features to your Electron app

86

1.19x
Overview
Eval results
Files

task.mdevals/scenario-1/

Debug Tools Wrapper

Create a wrapper module for an Electron application that simplifies the setup and usage of development debugging tools. The module should provide convenient functions to initialize debugging capabilities and open DevTools programmatically.

Requirements

Create a module in debug-wrapper.js that exports:

  1. Debug Initialization: A function initDebug(options) that sets up debugging tools with custom configuration. It should accept an options object and enable automatic DevTools opening on new windows.

  2. DevTools Toggle: A function toggleDevTools(window) that toggles the DevTools panel for a specified browser window. If no window is provided, it should operate on the currently focused window.

  3. DevTools Opening: A function openDevTools(window) that explicitly opens the DevTools panel for a specified browser window, or the focused window if none is provided.

Implementation Notes

  • All functions should handle cases where no window is focused gracefully (no errors thrown)
  • Use an existing debugging utility package to provide these capabilities
  • The debug initialization should respect the provided options
  • DevTools operations should work on any valid BrowserWindow instance

Test Cases

Create tests in debug-wrapper.test.js:

@test Debug Initialization

When initDebug() is called with options, the debugging tools should be initialized and configured according to the provided options.

@test DevTools Toggle with Window

When toggleDevTools() is called with a valid browser window, the DevTools should toggle between open and closed states for that window.

@test DevTools Opening

When openDevTools() is called with a valid browser window, the DevTools should open for that window (or remain open if already open).

Dependencies { .dependencies }

electron-debug { .dependency }

Provides debugging and inspection utilities for Electron applications.

Install with Tessl CLI

npx tessl i tessl/npm-electron-debug

tile.json