Warning
This repository is not yet ready for use. It is a work in progress.
This repository provides a stable, reproducible set of test cases for validating ENS resolution implementations. Library maintainers and integrators can use these tests to ensure their ENS support is complete and correct.
Note: These resolution tests are specifically for testing usage of the Universal Resolver for ENS V2 readiness.
See test-cases.json for full details and expected values. It tests various resolution scenarios including:
- Forward onchain resolution (address, text, contenthash)
- Forward offchain resolution (CCIP-Read)
- Reverse resolution (L1 and L2)
- Support for all valid name types (.eth, DNS, Unicode, etc.)
Any library and app can use the above tests. For organization, we also run the tests and report coverage for the following libraries.
-
viemv2.x -
viemv1.x -
ethersv6.x -
ethersv5.x -
@ensdomains/ensjsv3.x -
web3.jsv4.x
-
web3.py -
ens-py
-
alloy -
ethers-rs
-
go-ens
# Clone the repo
git clone https://github.com/ensdomains/resolution-tests.git
cd resolution-tests
# Copy env and set RPC URL
cp .env.example .env
# Edit .env and set RPC_URL
# Install all dependencies (workspace)
bun install
# Run all tests
bun run test
# Run tests for specific language
bun run test:typescriptAfter tests complete, a feature support table is displayed showing pass/fail status for each test case across all libraries. Results are automatically saved to results/latest.md.
- Create a new directory:
packages/{library-version}/ - Add a
package.json(will be auto-discovered by bun workspaces) - Import shared types and helpers:
import { getTestCasesByCategory, type TestResult } from "../../../shared";
- Output results to
results.jsonin the package directory - Run
bun installfrom root to link the new package
Each library must output a results.json file:
{
"library": "viem",
"version": "2.21.0",
"language": "typescript",
"timestamp": "2025-01-16T12:00:00Z",
"results": [
{
"caseId": "forward-eth-onchain",
"passed": true,
"actual": "0xeE9eeaAB0Bb7D9B969D701f6f8212609EDeA252E",
"error": null,
"durationMs": 150
}
]
}- Test names use various
.ethnames owned by ENS DevRel team or known stable names - The DevRel team Safe (
devrel.enslabs.eth) hascoldwallet.ens.ethas a recoverer - Test data is designed to remain stable over time