Is there an easy way to mint some fake NFT that belongs to certain fake collection within Anchor JS tests? This would be really handy for testing Anchor instructions, NFTs validation/authentication etc.
1 Answer
You can utilize the @metaplex-foundation/js
package to create them easily.
import { keypairIdentity, Metaplex } from '@metaplex-foundation/js`
const metaplex = new Metaplex(provider.connection).use(keypairIdentity(provider.wallet.payer));
const nft = await metaplex.nfts().create({
name: "My Digital Collectible",
sellerFeeBasisPoints: 0,
uri: "https://arweave.net/my-content-hash",
isMutable: true,
});