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 1


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,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.