-
Notifications
You must be signed in to change notification settings - Fork 3
tests for NftCollection class #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Wow, thanks for adding tests! Let me take a look at them, to see if I can merge. |
Cosmodude
left a comment
There was a problem hiding this 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!, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
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 testin terminal.