Giter VIP home page Giter VIP logo

emacs-jest's Introduction

jest.el

https://melpa.org/packages/jest-badge.svg

Credit: emacs-python-pytest

This package provides helpers to run jest.

Installation

jest.el is available from melpa.

With use-package:

(use-package jest)

Manually:

M-x package-install RET jest RET

Overview

The main command is jest-popup, which will show a dispatcher menu, making it easy to change various options and switches, and then run jest using one of the actions.

  • jest (run all tests)
  • jest-file (current file)
  • jest-file-dwim (‘Do what I mean’ for current file)
  • jest-function (the test function where the pointer is now, fallback to current file)
  • jest-last-failed (rerun previous failures)
  • jest-repeat (repeat last invocation)

A prefix argument causes the generated command line to be offered for editing, and various customization options influence how some of the commands work. See the README.org for detailed information.

Jest Minor Mode

Jest minor mode binds compilation-related commands such as compile-command and recompile-command to Jest commands, so that, for example C-c <RET> (compile) runs jest-popup and C-c C-<RET> (recompile) runs jest-repeat. The commands to run are configurable.

(use-package jest
  :after (js2-mode)
  :hook (js2-mode . jest-minor-mode))

Jest Popup

Switches
 -b bail (--bail)
 -c colors (--colors)
 -C coverage (--coverage)
 -d run doctests (--doctest-modules)
 -D debug jest config (--debug)
 -e expand (--expand)
 -f force exit (--forceExit)
 -l last commit (--lastCommit)
 -o only changed (--onlyChanged)
 -s silent (--silent)
 -v verbose (--verbose)
 -w watch (--watch)
 -W watch all (--watchAll)

Options
 =c config file (--config=)
 =k only names matching expression (-t)
 =p only files matching expression (--testPathPattern )
 =P only files not matching expression (--testPathIgnorePatterns )
 =o output file (--outputFile=)
 =x exit after N failures or errors (--maxfail=)

Run tests
 t Test all            x Test last-failed

Run tests for current context
 f Test file           F Test this file
 d Test function

Repeat tests
 r Repeat last test run

Contributing

Please create a new issue or submit a PR.

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.