From d624041eca094822739167affe32f09ea7580f0a Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 11 Apr 2021 10:48:56 +0800 Subject: [PATCH] Install nyc and Coveralls --- .github/workflows/linter.yml | 11 ++++++++++- .gitignore | 2 ++ package.json | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b756155..c197b62 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,6 +9,15 @@ jobs: - uses: actions/checkout@v2 - name: Use Node.js uses: actions/setup-node@v2 - - run: npm install + - name: Install Dependencies + run: npm install - run: npm run eslint - run: npm test + - name: Coverage + run: npm run test-cov + env: + CI: true + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ee3f9d8..e1390a6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ yarn.lock package-lock.json node_modules/ +.nyc_output/ +coverage/ diff --git a/package.json b/package.json index 118aa56..0b097ad 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "eslint": "eslint scripts/ source/js test/", "prepare": "node .githooks/install.js", "stylint": "stylint source/css/", - "test": "mocha test/index.js" + "test": "mocha test/index.js", + "test-cov": "nyc --reporter=lcovonly npm run test" }, "repository": "next-theme/hexo-theme-next", "keywords": [ @@ -38,6 +39,7 @@ "hexo-renderer-marked": "4.0.0", "js-yaml": "4.0.0", "mocha": "8.3.2", + "nyc": "15.1.0", "stylint": "2.0.0" } }