Skip to content

Conversation

@sol-warrior
Copy link

Overview

This PR introduces LiteSVM based testing for the basics/account-data/anchor example.
It adds the LiteSVM dependency, test script entries, and a full test file covering account data operations.

Changes Included

  • Added litesvm to package.json dependencies
  • Added litesvm-test script in Anchor.toml
  • Added tests/litesvm.test.ts
  • Updated lockfile (pnpm-lock.yaml)

Motivation

LiteSVM offers a lightweight fast and modern testing environment. Many developers prefer writing tests using LiteSVM.
I hope this addition helps contributors and learners explore multiple testing approaches for Anchor programs.

Request

@jacobcreech Kindly review the changes at your convenience.
I’m happy to revise or improve anything based on your feedback.

Thank you for your time and consideration 🙌🏼

@Perelyn-sama
Copy link
Collaborator

Thanks for this, I ran the tests locally and they work.

Could you remove the bankrun tests(bankrun is depreciated) and also your comments on litesvm.test.ts::97 and anchor.toml::17

@sol-warrior
Copy link
Author

sol-warrior commented Nov 29, 2025

@Perelyn-sama Thanks for the quick review! 🙌🏼
I’ve removed the bankrun tests and cleaned up the comments in both litesvm.test.ts and Anchor.toml as requested.

@jacobcreech Please let me know if anything else needs adjustment — happy to refine further 🙌🏼.

I’d also love to continue contributing to more examples to write litesvm tests for anchor in this repo. If you have any suggestions, I really appreciate it.

[scripts]
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" #For all test
litesvm-test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/litesvm.test.ts" #For litesvm test
Copy link
Collaborator

Choose a reason for hiding this comment

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

just the test script is fine since we only have litesvm tests

remove the #For all test comment too

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