New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vscode/test-electron

Package Overview
Dependencies
Maintainers
7
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vscode/test-electron

![Test Status Badge](https://github.com/microsoft/vscode-test/workflows/Tests/badge.svg)

  • 2.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
186K
increased by32.2%
Maintainers
7
Weekly downloads
 
Created

What is @vscode/test-electron?

@vscode/test-electron is a package designed to help developers test their Visual Studio Code extensions in an Electron environment. It provides tools to run and debug extensions, ensuring they work correctly within the VS Code editor.

What are @vscode/test-electron's main functionalities?

Running Extension Tests

This feature allows developers to run tests for their VS Code extensions. The code sample demonstrates how to set up and execute tests using the `runTests` function, specifying paths to the extension and the test suite.

const { runTests } = require('@vscode/test-electron');

async function main() {
  try {
    const extensionDevelopmentPath = path.resolve(__dirname, '../my-extension');
    const extensionTestsPath = path.resolve(__dirname, './suite/index');

    await runTests({
      extensionDevelopmentPath,
      extensionTestsPath
    });
  } catch (err) {
    console.error('Failed to run tests');
    process.exit(1);
  }
}

main();

Debugging Extensions

This feature provides the ability to debug extensions by downloading a specific version of VS Code and running tests with debugging options. The code sample shows how to download VS Code, resolve the CLI path, and run tests with additional launch arguments for debugging.

const { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } = require('@vscode/test-electron');

async function main() {
  const vscodeExecutablePath = await downloadAndUnzipVSCode('stable');
  const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);

  // Run tests with additional debugging options
  await runTests({
    vscodeExecutablePath,
    extensionDevelopmentPath: path.resolve(__dirname, '../my-extension'),
    extensionTestsPath: path.resolve(__dirname, './suite/index'),
    launchArgs: ['--disable-extensions']
  });
}

main();

Other packages similar to @vscode/test-electron

FAQs

Package last updated on 05 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc