Skip to content

ananthakumaran/exunit.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

;; Optionally configure `transient-default-level' to 5 to show extra switches
;; Or use `C-x l' to change the level of individual commands and switches
(setq transient-default-level 5) ;; default is 4

Currently, 2 extra switches are shown, --exclude and --include.

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published