@sprucelabs/jest-sheets-reporter
TypeScript icon, indicating that this package has built-in type declarations

2.0.21 • Public • Published

Google Sheets Reporter

Update a Google Sheet when your tests pass or fail.

Installing

yarn add -D @sprucelabs/jest-sheets-reporter
npm install --dev @sprucelabs/jest-sheets-reporter

Example Jest config

Inside your package.json there is a jest block.

Add the following configuration:

"jest": {
    "reporters": [
        "default",
        [
            "@sprucelabs/jest-sheets-reporter",
            {
                "sheetId": "{{spreadsheetId}}",
                "worksheetId": 0,
                "testMap": {
                    "testName": "destinationCell",
                    "getsGoodHealthCheckAndNothingElse": "C5",
                    "canGetLatestVersionBasedOnDir": "C16",
                    "canBuildSkill": "C24",
                    "canWatchAndBuild": "C25"
                }
            }
        ]
    ]
},

How does it work

This simple reporter matches the name of your test against what is in your jest config and updates the cell whose name matches.

If a test passes, the cell is set to 1.

If a test fails, the cell is set to 0.

Making it pretty

You can change the look of a cell by using conditional formatting:

Then we set the background and the text color based on the value being exactly 1 or 0.

Install

npm i @sprucelabs/jest-sheets-reporter

DownloadsWeekly Downloads

4,080

Version

2.0.21

License

none

Unpacked Size

33.6 kB

Total Files

27

Last publish

Collaborators

  • sprucelabs-ci
  • ryanrd
  • liquidg3