Files
ucan/did
Steve Moyer 1098e76cba test(invocation): add command.Covers and subject consistency tests
Also improve the maintainability of the tests by a) providing a set of fixed Personas
and then generating a slew of valid delegation tokens, invalid delegation tokens
and proof-chains thereof.
2024-11-19 14:35:46 -05:00
..
2024-10-24 12:51:21 +02:00
2024-10-24 12:51:21 +02:00

did

Testing

The test suite for this package includes test vectors provided by the authors of the did:key method specification. Some of these tests provide the public key associated with a did:key as JWKs and an extra (test-only) dependency has been added to unmarshal the JWK into a Go struct. Support for the secp256k1 encryption algorithm is experimental (but stable in my experience) and requires the addition of the following build tag to properly run:

// go:build jwx_es256k

WARNING: These tests will not run by default!

To include these tests from the CLI, execute the following command:

go test -v ./did -tags jwx_es256k

It should also be possible to configure your IDE to run these tests. For instance, in Codium, add the following JSON snippet to your local project configuration:

"go.testTags": "jwx_es256k",