Identity Tests#
This directory contains tests for the ATP identity system, including DID resolution and caching functionality.
Current Status#
Working Tests#
did-document.test.ts- DID document parsing and validation ✅did-cache.test.ts- DID caching functionality ✅ (fixed with mock implementation)
Partially Working Tests#
handle-resolver.test.ts- Handle resolution (2/4 tests passing, DNS resolution issues)
Known Issues#
PLC Tests (did-resolver.test.ts)#
The did-resolver.test.ts tests are failing due to a version compatibility
issue between the PLC library packages:
@did-plc/libv0.0.4 (client library)@did-plc/serverv0.0.1 (server library, published 2 years ago)
Problem: The server rejects signatures generated by the client with "Invalid signature on op" errors, even though the signature generation appears to be working correctly.
Root Cause: The server package is significantly older and uses different validation logic than the client library expects.
Fixed for did-cache.test.ts: Implemented a mock HTTP server approach that bypasses the PLC compatibility issue while still testing the caching functionality.
Handle Resolver Tests#
Some DNS resolution tests are failing, possibly due to network/environment issues or missing test DNS records.
Potential Solutions:
- Wait for updated compatible versions of the PLC packages
- Switch to the
@atproto/plcecosystem (if available and compatible) - Mock the PLC server interactions for testing purposes
- Use a different DID method for testing
Server Changes#
The web/server.ts file has been successfully converted from Express to use
Deno.serve while maintaining the same API and functionality. The web server
tests should work once the PLC dependency issues are resolved.
Running Tests#
# Run all tests (some may be skipped due to above issues)
deno test --allow-all
# Run specific working tests
deno test --allow-all tests/did-document.test.ts
deno test --allow-all tests/did-cache.test.ts