Skip to content

A lightweight vitest reporter that sends results on a Notion page

License

Notifications You must be signed in to change notification settings

swan-io/vitest-notion-reporter

Repository files navigation

vitest-notion-reporter

Eager to make your unit tests a source of documentation for everyone in your company? Here comes a vitest reporter that creates documentation on Notion from your tests describes and its 🚀

Prerequisites

You will need to setup an integration in your Notion able to write on the root page you'll have for documentation.

Installation

npm install -D @swan-io/vitest-notion-reporter

Usage

Add the reporter to your vitest configuration

import { defineConfig, UserWorkspaceConfig } from "vitest/config";
import { NotionReporter } from "@swan-io/vitest-notion-reporter";

export default defineConfig(<UserWorkspaceConfig>{
  test: {
    reporters: [new NotionReporter()],
  },
});

Configuration

export NOTION_TOKEN=<YOUR-NOTION-TOKEN>
export NOTION_PARENT_PAGE_ID=<ROOT-PAGE-FOR-DOCUMENTATION-ID>

or

import { defineConfig, UserWorkspaceConfig } from "vitest/config";
import { NotionReporter } from "@swan-io/vitest-notion-reporter";

export default defineConfig(<UserWorkspaceConfig>{
  test: {
    reporters: [
      new NotionReporter({
        token: "<YOUR-NOTION-TOKEN>",
        parentPageId: "<ROOT-PAGE-FOR-DOCUMENTATION-ID>",
      }),
    ],
  },
});

Links

About

A lightweight vitest reporter that sends results on a Notion page

Resources

License

Stars

Watchers

Forks