8000 fix(cli): ensure Jest template respects TypeScript vs JavaScript flag (#3736) by hasip-timurtas · Pull Request #3749 · solana-foundation/anchor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(cli): ensure Jest template respects TypeScript vs JavaScript flag (#3736) #3749

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hasip-timurtas
Copy link
Contributor

Fixes #3736

This pull request introduces TypeScript support for test generation in the CLI tool, alongside existing JavaScript support. It includes changes to dynamically generate TypeScript test files based on user preferences and adds a new template for TypeScript tests specifically tailored for Solidity projects.

TypeScript Test File Generation:

  • cli/src/rust_template.rs: Updated the TestTemplate implementation to conditionally generate either JavaScript or TypeScript test files based on the js flag. TypeScript test files use a new template function for Solidity projects.

TypeScript Test Template for Solidity:

  • cli/src/solidity_template.rs: Added a new ts_jest function to generate TypeScript test templates for Solidity projects. This includes configuration for the Anchor framework and example test methods for initialization, state retrieval, and state modification.

This commit updates the test generation logic in `rust_template.rs` to support both JavaScript and TypeScript test files based on the project configuration. It introduces a new `ts_jest` function in `solidity_template.rs` for generating TypeScript test templates, ensuring compatibility with Solidity projects.
Copy link
vercel bot commented Jun 18, 2025

@hasip-timurtas is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@hasip-timurtas hasip-timurtas changed the title feat: Enhance test generation for JavaScript and TypeScript fix(cli): ensure Jest template respects TypeScript vs JavaScript flag (#3736) Jun 18, 2025
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.

New project was initialized with JavaScript instead of expected TypeScript for test source
1 participant
0