Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/websocket-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ jobs:
- name: Run unit tests
run: pnpm run test

- name: Run unit tests with coverage
if: matrix.node-version == '20.x'
run: pnpm run test:coverage

- name: Upload coverage to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

- name: Pull Autobahn Test Suite Docker image
run: docker pull crossbario/autobahn-testsuite

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ WebSocket Client & Server Implementation for Node

[ ![Codeship Status for theturtle32/WebSocket-Node](https://codeship.com/projects/70458270-8ee7-0132-7756-0a0cf4fe8e66/status?branch=master)](https://codeship.com/projects/61106)

[![codecov](https://codecov.io/gh/theturtle32/WebSocket-Node/branch/v2/graph/badge.svg)](https://codecov.io/gh/theturtle32/WebSocket-Node)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better accessibility and clarity, it's good practice to use more descriptive alt text for the Codecov badge. I suggest changing it from codecov to code coverage.

Suggested change
[![codecov](https://codecov.io/gh/theturtle32/WebSocket-Node/branch/v2/graph/badge.svg)](https://codecov.io/gh/theturtle32/WebSocket-Node)
[![code coverage](https://codecov.io/gh/theturtle32/WebSocket-Node/branch/v2/graph/badge.svg)](https://codecov.io/gh/theturtle32/WebSocket-Node)


Overview
--------
This is a (mostly) pure JavaScript implementation of the WebSocket protocol versions 8 and 13 for Node. There are some example client and server applications that implement various interoperability testing protocols in the "test/scripts" folder.
Expand Down
39 changes: 39 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project:
default:
target: 85%
threshold: 1%
if_ci_failed: error

patch:
default:
target: 80%
threshold: 2%
if_ci_failed: error

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To reduce comment noise on pull requests, consider setting require_changes to yes. This will ensure that Codecov only posts a comment when there's an actual change in code coverage, making PR discussions cleaner.

  require_changes: yes

require_base: no
require_head: yes

ignore:
- "test/**"
- "examples/**"
- "bench/**"
- "docs/**"
- "scripts/**"
- "**/*.test.mjs"
- "**/*.test.js"
- "**/*.bench.mjs"
Comment on lines 32 to 40

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The vitest.config.mjs file excludes lib/version.js from coverage reporting. To maintain consistency and ensure Codecov's report accurately reflects what's being tested, it's a good practice to also add this file to the ignore list here.

  - "test/**"
  - "examples/**"
  - "bench/**"
  - "docs/**"
  - "scripts/**"
  - "lib/version.js"
  - "**/*.test.mjs"
  - "**/*.test.js"
  - "**/*.bench.mjs"