Skip to content

test: add initial unit tests#38

Merged
Mercurial merged 3 commits intoutxorpc:mainfrom
SebastienGllmt:tests
Mar 16, 2025
Merged

test: add initial unit tests#38
Mercurial merged 3 commits intoutxorpc:mainfrom
SebastienGllmt:tests

Conversation

@SebastienGllmt
Copy link
Copy Markdown
Contributor

This adds unit tests to the project

There were some I didn't add because it requires creating a mock utxorpc backend. The ones I did add are instead populated with static data from creating a localhost network with yaci-devkit + dolos

Comment thread test/index.test.mts
Comment on lines +134 to +135
// TODO: this is missing for some reason
// height: "0",
Copy link
Copy Markdown
Contributor Author

@SebastienGllmt SebastienGllmt Mar 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fields equal to the default value for the data type seem to be missing if you call toJson, so I think this is probably a bug in the toJson implementation (these fields are not optional)

Either that, or these are purposely left out as a performance improvement when sending data over the wire, and there is a separate way you're support to JSONify these objects when you care about getting the full object properly

@Mercurial Mercurial changed the title Add unit tests test: add initial unit tests (#38) Mar 16, 2025
@Mercurial Mercurial changed the title test: add initial unit tests (#38) test: add initial unit tests Mar 16, 2025
@Mercurial Mercurial merged commit 6ecfc2d into utxorpc:main Mar 16, 2025
@SebastienGllmt SebastienGllmt deleted the tests branch March 16, 2025 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants