@get-skipper/vitest
v1.0.1
Published
Skipper plugin for Vitest — enable/disable tests from a Google Spreadsheet
Maintainers
Readme
@get-skipper/vitest
Skipper plugin for Vitest — enable/disable tests from a Google Spreadsheet.
Installation
pnpm add -D @get-skipper/vitest
# or
npm install --save-dev @get-skipper/vitestSetup
Update vitest.config.ts — this is the only change required:
import { defineConfig } from 'vitest/config';
import { createSkipperGlobalSetup, createSkipperGlobalTeardown, setupFile } from '@get-skipper/vitest';
const skipperConfig = {
spreadsheetId: process.env.SKIPPER_SPREADSHEET_ID!,
credentials: { credentialsBase64: process.env.GOOGLE_CREDS_B64! },
// Or for local dev:
// credentials: { credentialsFile: './service-account.json' },
};
export default defineConfig({
test: {
globalSetup: [createSkipperGlobalSetup(skipperConfig)],
globalTeardown: [createSkipperGlobalTeardown(skipperConfig)],
setupFiles: [setupFile],
// ... rest of your config
},
});No changes to test files are required. Tests with a future disabledUntil date are automatically skipped.
Test ID Format
{relative file path} > {describe block(s)} > {test name}Options
| Option | Default | Description |
|---|---|---|
| sheetName | first tab | Sheet tab to read/write |
| referenceSheets | [] | Additional tabs to read (read-only) |
| testIdColumn | "testId" | Column header for the test ID |
| disabledUntilColumn | "disabledUntil" | Column header for the disable date |
See the root README for the full configuration reference.
Modes
read-only(default): reads the spreadsheet, skips disabled tests. No writes.sync(SKIPPER_MODE=sync): same as read-only + reconciles the spreadsheet after the run.
See the root README for full setup instructions.
License
MIT
