Coder Social home page Coder Social logo

cosificando / node-tdd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prashaantt/node-tdd

0.0 0.0 0.0 420 KB

VS Code TDD extension for Node and JavaScript

Home Page: https://marketplace.visualstudio.com/items?itemName=prashaantt.node-tdd

License: MIT License

TypeScript 100.00%

node-tdd's Introduction

node-tdd

A Visual Studio Code extension to ease test-driven development in Node and JavaScript.

Features

node-tdd demo

  • Activates when a workspace containing package.json is opened.
  • Triggers an automatic test build whenever source files are updated.
  • Shows a colour-coded build summary.
  • Shows the average test coverage (experimental).
  • Optionally, if your test runner generates TAP outputs, use the nodeTdd.reporter setting to provide a more meaningful test summary:

tap

  • Finally, use nodeTdd.minimal to reclaim some status bar real estate:

minimal mode

Settings

This extension contributes the following settings:

Setting Type Default Description
nodeTdd.activateOnStartup boolean true Activate TDD mode when workspace is opened
nodeTdd.testScript string test The npm script to run tests
nodeTdd.glob string {src,test}/**/*.{js,ts,jsx,tsx} The glob pattern for files to watch, relative to the workspace root
nodeTdd.verbose boolean / object false / {onlyOnFailure: true} Show build status dialogs
nodeTdd.minimal boolean false Minimise status bar clutter
nodeTdd.buildOnActivation boolean false Run tests when TDD mode is activated
nodeTdd.buildOnCreate boolean false Run tests when matching files are created
nodeTdd.buildOnDelete boolean false Run tests when matching files are deleted
nodeTdd.showCoverage boolean false Show the average test coverage if reported (experimental)
nodeTdd.coverageThreshold number / null null The coverage threshold percentage, used to colour-code the coverage
nodeTdd.reporter string / null null The test reporter used (currently only "tap" is supported)

Commands

The following commands are available from the commands menu as well as status bar buttons:

Command Action
activate Activate node-tdd in a workspace
deactivate Deactivate node-tdd in a workspace
toggleOutput Toggle detailed test results output
stopBuild Stop a running build

Limitations and known issues

  • The extension doesn't get activated if package.json was not initially present when the workspace was opened; a window restart will be required to detect a change.
  • It doesn't work with watch mode/incremental test builds. The build process used for running tests must exit on each execution, otherwise it will never report the status.
  • showCoverage is an experimental setting that currently only works with the text-summary reports from Lab, Istanbul and nyc. Disable it if it doesn't work for you or its output looks funny.
  • Despite recent fixes, it might still be flaky on Windows. Please report any issues.
  • Ironically for a TDD extension, it has very few tests of its own because I don't yet know how to test UI elements in VS Code. :/

Suggestions and PRs are welcome.

Release notes

See the change log. If you are reading this from within VS Code, click on the Changelog tab of the extension preview page.

License

MIT License.

node-tdd's People

Contributors

prashaantt 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.