JSPM

@sprucelabs/jest-sheets-reporter

1.2.101
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 730
  • Score
    100M100P100Q119418F

Have your Jest tests update a Google Spreadsheet™®©. 📡

Package Exports

  • @sprucelabs/jest-sheets-reporter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sprucelabs/jest-sheets-reporter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Google Sheets Reporter

Update a Google Sheet when your tests pass or fail.

Example Jest config

"jest": {
    "reporters": [
        "default",
        [
            "@sprucelabs/jest-sheets-reporter",
            {
                "sheetId": "{{spreadsheetId}}",
                "worksheetId": {{tabId}},
                "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.