Skip to content

Conversation

@sol-warrior
Copy link
Contributor

This PR modernizes the checking-accounts Anchor example by replacing deprecated Bankrun tests with a new LiteSVM test suite and aligning the project with current Solana testing practices as @Perelyn-sama mentioned in prev PR , bankrun is deprecated.

Changes Included

  • Added LiteSVM tests covering the checking-accounts workflow.
  • Updated TypeScript config (module system, target, JSON resolution).
  • Added LiteSVM dependencies and updated pnpm-lock.yaml.
  • Added a LiteSVM test script in Anchor.toml.
  • Removed deprecated Bankrun dependencies and old test file.

Request

@jacobcreech When you have a moment, I’d appreciate your review on this update.
Any suggestions or adjustments are most welcome — I’m happy to refine anything as needed.

Thank you for your time and support 🙌🏼

- Change module system to 'nodenext'
- Update target to 'es2020'
- Enable JSON module resolution
- Upgrade @solana/web3.js to version 1.98.4
- Add litesvm as a new dependency with version 0.4.0
- Update pnpm-lock.yaml to reflect changes in dependency versions and resolutions
- Introduce a new test script for LiteSVM in the Anchor.toml configuration file.
- Remove anchor-bankrun and solana-bankrun dependencies from package.json and pnpm-lock.yaml.
- Delete the bankrun.test.ts file as it is no longer needed, It's deprecated.

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

@Perelyn-sama Perelyn-sama Dec 1, 2025

Choose a reason for hiding this comment

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

the test script should work for tests/litesvm.test.ts too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review 🙌🏼.

Yes, litesvm-test is a separate script, but it uses the Node test runner, not Mocha.
Running anchor test will execute both test suites (litesvm-test.ts and test.ts).
Running anchor run litesvm-test will execute only the LiteSVM tests using the Node test runner.

Copy link
Collaborator

Choose a reason for hiding this comment

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

if litesvm.test.ts is the only test, what's the point of having two scripts that run it.

just the test script should be fine.

@Perelyn-sama
Copy link
Collaborator

Thanks for this and the other PR @sol-warrior , clean up the scripts and we'll run the workflows

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