Emacs minor mode for running jest (Node.js test framework)
GPL-3.0 License
Emacs minor mode for running jest (Nodejs test framework). Inspired by =ruby-test-mode= and =cider-test=.
** Features
Uses =npx jest= to execute tests. This respect your project's version of =jest=.
Keybindings to execute tests for the entire project, a test module, or a top-level test/describe block.
File references in the Test Execution Buffer support jump to definition.
** Keybindings jest-test-mode comes with some default keybindings:
| Binding | Action |
|-------------+------------------------------------------------------------------|
| C-c C-t n | Runs tests in the current buffer. |
| C-c C-t p | Runs all tests in the project. |
| C-c C-t t | Runs the it/test/describe block at the current point. |
| C-c C-t a | Re-runs the previous test command. |
| C-c C-t d n | Runs tests in the current buffer with node debugger. |
| C-c C-t d t | Runs the describe block at the current point with node debugger. |
| C-c C-t d a | Re-runs the previous test command with node debugger. |
** Installation Install through melpa as =jest-test-mode=.
To configure the project with =use-package=:
#+begin_src elisp (use-package jest-test-mode :ensure t :commands jest-test-mode :hook (typescript-mode js-mode typescript-tsx-mode)) #+end_src
Manually:
#+begin_src elisp (require 'jest-test-mode) (add-hook 'typescript-mode-hook 'jest-test-mode) (add-hook 'js-mode-hook 'jest-test-mode) (add-hook 'typescript-tsx-mode-hook 'jest-test-mode) #+end_src
** Resources Thanks to the following resources for building this layer:
** License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
** Testing Notes Verify package can be included cleanly:
#+begin_src sh
export EMACS_COMMAND=/Applications/Emacs.app/Contents/MacOS/Emacs.sh
git clone [email protected]:melpa/melpa.git && cd melpa
git clean -fdx
make recipes/jest-test-mode
make sandbox INSTALL=jest-test-mode #+end_src