midnight-cq:wallet-testing

Write Vitest tests for custom Midnight Wallet SDK implementations and WalletBuilder compositions.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-cq-wallet-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: midnight-cq:wallet-testing
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/midnight-cq/skills/wallet-testing
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-cq-wallet-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need reliable, repeatable tests for custom Wallet SDK implementations and WalletBuilder compositions that interact with Effect-based services, Either-returning capabilities, and RxJS observable state; this Skill provides patterns and guardrails to avoid common pitfalls and flaky tests.

Core Features & Use Cases

  • Effect/Either unwrapping patterns for asserting success and failure paths in async and pure capabilities.
  • Observable state testing with first-value and multi-emission strategies to avoid races and memory leaks.
  • WalletBuilder and test double setup including branded type fixtures, complete capability/service doubles, and Layer-based service provisioning for unit and integration tests.
  • Use Case: Create Vitest suites that start a test WalletBuilder variant, mock proving/submission services, assert state transitions, and clean up subscriptions per test.

Quick Start

Ask the assistant to generate Vitest tests that unwrap Effects, assert observable emissions, and wire WalletBuilder with test doubles for your custom wallet variant.

Frequently Asked Questions about midnight-cq:wallet-testing

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

FAQPage Schema
How do I test Effect and Either abstractions in Vitest for a custom wallet SDK?

To test Effect and Either abstractions in Vitest, you unwrap the results to assert success and failure paths directly within async and pure capabilities. This approach validates returned values and error handling logic for custom wallet implementations.

What is the best way to assert RxJS observable state in WalletBuilder tests?

Asserting RxJS observable state in WalletBuilder tests requires first-value and multi-emission strategies to prevent race conditions. You verify state transitions while ensuring proper cleanup of subscriptions per test to avoid memory leaks.

How do I create test doubles for async services in a Midnight wallet test suite?

Creating test doubles for async services involves building complete capability and service doubles using Layer-based service provisioning. This setup allows you to mock proving and submission services for unit and integration testing of wallet variants.

Can I use Vitest to test branded type fixtures in a custom WalletBuilder composition?

Yes, you can use Vitest to test branded type fixtures within a custom WalletBuilder composition. The testing process includes constructing branded type fixtures and wiring them with test doubles to validate your wallet variant's specific capabilities.

Why do my wallet SDK observable tests leak memory or behave flaky?

Wallet SDK observable tests leak memory or behave flaky when subscriptions are not properly cleaned up per test. Using structured first-value and multi-emission strategies prevents races and ensures stable observable state testing.