GithubHelp home page GithubHelp logo

khsheehan / vscode-jest-test-adapter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dfcowell/vscode-jest-test-adapter

0.0 1.0 0.0 29 KB

A Jest TestAdapter extension for the VS Code Test Explorer

License: MIT License

TypeScript 100.00%

vscode-jest-test-adapter's Introduction

Implementing a Test Adapter for Visual Studio Code

This repository contains an example for implementing a TestAdapter extension that works with the Test Explorer extension.

Setup

  • install the Test Explorer extension
  • fork and clone this repository and open it in VS Code
  • run npm install
  • run npm run watch or start the watch Task in VS Code
  • start the debugger

You should now see a second VS Code window, the Extension Development Host. Open a folder in this window and click the "Test" icon in the Activity bar. Now you should see the fake example test suite in the side panel:

The fake example test suite

Basic implementation

  • add any configuration properties that your Test Adapter needs to the contributes.configuration.properties section of package.json
  • replace the loadFakeTests() call in src/adapter.ts with your code for loading the test definitions for the real test framework
  • replace the runFakeTests() call in src/adapter.ts with your code for running the tests in a child process using the real test framework

Getting ready to publish

  • search for all occurrences of the word "example" in this project and replace them with the name of the testing framework that your Test Adapter supports
  • update package.json with your preferred values (at a minimum you should change author, publisher, homepage, repository and bugs)
  • create an icon for your Test Adapter (there's an SVG version of the Test Explorer icon at img/test-explorer.svg) and reference it in package.json
  • replace this README with your documentation

Now you're ready to publish the first version of your Test Adapter.

Completing the implementation

  • implement the debug() method
  • implement the cancel() method (it should kill the child process that was started by run() or debug())
  • watch the configuration for any changes that may affect the loading of test definitions and reload the test definitions if necessary
  • watch the workspace for any changes to the test files and reload the test definitions if necessary
  • watch the configuration for any changes that may affect the results of running the tests and emit an autorun event if necessary
  • watch the workspace for any changes to the source files and emit an autorun event if necessary
  • ensure that only one test run is active at a time

vscode-jest-test-adapter's People

Contributors

hbenl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.