elisp-testing

Automate Emacs Lisp testing with ERT and Buttercup in batch mode.

1|1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Jylhis/skills --skill elisp-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elisp-testing
Source: https://github.com/Jylhis/skills/tree/main/skills/elisp-testing
Command: npx skills add https://github.com/Jylhis/skills --skill elisp-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Emacs Lisp projects often lack robust automated tests; this skill provides a structured approach to writing, running, and maintaining tests using ERT and Buttercup, with fixtures and isolation utilities.

Core Features & Use Cases

  • ERT testing: define and run unit tests for Emacs Lisp code with ert-deftest, ert-with-temp-file, and batch execution.
  • Mocking and isolation: supports cl-letf-based mocking, test fixtures, and state isolation to ensure deterministic results.
  • Buttercup support: integrates behavior-driven testing patterns for readable test suites; suitable for library and package development.
  • Use Case: when adding new Emacs Lisp features, you can write tests that cover edge cases, ensure compatibility across versions, and run tests in CI.

Quick Start

Run your Emacs Lisp tests in batch mode by loading your test file and calling ert-run-tests-batch-and-exit.

Frequently Asked Questions about elisp-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Emacs Lisp tests in batch mode using ERT?

Mocking in Emacs Lisp tests is handled using cl-letf-based mocking. This approach provides state isolation and test fixtures, ensuring deterministic results by temporarily overriding function definitions during test execution.

Can I use Buttercup for behavior-driven testing in Emacs Lisp projects?

Buttercup is supported for behavior-driven testing in Emacs Lisp projects. It integrates readable test suite patterns suitable for library and package development, complementing standard ERT unit testing workflows.

How do I isolate test state and manage fixtures for Emacs Lisp unit tests?

You isolate test state and manage fixtures using ert-with-temp-file alongside state isolation utilities. This ensures deterministic results by preventing cross-test contamination and providing temporary file resources.

What is the best way to automate robust testing for Emacs Lisp packages?

Automating robust testing for Emacs Lisp packages involves defining tests with ert-deftest, running batch execution, and applying cl-letf mocking with fixtures. This structured approach ensures compatibility and covers edge cases.

Does Emacs Lisp testing work without external dependencies for mocking and fixtures?

Emacs Lisp testing can work without external dependencies by leveraging built-in ERT features and cl-letf for mocking. This Skill provides necessary isolation utilities and fixtures natively within the Emacs environment.