Skip to content

Update unit testing guide with code coverage#146

Open
dijidiji wants to merge 10 commits intothoth-tech:mainfrom
dijidiji:unit-test-coverage
Open

Update unit testing guide with code coverage#146
dijidiji wants to merge 10 commits intothoth-tech:mainfrom
dijidiji:unit-test-coverage

Conversation

@dijidiji
Copy link
Contributor

@dijidiji dijidiji commented Jul 20, 2025

Description

Added instructions on generating code coverage to the guide, corresponding to thoth-tech/splashkit-core#116

Type of change

  • Documentation (update or new)

How Has This Been Tested?

Testing Checklist

  • Have run npm run format
  • Have run npm run build
  • Have run npm run dev and/or npm run preview, using:
    • Chrome
    • Safari
    • Firefox

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for strong-fairy-c1bde1 ready!

Name Link
🔨 Latest commit 7228b9b
🔍 Latest deploy log https://app.netlify.com/projects/strong-fairy-c1bde1/deploys/68cbcbd4469b0e00082fba7c
😎 Deploy Preview https://deploy-preview-146--strong-fairy-c1bde1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for thoth-tech ready!

Name Link
🔨 Latest commit 7228b9b
🔍 Latest deploy log https://app.netlify.com/projects/thoth-tech/deploys/68cbcbd4fa7dff00082beeab
😎 Deploy Preview https://deploy-preview-146--thoth-tech.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@rory-cd rory-cd left a comment

Choose a reason for hiding this comment

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

General

Type of Change:

  • Documentation (new)

Content Quality:

  • Content is accurate and clear
  • Markdown formatting is consistent
  • Components used appropriately
  • Images render properly

Testing

  • Have run npm run format
  • Have run npm run build
  • Have run npm run dev and/or npm run preview, using:
    • Chrome
    • Safari
    • Firefox
  • Deploy preview verified

The test coverage instructions were followed in a Windows/WSL environment, using both the command line and the VSCode extension. Following the documentation produced the expected output as described.

Suggested Improvements

Optional improvements are commented inline below. As mentioned in thoth-tech/splashkit-core#116, the documentation may benefit from mentioning expected output differences when using VSCode compared to command line.

@@ -0,0 +1,135 @@
---
title: Code Coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a description here


Code coverage provides a convenient way to see what parts of SplashKit are being tested. This is
helpful for checking that existing tests are adequate, as well as for locating parts of the code
would be good candidates for new tests. Consider generating a code coverage report after adding a
Copy link
Contributor

Choose a reason for hiding this comment

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

...as well as for locating parts of the code would be good candidates for new tests.

Should be "...as well as for locating parts of the code that would be good candidates for new tests."

Comment on lines +19 to +21
Install lcov via your package manager e.g., `apt install lcov` (note that your Linux
distribution may use a different package manager rather than `apt`, and you may need to `sudo`
this command)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good place to implement a :::note callout for better readability.

This section would also benefit from a short description of code coverage tools and/or links to documentation.

Comment on lines +85 to +88
Note that currently code coverage reports won't display properly with versions of the CMake Tools
extension 1.21.36 and beyond. To work around this, you can install an older version of the extension
by clicking the arrow next to Install/Uninstall (depending on if you have CMake Tools installed
already) and selecting "Install Specific Version...". The latest version known to work is 1.20.53.
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be in a :::note or :::warning callout for better readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants