Skip to content
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

cli: init rust test #2805

Merged
merged 29 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f3d1ad0
feat: add rust option in init
aoikurokawa Jan 31, 2024
e020739
feat: modify init command
aoikurokawa Feb 1, 2024
30278d2
feat: add some new templates for rust tests
aoikurokawa Feb 1, 2024
247c703
feat: use template instead of flag
aoikurokawa Feb 4, 2024
5e81fbc
fix: remove each templates for rust test
aoikurokawa Feb 4, 2024
98462cf
fix: add program files
aoikurokawa Feb 4, 2024
750a3dc
chore: remove warnings
aoikurokawa Feb 4, 2024
2b3912a
chore: fix clippy problem
aoikurokawa Feb 4, 2024
97b7e62
feat: define enum for TestTemplate
aoikurokawa Feb 7, 2024
6962a06
refact: divide test module
aoikurokawa Feb 7, 2024
f340657
refact: divide test module
aoikurokawa Feb 7, 2024
5a33468
feat: test template module
aoikurokawa Feb 7, 2024
dbcaedc
feat: remove code that create test files
aoikurokawa Feb 8, 2024
175382b
feat: takes multiple program template
aoikurokawa Feb 8, 2024
47abcdb
chore: fix clippy
aoikurokawa Feb 8, 2024
06351ee
chore: remove comments
aoikurokawa Feb 8, 2024
e1d42c7
feat: when rust-test, choose single or multiple
aoikurokawa Feb 8, 2024
1980a8e
chore: remove test_template.rs and move logic into rust_template
aoikurokawa Feb 11, 2024
567d5ff
fix: fix unit test error
aoikurokawa Feb 11, 2024
a483615
chore: remove comments and modify cli explanation
aoikurokawa Feb 11, 2024
6769c82
chore: remove comments
aoikurokawa Feb 11, 2024
466f2fc
fix: modify variable name
aoikurokawa Feb 11, 2024
a5f6c86
doc: add new log
aoikurokawa Feb 11, 2024
98aaf63
fix: remove tests_mod variable from program creation
aoikurokawa Feb 13, 2024
b769ce4
fix: create rust tests module inside test creation
aoikurokawa Feb 13, 2024
293aca9
chore: revert unnecessary modification
aoikurokawa Feb 13, 2024
3d6b6af
doc: change breaking to features
aoikurokawa Feb 13, 2024
1a61596
fix: do not initialize git repo
aoikurokawa Feb 13, 2024
7cf0785
fix: conflicts
aoikurokawa Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: define enum for TestTemplate
  • Loading branch information
aoikurokawa committed Feb 7, 2024
commit 97b7e6204a47bfbd61bd881d776eb6a4bb092c90
12 changes: 12 additions & 0 deletions cli/src/rust_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ module.exports = async function (provider) {
"#
}

/// Test initialization template
#[derive(Clone, Debug, Default, Eq, PartialEq, Parser, ValueEnum)]
pub enum TestTemplate {
/// Generate template for Jest unit-test
#[default]
Mocha,
/// Generate template for Jest unit-test
Jest,
/// Generate template for Rust unit-test
Rust,
}

pub fn mocha(name: &str) -> String {
format!(
r#"const anchor = require("@coral-xyz/anchor");
Expand Down