<feed xmlns='http://www.w3.org/2005/Atom'>
<title>digiid-ts/src/__tests__, branch v1.0.1</title>
<subtitle>[MIRROR] A modern TypeScript implementation of the Digi-ID authentication protocol</subtitle>
<id>https://git.zelu.dev/digiid-ts/atom?h=v1.0.1</id>
<link rel='self' href='https://git.zelu.dev/digiid-ts/atom?h=v1.0.1'/>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts/'/>
<updated>2025-04-09T17:41:13Z</updated>
<entry>
<title>test: Add unit tests for core digiid logic</title>
<updated>2025-04-09T17:41:13Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-09T17:41:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts/commit/?id=abba6e3cd53e14fbec27ebd810ef0e67fc174e0b'/>
<id>urn:sha1:abba6e3cd53e14fbec27ebd810ef0e67fc174e0b</id>
<content type='text'>
- Set up test file structure and configuration with Vitest.
- Add comprehensive unit tests for `generateDigiIDUri`, mocking `crypto.randomBytes` for predictable nonces.
- Refactor signature verification logic into `_internalVerifySignature` helper function to facilitate testing.
- Add unit tests for `verifyDigiIDCallback`, covering validation logic (URL, nonce, scheme checks).
- Utilize `vi.spyOn` to attempt mocking the outcome of `_internalVerifySignature`.
- Skip 6 tests related to signature verification outcomes due to difficulties reliably mocking the interaction with the underlying CJS 'digibyte-message' dependency in the testing environment. These scenarios will be covered by integration tests later.
- Confirmed remaining 19 unit tests pass, covering URI generation and callback validation logic.
</content>
</entry>
</feed>
