Back to Browse

Use with your AI agent

  1. Install — run npx skills add Kali-Decoder/Midnight-skills --skill midnight-testing-checklist for this skill, or npx skills add Kali-Decoder/Midnight-skills for all
  2. Prompt — copy the example prompt and paste it into Cursor, Claude Code, or Codex
  3. Build — the agent loads this skill and scaffolds your Midnight work

Testing Checklist

FoundationIntermediateReviewedNewUpdated 3 days agov1.0.0

Agent picks this when: Decide what to test and find gaps before a release

What tested means for a Midnight dApp: contract logic, negative and privacy tests, local-devnet end-to-end tests, frontend and ZK-artifact checks, and CI.

Good for

  • Checklist across --skip-zk logic tests, negative/privacy tests, devnet E2E with testkit-js, frontend, and CI.
  • Names the missing tests and links to the skills that show how to write them.

Preview in agent

Suggested prompts

Decide what to test and find gaps before a release. Use the "midnight-testing-checklist" skill from MIDSKILLS. Follow Compact smart-contract best practices, wire wallet flows where needed, and explain each step as you implement. Target Midnight Preprod unless I specify otherwise.

Loaded skill midnight-testing-checklist

What the skill guides the agent to do:

  1. Checklist across --skip-zk logic tests, negative/privacy tests, devnet E2E with testkit-js, frontend, and CI.
  2. Names the missing tests and links to the skills that show how to write them.

Illustrative — based on the skill's description, not recorded agent output.

Try it without installing: npx skills use Kali-Decoder/Midnight-skills@midnight-testing-checklist

What changed in v1.0.16

All registry changes

New skill — first published in v1.0.16 (not in v1.0.14).

On this page · 7 sections
SKILL.md

Midnight Testing Checklist

What "tested" means for a Midnight dApp, as boxes to tick. For how to write each kind of test, follow the linked skills.

What this skill produces: a filled checklist, the missing tests named one per line, and the commands that run the suite.

Workflow

  1. Run midnight-doctor first. A version FAIL makes every test result meaningless.
  2. Find the existing suites (vitest.config.*, **/*.test.ts, CI workflows) and run them once to get a baseline.
  3. Walk sections A–E. For each missing item, name the test to add (file + what it asserts).
  4. Write or extend tests starting with section B: negative tests catch the bugs that matter on a privacy chain.
  5. Report what passes, what is missing, and the exact commands.

A. Contract logic (fast loop, no proofs) — see testing/ §3

  • The contract compiles with the pinned toolchain; during iteration use compact compile --skip-zk to skip proving-key generation.
  • Every exported circuit has at least one happy-path test that checks the resulting ledger state, not only that the call returned.
  • Constructor arguments and initial ledger state are asserted.
  • Boundary values are tested for every Uint<N> (0, max, max+1 at the TypeScript boundary) and every Counter near zero.
  • State-machine contracts are tested in every state, including calls in the wrong state.

B. Negative and privacy tests — see midnight-security-checklist

  • Every assert has a test that makes it fail and checks the message.
  • Every privileged circuit is called by a non-authorized identity and rejected.
  • Every one-shot action is replayed and rejected (nullifier / round).
  • Every witness is replaced with a dishonest implementation (wrong secret, out-of-range value) and the circuit rejects it.
  • For each value meant to stay private: read the public ledger (and emitted events) after the call and assert the value does not appear.
  • Two actions by the same user cannot be linked from public state when unlinkability is a requirement.

C. End-to-end on a local devnet — see hello-world/, example-counter/

  • A local devnet (node, indexer, proof server at the pinned images) starts from a committed compose file and is healthy before tests run.
  • Tests deploy the contract, call each circuit through Midnight.js with real proofs, and read the result back from the indexer.
  • Wallet setup uses testkit-js and funds/registers DUST inside the test setup, not by hand.
  • Suites that share one devnet wallet run sequentially (parallel spends of the same UTXOs conflict).
  • At least one test reconnects to an already deployed contract by address and reads its state.

D. Frontend and artifacts — see 1am-wallet/, midnight-common-errors

  • The ZK asset sync copies compiler/, keys/, and zkir/ from the current build; a check fails CI if they are stale.
  • next build (or the bundler's production build) passes: wallet/SDK modules load client-side only.
  • Wallet detection is tested with no extension, one extension, and several extensions.
  • Rejected wallet prompts and failed transactions show an error instead of hanging.
  • npm ls @midnight-ntwrk/compact-runtime shows a single version.

E. CI and release

  • CI installs with npm ci against a lockfile with exact pins.
  • CI runs section A on every PR and section C at least before every release.
  • CI runs midnight-doctor --json (or an equivalent version check) and fails on any FAIL.
  • The network and versions each release was tested on are recorded (e.g. "preprod, Ledger 9.1 set").
TaskSkill
Compiler errors, the --skip-zk loop, version managementtesting/
Full devnet test setup with vitest and testkit-jshello-world/
Security properties to provemidnight-security-checklist/
Version gatemidnight-doctor/

Start in 2 steps

  1. 1. Install — one skill or the full set
  2. 2. Prompt — paste the example into your agent

Install all skills (recommended)

npx skills add Kali-Decoder/Midnight-skills

One command adds every Midnight skill to Cursor, Claude Code, and similar agents.

Install this skill only

npx skills add Kali-Decoder/Midnight-skills --skill midnight-testing-checklist

Installs only "midnight-testing-checklist" into every detected agent (Cursor, Claude Code, Codex, …).

Example agent prompt

Decide what to test and find gaps before a release. Use the "midnight-testing-checklist" skill from MIDSKILLS. Follow Compact smart-contract best practices, wire wallet flows where needed, and explain each step as you implement. Target Midnight Preprod unless I specify otherwise.

Paste into Cursor, Claude Code, or Codex after installing.

Author
Tusharpamnani
Category
Foundation
Difficulty
intermediate
Version
v1.0.0

Tags

TestingChecklistCI

Files included

SKILL.md
Create Social CardLive HackathonsGallery
Mock Demo
Testing Checklist