Skip to content

Commit

Permalink
chore: 添加cargo命令到package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed May 5, 2024
1 parent a67e43f commit 69fc138
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ept
## 单元测试
* (可选)在根目录中创建 `config.toml` 文件并指定 `local.base` 用于隔离测试安装环境
* 执行 `cargo test -- --test-threads 1`
* 如需要查看单测覆盖率,请安装 [tarpaulin](https://github.com/xd009642/tarpaulin) 后执行 `cargo tarpaulin -o html --exclude-files test/** --exclude-files node_modules/**`
* 执行 `pnpm rust:ut`
* 如需要查看单测覆盖率,请安装 [tarpaulin](https://github.com/xd009642/tarpaulin) 后执行 `pnpm rust:ut:coverage`
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"license": "MPL-2.0",
"scripts": {
"dev": "rspress dev",
"build": "yarn gen && rspress build",
"build": "pnpm gen && rspress build",
"preview": "rspress preview",
"gen": "ts-node ./scripts/index.ts",
"lint": "eslint --fix scripts/**",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
"postpack": "pinst --enable",
"rust:ut": "cargo test -- --test-threads 1",
"rust:ut:coverage": "cargo tarpaulin -o html --exclude-files test/** --exclude-files node_modules/** && start tarpaulin-report.html"
},
"dependencies": {
"react": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/wild_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ fn test_parse_wild_match() {
use std::env::current_dir;
let located = p2s!(current_dir().unwrap());
assert!(
parse_wild_match("*.lock".to_string(), &located)
parse_wild_match("*.yaml".to_string(), &located)
.unwrap()
.len()
== 2
== 1
);
assert!(
parse_wild_match("src/*.rs".to_string(), &located)
Expand Down

0 comments on commit 69fc138

Please sign in to comment.