https://github.com/edmundmiller/emacs-jest
A package to run jest inside emacs
https://github.com/edmundmiller/emacs-jest
emacs emacs-lisp emacs-modules emacs-packages hacktoberfest javascript jest package testing unit-testing
Last synced: 9 days ago
JSON representation
A package to run jest inside emacs
- Host: GitHub
- URL: https://github.com/edmundmiller/emacs-jest
- Owner: edmundmiller
- License: gpl-3.0
- Created: 2018-11-23T17:45:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-02T01:27:20.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T00:23:02.522Z (8 months ago)
- Topics: emacs, emacs-lisp, emacs-modules, emacs-packages, hacktoberfest, javascript, jest, package, testing, unit-testing
- Language: Emacs Lisp
- Homepage:
- Size: 101 KB
- Stars: 82
- Watchers: 4
- Forks: 18
- Open Issues: 10
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: jest.el
[[https://melpa.org/#/jest][file:https://melpa.org/packages/jest-badge.svg]]
Credit: [[https://github.com/wbolster/emacs-python-pytest][emacs-python-pytest]]
This package provides helpers to run jest.
* Installation
~jest.el~ is available from melpa.
With ~use-package~:
#+BEGIN_SRC elisp
(use-package jest)
#+END_SRC
Manually:
#+BEGIN_SRC
M-x package-install RET jest RET
#+END_SRC
* 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 =
(=compile=) runs =jest-popup= and =C-c C-= (=recompile=) runs
=jest-repeat=. The commands to run are configurable.
#+begin_src el
(use-package jest
:after (js2-mode)
:hook (js2-mode . jest-minor-mode))
#+end_src
* Jest Popup
#+BEGIN_SRC
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
#+END_SRC
* Contributing
Please create a [[https://github.com/Emiller88/emacs-jest/issues/new][new issue]] or [[https://github.com/Emiller88/emacs-jest/compare][submit a PR]].