Skip to content

Releases: anuraag016/Jest-Coverage-Diff

Release V1.4

22 Nov 07:17
2e0d638
Compare
Choose a tag to compare

What's Changed

  • Feature: Use same comment. Also don't pick removed files for delta validation by @anuraag016 in #30
  • Update README.md by @dickie81 in #32

New Contributors

Full Changelog: V1.3.1...V1.4

V1.3.1

14 Sep 07:39
fe1fd4b
Compare
Choose a tag to compare

What's Changed

  • Fix markdown table format in #24

Full Changelog: V1.3...V1.3.1

Release V1.3

18 Aug 04:57
Compare
Choose a tag to compare

This version of the action includes contributions from our awesome contributors:

  • Improves the UI of the diff comment that gets added

    • Adds a status icon by comparing % diff across different coverage metrics
    • Removes the strike off UI and instead shows the % change in brackets **(-20)**
    • Adds a nice header to the comment
    • Adds test for the DiffChecker class

The output would look like this now

Status File % Stmts % Branch % Funcs % Lines
🟢 file1 100 (1) 100 (1) 100 (1) 100 (1)
🔴 file2 99 (-1) 99 (-1) 99 (-1) 99 (-1)
🆕 file3 100 100 100 100
🔴 file4 100 100 100 100
  • Add afterSwitchCommand option that allows to run a command after switching to the default branch

    • The action now supports runnning a command just after switching to base branch, this is extremely helpful in cases where there might be some packages removed in the pull request raised, in such cases there now is a possibility to re run the npm ci/npm install commands before running the jset coverage on base branch. Use afterSwitchCommand variable to pass a custom command to be run after switching to base branch.
  • Fixes some bugs

Release V1.2

12 Aug 10:41
0581983
Compare
Choose a tag to compare

Please use the V1.3 to get all features.

Release V1.1

28 Jan 06:38
3971cd5
Compare
Choose a tag to compare

NEW:

  • The action now supports custom run command, for custom use cases, using the variable runCommand, you can now pass your own command to run. Following is an example where we want to collect coverage from only few files out of all the code and want to use custom options such as forceExit & detectOpenHandles.
   runCommand: "npx jest --collectCoverageFrom='[\"src/**/*.{js,jsx,ts,tsx}\"]' --coverage --collectCoverage=true --coverageDirectory='./' --coverageReporters='json-summary' --forceExit --detectOpenHandles test/.*test.*"

NOTE: If using custom command, --coverage --collectCoverage=true --coverageDirectory='./' --coverageReporters='json-summary', these options are necessary for the action to work properly. These options tells jest to collect the coverage in json summary format and put the final output in the root folder. Since these are necessary, will make the action add them automatically in the next version.

  • Do you want to fail the workflow if the commited code decreases the percentage below a tolerable level? Do you to start a healthy culture of writing test cases?
    The action now also supports failing the run if percentage diff is more than a specified delta value for any file, you can specify the delta value using the variable delta
  delta: 1 // the action will fail if any of the percentage dip is more than 1% for any changed file

V1 Release

20 Jul 08:33
Compare
Choose a tag to compare