Skip to content

Conversation

@acdmft
Copy link

@acdmft acdmft commented Jul 20, 2024

Hello, I appreciated your article on Medium (https://medium.com/nexton-node/nfts-with-on-chain-metadata-on-ton-tutorial-55ac0cbb17d5). So I've created unit tests for provided code. Maybe it could be interesting for your readers. If you think it's not worth including them then I apologize for bothering you. Thanks in advance and have a nice day!
P.S. To execute tests run npm run test in terminal.

@Cosmodude
Copy link
Owner

Wow, thanks for adding tests!
(I was too lazy to add them)

Let me take a look at them, to see if I can merge.

Copy link
Owner

@Cosmodude Cosmodude left a comment

Choose a reason for hiding this comment

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

Request for clarification and expansion of tests

description: "Collection of items with onChain metadata",
image: "https://raw.githubusercontent.com/Cosmodude/Nexton/main/Nexton_Logo.jpg"
name: process.env.COLLECTION_NAME!,
description: process.env.COLLECTION_DESCRIPTION!,
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we need these params from .env?

Copy link
Owner

Choose a reason for hiding this comment

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

Isn't hardcoded data more demonstrative?

// check next_item_index
expect(collection_data).toHaveProperty("nextItemId", BigInt(0));
// check collection content
expect(collection_data.collectionContent).toEqualCell(collectionContent);
Copy link
Owner

Choose a reason for hiding this comment

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

It would be great to check all the content fields one by one (name, description and image).

You can refer to these tests

https://github.com/Cosmodude/Nexton/blob/main/tests/NexTon.spec.ts#L111C9-L111C15

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