Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.35 KB

README.md

File metadata and controls

57 lines (41 loc) · 1.35 KB

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