Skip to content

Commit

Permalink
chore(misc): complete yarn->npm, fix coverage report and badge
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Oct 14, 2024
1 parent 0496b73 commit 4484584
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
27 changes: 4 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,11 @@ jobs:
- name: Run CI script (tests)
run: npm run ci

- name: Jest Coverage Comment
id: coverageComment
uses: MishaKav/jest-coverage-comment@main
- name: Upload coverage to gist
uses: gaelgirodon/ci-badges-action@v1
with:
hide-comment: true
coverage-summary-path: ./coverage/coverage-summary.json

- name: Check the output coverage
run: |
echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}"
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}"
echo "Summary HTML - ${{ steps.coverageComment.outputs.summaryHtml }}"
- name: Create the badge
if: github.ref == 'refs/heads/main'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GH_TOKEN_GISTS }}
gistID: 26d0f88b04b6883e1a6bba5b9b344fab
filename: jest-coverage-comment__main.json
label: Coverage
message: ${{ steps.coverageComment.outputs.coverage }}%
color: ${{ steps.coverageComment.outputs.color }}
# namedLogo: javascript
gist-id: 26d0f88b04b6883e1a6bba5b9b344fab
token: ${{ secrets.GH_TOKEN_GISTS }}

- name: Save runtime tests result to gist
uses: exuanbo/actions-deploy-gist@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ coverage
lib
results.yaml
tests/fixtures/http
lcov.info
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Caching mock fetch implementation for all runtimes and frameworks.

Copyright (c) 2023 by Gadi Cohen. [MIT Licensed](./LICENSE.txt).

![npm](https://img.shields.io/npm/v/jest-fetch-mock-cache) ![JSR Version](https://img.shields.io/jsr/v/%40gadicc/fetch-mock-cache) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/gadicc/jest-fetch-mock-cache/release.yml) ![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/gadicc/26d0f88b04b6883e1a6bba5b9b344fab/raw/jest-coverage-comment__main.json) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
![npm](https://img.shields.io/npm/v/jest-fetch-mock-cache) ![JSR Version](https://img.shields.io/jsr/v/%40gadicc/fetch-mock-cache) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/gadicc/jest-fetch-mock-cache/release.yml) ![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/gadicc/26d0f88b04b6883e1a6bba5b9b344fab/raw/fetch-mock-cache-lcov-coverage.json) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

## Introduction

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"types": "lib/index.d.ts",
"scripts": {
"test": "node --experimental-vm-modules --test --import tsx `glob 'src/**/*.spec.ts'`",
"test:all": "yarn test && yarn tsc && yarn lint",
"test:all": "npm run test && npm run tsc && npm run lint",
"lint": "eslint src",
"prettier": "prettier -w src",
"build": "tsc",
"prepublishOnly": "yarn build",
"coverage": "test --coverage",
"ci": "yarn tsc --noEmit && yarn lint && yarn coverage && cd tests/runtimes && ./test.sh"
"prepublishOnly": "npm run build",
"coverage": "node --experimental-vm-modules --test --import tsx --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info `glob 'src/**/*.spec.ts'`",
"ci": "tsc --noEmit && npm run lint && npm run coverage && cd tests/runtimes && ./test.sh"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 4484584

Please sign in to comment.