gleam-testing

Implement Gleam unit, integration, and property-based tests using let assert.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides Claude Code through testing Gleam applications, promoting reliable validation with the let assert pattern and best practices for unit, integration, and property-based tests. It emphasizes avoiding the deprecated should module and encourages deterministic test design.

Core Features & Use Cases

  • Enforces the use of let assert in tests over the deprecated should module.
  • Guides on writing unit tests, integration tests, and property-based tests in Gleam.
  • Provides guidance on test organization, naming conventions, and scenario-based testing workflows.

Quick Start

Create tests under the test/ directory with filenames ending in _test.gleam and run gleam test to execute them across targets.

Frequently Asked Questions about gleam-testing

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

FAQPage Schema
How do I write unit tests in Gleam?

To write unit tests in Gleam, create files under the test/ directory with names ending in _test.gleam. Use let assert statements for assertions instead of the deprecated should module, and run the test suite with the gleam test command.

Why should I use let assert instead of should in Gleam tests?

You should use let assert instead of should because the should module is deprecated in Gleam. Using let assert enforces disciplined assertions and provides reliable validation by crashing explicitly on pattern match failures.

Can I run Gleam tests across both Erlang and JavaScript targets?

Yes, you can run Gleam tests across both Erlang and JavaScript targets. The gleam test command executes the test suite under the test/ directory across both targets to ensure code compatibility and consistent behavior.

What is the best way to organize integration and property-based tests in a Gleam project?

Organize integration and property-based tests in a Gleam project by placing them under the test/ directory with filenames ending in _test.gleam. This structure supports scenario-based testing workflows and deterministic test design for reliable execution.

Do I need a specific toolchain to run property-based tests in Gleam?

Yes, you need the Gleam toolchain installed to run property-based tests. The toolchain provides the gleam test command, which executes your test files across Erlang and JavaScript targets using the let assert pattern for reliable validation.

What are the limitations of using let assert for Gleam test assertions?

Using let assert for Gleam test assertions causes the test process to crash immediately if the pattern match fails. This strict approach avoids the deprecated should module but requires careful test design to handle expected errors deterministically without crashing the suite.