brunomalvestuto / exunit.el

Emacs ExUnit test runner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

exunit

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

Provides commands to run ExUnit tests. The output is syntax highlighted and stacktraces are navigatable.

Setup

exunit is available in melpa and can be installed via package-install command.

(add-hook 'elixir-mode-hook 'exunit-mode)

Commands

KeyboardDescription
C-c , aexunit-verify-all Run all the tests in the current project
C-c , uexunit-verify-all-in-umbrella Run all the tests in the current umbrella project
C-c , vexunit-verify Run all the tests in the current buffer, or the test file corresponding to the current buffer
C-c , sexunit-verify-single Run the test under the point
C-c , rexunit-rerun Re-run the last test invocation
C-c , texunit-toggle-file-and-test Toggle between a file and its tests in the current window
C-c , dexunit-debug Run the test under the point in IEx shell. Supports IEx.pry method for debugging.
C-c , 4 texunit-toggle-file-and-test-other-window Toggle between a file and its tests in other window

Invoking any of these commands with a prefix argument C-u will cause a prompt to be shown for additional arguments before the test(s) are run.

https://raw.githubusercontent.com/ananthakumaran/exunit.el/master/screenshots/sample.png

Run tests in a docker

For example, you can redefine an exunit-mix-command to the following to execute in backend service context:

(setq exunit-mix-command
      (lambda (args)
        (let* ((args (s-join " " args))
               (mix-command (concat "'mix test " args "'")))
          ;; Adjust to your needs
          (list "docker-compose" "exec" "backend" "sh" "-c" mix-command))))

About

Emacs ExUnit test runner


Languages

Language:Emacs Lisp 97.3%Language:Makefile 2.7%