Skip to content

eldelto/testlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testlet

Testlet is a language-agnostic test-runner, aiming to provide a consistent workflow across programming languages and keeping the required configuration to a minimum.

This package was mostly inspired by the great dumb-jump (and dumber-jump) plug-ins that provide basic code navigation for a plethora of programming languages without any configuration - a godsend when working across many projects with varying tech stacks.

I wanted to create something similar but for running tests.

Features

  • Running the test at point
  • Running a whole test file
  • Re-running the most recent test execution
  • Re-running tests on file changes

https://raw.githubusercontent.com/eldelto/testlet/refs/heads/main/media/demo.gif

Supported Languages

Currently this package only supports languages I frequently use at home or at work but will hopefully expand in the future.

  • Elixir
  • Go

Installation

Testlet is currently not available on MELPA but can be installed directly from source via use-package (requires Emacs >= 30.0):

	 (use-package testlet
	   :vc (:url "https://github.com/eldelto/testlet"
	 :branch "main")
	 :ensure t)

Alternatively you can clone this repository

	 git clone git@github.com:eldelto/testlet

and load it manually in your .emacs file

	 (use-package testlet
	   :load-path "<path-to-repository>")

Commands

The following interactive commands are provided:

CommandDescription
testlet-run-test-at-pointExecutes the current test under the cursor.
testlet-run-test-fileExecutes all tests in the current test file.
testlet-watch-test-at-pointRuns the test at point and re-runs it on file changes.
testlet-watch-fileRuns the test file and re-runs it on file changes.
testlet-rerun-testRestarts the most recently executed test run.

Configuration

Testlet calls out to mode-specific Elisp functions to determine the desired test cases to run and to build up the shell command to execute.

There are three callback functions you can customize:

FunctionDescription
run-test-at-point-<mode>Returns the shell command to run the test at point.
run-test-file-<mode>Returns the shell command to run all tests in the current buffer.
watch-test-files-<mode>Returns a list of files to watch for changes.

For more details, checkout the implementations for already supported languages.

Contributing

Your favourite language is not supported? Feel free to open create a pull-request with the required changes or open an issue.

About

A language-agnostic test-runner for Emacs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors