From 1869983fa46b1e73798df3fd7e5021d93cfdc7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BB=95=E6=98=A5?= Date: Sun, 9 Jul 2023 17:37:31 +0800 Subject: [PATCH] chore: add nyc test coverage docs: add coverage --- .gitignore | 4 +++- README.MD | 2 ++ package.json | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6aa6396..d88745b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules dist/** -yarn.lock \ No newline at end of file +yarn.lock + +.nyc_output \ No newline at end of file diff --git a/README.MD b/README.MD index 62b0806..3be632a 100644 --- a/README.MD +++ b/README.MD @@ -4,6 +4,8 @@ > 像使用 `lodash.js` 一样方便地操控树结构 +![](https://pic.zhangshichun.top/pic/20230709-01.png) + ## Install (安装) ```shell diff --git a/package.json b/package.json index 6f7925a..37a36a4 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "build:umd": "cross-env NODE_ENV=production rollup -c rollup.umd.config.js", "build:esm": "cross-env NODE_ENV=production rollup -c rollup.esm.config.js", "postbuild": "tsc --emitDeclarationOnly --declaration --project ts.config.json --outDir dist/esm", - "test": "cross-env TS_NODE_PROJECT='test/tsconfig.test.json' mocha" + "test": "cross-env TS_NODE_PROJECT='test/tsconfig.test.json' mocha", + "test-with-coverage": "cross-env TS_NODE_PROJECT='test/tsconfig.test.json' nyc --reporter=text mocha" }, "files": [ "dist" @@ -40,10 +41,12 @@ "@types/node": "^20.3.3", "@types/sinon": "^10.0.15", "chai": "^4.3.7", + "coveralls": "^3.1.1", "cross-env": "^7.0.3", "esbuild": "^0.14.43", "mocha": "^10.2.0", "npm-run-all": "^4.1.5", + "nyc": "^15.1.0", "rollup": "^2.68.0", "rollup-plugin-esbuild": "^4.9.1", "rollup-plugin-livereload": "^2.0.5",