{"_id":"@swedevtools/livedoc-vitest","_rev":"2-b46da8aa5abdff7fa546654982d6ab46","name":"@swedevtools/livedoc-vitest","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@swedevtools/livedoc-vitest","version":"0.2.0","keywords":["livedoc","vitest","bdd","gherkin","cucumber","mspec","specification","javascript","typescript","testing","tests"],"author":{"name":"Garry McGlennon"},"license":"MIT","_id":"@swedevtools/livedoc-vitest@0.2.0","maintainers":[{"name":"swedevtools","email":"livedoc@swedevtools.com"}],"homepage":"https://github.com/dotnetprofessional/LiveDoc/tree/master/packages/vitest#readme","bugs":{"url":"https://github.com/dotnetprofessional/LiveDoc/issues"},"bin":{"livedoc-vitest-setup":"tools/livedoc-setup.mjs"},"dist":{"shasum":"d914674300a3d1f8d85dae4509b4245dc6e75002","tarball":"https://registry.npmjs.org/@swedevtools/livedoc-vitest/-/livedoc-vitest-0.2.0.tgz","fileCount":35,"integrity":"sha512-QnetR7pOu9e7qNAggj5EfULLdrWKcytOgEyg3UjyqZOd7S2GDX46QMKLL0Y3Ko1xvlvov36oM5qbbcFmvZo3eA==","signatures":[{"sig":"MEUCIQDRbwuk1CDubZ/XYmBpaG4kn1EGnd+JTxhf+NLiq13TOAIgPyXFl0qfR15TdX037wavXxdohOq/hO6Pp+UU1YB9poI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1378142},"main":"./dist/index.cjs","type":"module","_from":"file:swedevtools-livedoc-vitest-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./setup":{"types":"./dist/setup.d.ts","import":"./dist/setup.js","require":"./dist/setup.cjs"},"./globals":{"types":"./dist/globals.d.ts","import":"./dist/globals.js","require":"./dist/globals.cjs"},"./reporter":{"types":"./dist/reporter/index.d.ts","import":"./dist/reporter/index.js","require":"./dist/reporter/index.cjs"},"./playwright":{"types":"./dist/playwright/index.d.ts","import":"./dist/playwright/index.js","require":"./dist/playwright/index.cjs"}},"scripts":{"test":"vitest run --config livedoc.vitest.ts","build":"npm run compile","clean":"rimraf dist \"*.tgz\" -g","watch":"tsup --watch","compile":"tsup","test:ui":"vitest --ui --config livedoc.vitest.ts","test:file":"vitest run --config vitest.config.file.ts","test:json":"vitest run --config vitest.config.json.ts","test:list":"vitest run --config vitest.config.list.ts","test:spec":"vitest run --config livedoc.vitest.ts","pack:local":"pnpm pack","test:watch":"vitest --config livedoc.vitest.ts","publish:dry":"npm publish --dry-run","test:silent":"vitest run --config vitest.config.silent.ts","test:viewer":"vitest run --config vitest.config.viewer.ts","publish:beta":"npm publish --tag beta","test:publish":"vitest run --config vitest.config.publish.ts","test:summary":"vitest run --config vitest.config.summary.ts","test:coverage":"vitest run --coverage --config livedoc.vitest.ts","publish:release":"npm publish"},"_npmUser":{"name":"swedevtools","email":"livedoc@swedevtools.com"},"_resolved":"C:\\Users\\garrm\\AppData\\Local\\Temp\\887d374655944cd83cf576a9d034c1a9\\swedevtools-livedoc-vitest-0.2.0.tgz","_integrity":"sha512-QnetR7pOu9e7qNAggj5EfULLdrWKcytOgEyg3UjyqZOd7S2GDX46QMKLL0Y3Ko1xvlvov36oM5qbbcFmvZo3eA==","repository":{"url":"git+https://github.com/dotnetprofessional/LiveDoc.git","type":"git","directory":"packages/vitest"},"_npmVersion":"11.9.0","description":"BDD extensions for Vitest that support LiveDoc reporting with Gherkin syntax and MSpec-style specifications.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"diff":"^5.2.0","chalk":"^5.6.2","fs-extra":"^11.3.3","wordwrap":"^1.0.0","cli-table3":"^0.6.5","@types/diff":"^7.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^6.2.1","tsup":"^8.5.1","rimraf":"^5.0.10","vitest":"^4.0.16","@vitest/ui":"^4.0.16","playwright":"^1.59.1","strip-ansi":"^7.1.2","typescript":"^5.9.3","@types/chai":"^5.2.3","@types/node":"^20.19.27","@vitest/runner":"^4.0.16","@types/fs-extra":"^11.0.4","@types/wordwrap":"^1.0.3","@swedevtools/livedoc-schema":"1.2.0","@swedevtools/livedoc-server":"^1.2.1"},"peerDependencies":{"vitest":">=1.0.0","playwright":">=1.50.0","@swedevtools/livedoc-server":">=1.0.0"},"peerDependenciesMeta":{"playwright":{"optional":true},"@swedevtools/livedoc-server":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/livedoc-vitest_0.2.0_1776831050474_0.0725835637617176","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@swedevtools/livedoc-vitest","version":"0.3.0","author":{"name":"Garry McGlennon"},"license":"MIT","description":"BDD extensions for Vitest that support LiveDoc reporting with Gherkin syntax and MSpec-style specifications.","repository":{"type":"git","url":"git+https://github.com/dotnetprofessional/LiveDoc.git","directory":"packages/vitest"},"homepage":"https://github.com/dotnetprofessional/LiveDoc/tree/master/packages/vitest#readme","bugs":{"url":"https://github.com/dotnetprofessional/LiveDoc/issues"},"publishConfig":{"access":"public"},"type":"module","bin":{"livedoc-vitest-setup":"tools/livedoc-setup.mjs"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./reporter":{"types":"./dist/reporter/index.d.ts","import":"./dist/reporter/index.js","default":"./dist/reporter/index.js"},"./setup":{"types":"./dist/setup.d.ts","import":"./dist/setup.js","default":"./dist/setup.js"},"./globals":{"types":"./dist/globals.d.ts","import":"./dist/globals.js","default":"./dist/globals.js"},"./playwright":{"types":"./dist/playwright/index.d.ts","import":"./dist/playwright/index.js","default":"./dist/playwright/index.js"}},"keywords":["livedoc","vitest","bdd","gherkin","cucumber","mspec","specification","javascript","typescript","testing","tests"],"engines":{"node":">=18.0.0"},"devDependencies":{"@types/chai":"^5.2.3","@types/fs-extra":"^11.0.4","@types/node":"^20.19.27","@types/wordwrap":"^1.0.3","@vitest/coverage-v8":"4.1.0","@vitest/runner":"^4.0.16","@vitest/ui":"^4.0.16","chai":"^6.2.1","playwright":"^1.59.1","rimraf":"^5.0.10","strip-ansi":"^7.1.2","tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.16","@swedevtools/livedoc-server":"^0.3.0","@swedevtools/livedoc-schema":"0.3.0"},"peerDependencies":{"@swedevtools/livedoc-server":">=0.3.0","playwright":">=1.50.0","vitest":">=4.0.16 <5"},"peerDependenciesMeta":{"@swedevtools/livedoc-server":{"optional":true},"playwright":{"optional":true}},"dependencies":{"@types/diff":"^7.0.2","chalk":"^5.6.2","cli-table3":"^0.6.5","diff":"^5.2.0","fs-extra":"^11.3.3","wordwrap":"^1.0.0"},"scripts":{"test":"vitest run --config livedoc.vitest.ts","test:watch":"vitest --config livedoc.vitest.ts","test:ui":"vitest --ui --config livedoc.vitest.ts","test:summary":"vitest run --config vitest.config.summary.ts","test:list":"vitest run --config vitest.config.list.ts","test:spec":"vitest run --config livedoc.vitest.ts","test:silent":"vitest run --config vitest.config.silent.ts","test:file":"vitest run --config vitest.config.file.ts","test:json":"vitest run --config vitest.config.json.ts","test:viewer":"vitest run --config vitest.config.viewer.ts","test:publish":"vitest run --config vitest.config.publish.ts","test:coverage":"vitest run --coverage --config livedoc.vitest.ts","clean":"rimraf dist \"*.tgz\" -g","compile":"tsup","build":"npm run compile","watch":"tsup --watch","pack:local":"pnpm pack","publish:dry":"npm publish --dry-run","publish:beta":"npm publish --tag beta","publish:release":"npm publish"},"_id":"@swedevtools/livedoc-vitest@0.3.0","_integrity":"sha512-l7PQRYg2PJZ4fE9X3L7Qu1dz0Y+CJFD7sCRPewuhRUwhoiGVOjCffDgGA+7Bu1G8BZxNofF4MX+eQxKbES5UEw==","_resolved":"C:\\Users\\garrm\\AppData\\Local\\Temp\\057bbd1bfd4c0e683e53a56ba9a53c34\\swedevtools-livedoc-vitest-0.3.0.tgz","_from":"file:swedevtools-livedoc-vitest-0.3.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-l7PQRYg2PJZ4fE9X3L7Qu1dz0Y+CJFD7sCRPewuhRUwhoiGVOjCffDgGA+7Bu1G8BZxNofF4MX+eQxKbES5UEw==","shasum":"fca94d746e0c6cac999b3e31d05c02d485a30cd8","tarball":"https://registry.npmjs.org/@swedevtools/livedoc-vitest/-/livedoc-vitest-0.3.0.tgz","fileCount":28,"unpackedSize":794549,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCqUPsEZnCnh2/Y9fA8gk83ZRqA6JrJ3x7SZ+hJRE28wIgfbT/S859DrG9kDvJR+EJFfl2iM8pu/U5+H24p+6OLss="}]},"_npmUser":{"name":"swedevtools","email":"livedoc@swedevtools.com"},"directories":{},"maintainers":[{"name":"swedevtools","email":"livedoc@swedevtools.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/livedoc-vitest_0.3.0_1788882068719_0.598955575103588"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T04:10:50.326Z","modified":"2026-09-08T15:41:09.049Z","0.2.0":"2026-04-22T04:10:50.674Z","0.3.0":"2026-09-08T15:41:08.872Z"},"bugs":{"url":"https://github.com/dotnetprofessional/LiveDoc/issues"},"author":{"name":"Garry McGlennon"},"license":"MIT","homepage":"https://github.com/dotnetprofessional/LiveDoc/tree/master/packages/vitest#readme","keywords":["livedoc","vitest","bdd","gherkin","cucumber","mspec","specification","javascript","typescript","testing","tests"],"repository":{"type":"git","url":"git+https://github.com/dotnetprofessional/LiveDoc.git","directory":"packages/vitest"},"description":"BDD extensions for Vitest that support LiveDoc reporting with Gherkin syntax and MSpec-style specifications.","maintainers":[{"name":"swedevtools","email":"livedoc@swedevtools.com"}],"readme":"<div align=\"center\">\n\n# @swedevtools/livedoc-vitest\n\n### Turn your tests into living documentation\n\n[![npm version](https://img.shields.io/npm/v/@swedevtools/livedoc-vitest.svg)](https://www.npmjs.com/package/@swedevtools/livedoc-vitest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n**Write tests in Gherkin. Get documentation that never goes stale.**\n\n📖 **[Full Documentation →](https://livedoc.swedevtools.com/vitest/learn/getting-started)**\n\n</div>\n\n---\n\n## What is LiveDoc?\n\nLiveDoc brings Behavior-Driven Development to Vitest with full Gherkin syntax — **Feature / Scenario / Given / When / Then**, **Specification / Rule**, **Scenario Outlines**, **Tags & Filtering**, and **beautiful reports**.\n\n## Quick Start\n\n### Install\n\n```bash\nnpm install --save-dev vitest@^4.0.16 @swedevtools/livedoc-vitest\n```\n\n### Fastest Setup: Point Your AI at the Bootstrap URL\n\nTell your assistant:\n\n> Read https://livedoc.swedevtools.com/ai/setup.md and configure this Vitest\n> project for LiveDoc. Inspect it first, ask me one configuration question at a\n> time, and wait for approval before making changes.\n\nNo LiveDoc package or skill needs to be installed first.\n[AI project setup →](https://livedoc.swedevtools.com/guides/ai-project-setup)\n\nAI setup installs version-matched skills inside the repository for every\nselected tool. Run `npx livedoc-vitest-setup --tool copilot,codex,claude` later\nto refresh them or add another tool. It also adds `test:livedoc` and, when\ncoverage is enabled, `test:livedoc:coverage` package scripts.\n\n### Create a spec\n\n```ts\n// tests/Calculator.Spec.ts\nimport { feature, scenario, given, when, Then as then, and } from '@swedevtools/livedoc-vitest';\n\nfeature(\"Calculator\", () => {\n  scenario(\"Adding two numbers\", () => {\n    let result = 0;\n\n    given(\"I have entered '50' into the calculator\", (ctx) => {\n      result = ctx.step.values[0];\n    });\n\n    and(\"I have entered '70' into the calculator\", (ctx) => {\n      result += ctx.step.values[0];\n    });\n\n    when(\"I press add\", () => {\n      // Addition already happened above\n    });\n\n    then(\"the result should be '120'\", (ctx) => {\n      expect(result).toBe(ctx.step.values[0]);\n    });\n  });\n});\n```\n\n> **Why `Then as then`?** ES modules treat `then` as a thenable indicator. We export `Then` (uppercase) and you alias it.\n\n### Configure Vitest\n\n```ts\n// vitest.config.ts\nimport { defineConfig } from 'vitest/config';\nimport { LiveDocSpecReporter } from '@swedevtools/livedoc-vitest/reporter';\n\nexport default defineConfig({\n  test: {\n    globals: true,\n    include: ['**/*.Spec.ts'],\n    reporters: [new LiveDocSpecReporter()],\n  },\n});\n```\n\n### Run\n\n```bash\nnpx vitest run\n```\n\n### Publish a focused partial run\n\nAfter publishing one full baseline, mark an isolated development run as partial so the Viewer keeps the complete latest-known picture:\n\n```bash\nLIVEDOC_RUN_TYPE=partial npx vitest run features/Login.Spec.ts\n```\n\nYou can also set `publish.runType` or `LiveDocViewerReporter({ runType: 'partial' })` in configuration. Partial runs require a running LiveDoc server and a completed full baseline for the same project and environment. Direct JSON/static partial export is not supported; release and production exports should use a full run.\n\n### Add coverage evidence\n\nLiveDoc can attach Vitest coverage as optional run evidence. It does not change the test run status; threshold misses appear as warnings in the viewer.\n\nInstall the V8 provider on the same version as Vitest:\n\n```bash\nnpm install --save-dev @vitest/coverage-v8\n```\n\n```typescript\n// vitest.config.ts\nimport { defineConfig } from 'vitest/config';\nimport { LiveDocSpecReporter } from '@swedevtools/livedoc-vitest/reporter';\n\nexport default defineConfig({\n  test: {\n    reporters: [\n      new LiveDocSpecReporter({\n        coverage: { enabled: true, thresholds: { lines: 80 } },\n      }),\n    ],\n    coverage: {\n      enabled: true,\n      provider: 'v8',\n      reporter: ['text', 'html', 'json-summary'],\n    },\n  },\n});\n```\n\n```bash\nnpx vitest run --coverage\n```\n\nLiveDoc consumes Vitest's in-memory coverage map before the run is published. It also auto-detects `coverage/coverage-summary.json` and `coverage/lcov.info` as fallbacks. For custom artifact paths, set `coverage.artifactPath` in the reporter or use `LIVEDOC_COVERAGE_PATH`.\n\nSee the [Code Coverage guide](https://livedoc.swedevtools.com/viewer/guides/code-coverage) for provider choices, thresholds, troubleshooting, and the Viewer module hierarchy.\n\n---\n\n## Documentation\n\n📖 **[Full documentation at livedoc.swedevtools.com →](https://livedoc.swedevtools.com/vitest/learn/getting-started)**\n\nCovers getting started, BDD & Specification patterns, data extraction, scenario outlines, tags & filtering, reporters, viewer integration, CI/CD, troubleshooting, and more.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}