From 69fc13836b4c046c066afdef345466afce0b7855 Mon Sep 17 00:00:00 2001 From: Cno Date: Sun, 5 May 2024 20:37:12 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0cargo=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=88=B0package.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- package.json | 6 ++++-- src/utils/wild_match.rs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c021ec0e..61579caa 100644 --- a/README.md +++ b/README.md @@ -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/**` \ No newline at end of file +* 执行 `pnpm rust:ut` +* 如需要查看单测覆盖率,请安装 [tarpaulin](https://github.com/xd009642/tarpaulin) 后执行 `pnpm rust:ut:coverage` \ No newline at end of file diff --git a/package.json b/package.json index 96ec55df..0c46ae70 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils/wild_match.rs b/src/utils/wild_match.rs index 36e46109..6c324913 100644 --- a/src/utils/wild_match.rs +++ b/src/utils/wild_match.rs @@ -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)