jest-testing
Provides Jest testing patterns and best practices for interpreters, parsers, and async TypeScript code in the Lea language repository.
Introduction
The jest-testing skill serves as a comprehensive toolkit for developers working on the Lea programming language codebase. It provides standardized testing patterns for verifying the correctness of tree-walk interpreters, recursive descent parsers, and Promise-based asynchronous execution flows within a TypeScript environment. This skill is designed for contributors and maintainers tasked with ensuring the reliability of core language features, syntax implementations, and runtime built-in functions.
-
Implements the Arrange-Act-Assert pattern for clear, maintainable unit tests.
-
Supports testing complex interpreter outputs, including arithmetic evaluation, built-in function transformations, and error handling.
-
Provides templates for parser validation, ensuring that source code is correctly converted into the expected Abstract Syntax Tree (AST) nodes such as PipeExpr or ExprStmt.
-
Features dedicated patterns for async/await testing, specifically covering delay-based operations and async decorators in Lea.
-
Includes support for snapshot testing to verify consistent code formatting outputs.
-
Offers standard configuration guidance for jest.config.js, utilizing ts-jest and node test environments for optimal TypeScript integration.
-
Use this skill when writing new unit tests for lexer, parser, or interpreter modules to ensure high code coverage.
-
Apply the defined patterns for mocking built-in functions or simulating dependency injection scenarios using the Lea context system.
-
Ensure tests are isolated and focus on one assertion per test to simplify debugging of language runtime behaviors.
-
Expected inputs include raw Lea source code strings; expected outputs are validated AST structures, evaluated results, or thrown error messages.
-
Adhere to the provided directory structure standards for tests, specifically targeting the tests folders throughout the repository for consistent test discovery.
Repository Stats
- Stars
- 4
- Forks
- 0
- Open Issues
- 30
- Language
- TypeScript
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 4, 2026, 01:18 AM