direct-tests

Execute in-memory unit tests for GenLayer intelligent contracts with mocking and VM cheatcodes.

10|6|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/genlayerlabs/skills --skill direct-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: direct-tests
Source: https://github.com/genlayerlabs/skills/tree/main/plugins/genlayer-dev/skills/direct-tests
Command: npx skills add https://github.com/genlayerlabs/skills --skill direct-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to write and execute fast, in-memory tests for GenLayer intelligent contracts, eliminating the need for servers or Docker and significantly speeding up the development feedback loop.

Core Features & Use Cases

  • Rapid Testing: Execute tests in approximately 30-50ms per test case.
  • In-Memory Execution: No external dependencies like Docker or running nodes required.
  • Mocking Capabilities: Mock web requests and LLM responses for isolated testing.
  • VM Cheatcodes: Utilize powerful tools to manipulate VM state, sender, balance, time, and more.
  • Use Case: Quickly iterate on contract logic by writing and running tests directly within your development environment, ensuring correctness before deploying to a testnet.

Quick Start

Run all direct mode tests using the command pytest tests/direct/ -v.

Frequently Asked Questions about direct-tests

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

FAQPage Schema
How do I run in-memory tests for GenLayer smart contracts without using Docker?

Mocking LLM responses and web requests allows you to isolate contract logic during in-memory testing, ensuring that external factors do not affect the validation of your smart contract's core behavior.

What are VM cheatcodes used for when testing smart contracts?

VM cheatcodes provide specialized tools to manipulate VM state, including sender identity, account balance, and time, allowing you to thoroughly test and assert various smart contract scenarios in isolation.

Do I need a running node to execute smart contract unit tests?

No, you do not need a running node or server to execute smart contract unit tests, because the in-memory execution environment handles the validation directly within your local development setup.

How do I mock LLM responses for isolated smart contract testing?

You can mock LLM responses to isolate contract logic during testing, ensuring that external factors do not affect the validation of your GenLayer intelligent contracts' core behavior.