{"_id":"@bitcurve/reactor-configs-vitest","name":"@bitcurve/reactor-configs-vitest","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"@bitcurve/reactor-configs-vitest","type":"module","version":"0.0.0","private":false,"sideEffects":false,"license":"MIT","publishConfig":{"access":"public"},"devDependencies":{"vite-tsconfig-paths":"^4.3.2"},"peerDependencies":{"vite-tsconfig-paths":"^4.3.2"},"_id":"@bitcurve/reactor-configs-vitest@0.0.0","description":"Vitest app + library project configurations intended for pnpm workspaces (monorepos): `vitest.config.ts`.","_integrity":"sha512-IkCog3N5u7dJ2tffUkD6X6AQ83KVyRA8W1RBCUGgRanJJnM6t6SpMb9nFDh/XyLi0q+gh7C88Gl5DOY8MaYh8Q==","_resolved":"/tmp/3fabff85b5bd0c76d16b25c8c5520575/bitcurve-reactor-configs-vitest-0.0.0.tgz","_from":"file:bitcurve-reactor-configs-vitest-0.0.0.tgz","_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-IkCog3N5u7dJ2tffUkD6X6AQ83KVyRA8W1RBCUGgRanJJnM6t6SpMb9nFDh/XyLi0q+gh7C88Gl5DOY8MaYh8Q==","shasum":"5b4808ebc8c986daf9a0df99c1f2c1c8cf8714df","tarball":"https://registry.npmjs.org/@bitcurve/reactor-configs-vitest/-/reactor-configs-vitest-0.0.0.tgz","fileCount":6,"unpackedSize":5012,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNGbAkgHFkYbWf+7ZcqZHl0qK57ktGPuCxnkcFWlIaKAIgWUlI2JWsxD+QWrOmcJoQOt498k6L+dA9qfsWohVVorg="}]},"_npmUser":{"name":"bitcurvesystems","email":"contact@bitcurve.com"},"directories":{},"maintainers":[{"name":"bitcurvesystems","email":"contact@bitcurve.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reactor-configs-vitest_0.0.0_1722902792193_0.14097896829065615"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-06T00:06:32.066Z","0.0.0":"2024-08-06T00:06:32.395Z","modified":"2024-08-06T00:06:32.766Z"},"maintainers":[{"name":"bitcurvesystems","email":"contact@bitcurve.com"}],"description":"Vitest app + library project configurations intended for pnpm workspaces (monorepos): `vitest.config.ts`.","license":"MIT","readme":"# @bitcurve/reactor-configs-vitest\n\nVitest app + library project configurations intended for pnpm workspaces (monorepos): `vitest.config.ts`.\n\n\n## Configuration\n\n### Workspace\n\nEnsure the workspace root has a `vitest.workspace.ts` similar to the following that lists the directories subject to testing:\n\n```ts\nimport { defineWorkspace } from 'vitest/config'\n\n/**\n * Vitest workspace configuration.\n *\n * @see https://vitest.dev/guide/workspace\n */\nexport default defineWorkspace([\n  'apps/*',\n  'packages/*',\n  \n  // glob patterns are supported to match file extensions --\n  // 'packages/*/vitest.config.{e2e,unit}.ts',\n\n  {\n    // if a global vite config file is present you may wish to extend it...\n    // extends: './vite.config.js',\n\n    test: {\n      // environment: 'jsdom',\n      // ... other global test settings\n    },\n  },\n])\n```\n\nWhen defining a `vitest.config.ts` for individual apps or packages (projects) within the workspace use `defineProject()` instead of `defineConfig()` because workspace projects do not support all vitest configuration options.\n\n### React + Vite Projects\n\n## React\n\nThe `vitest-react.project.config.ts` config references `vite.config.ts` and requires a setup file at `'./test/setup.ts'`.\n\nExample `./test/setup.ts`:\n\n```ts\nimport { expect, afterEach } from 'vitest'\nimport { cleanup } from '@testing-library/react'\nimport * as matchers from '@testing-library/jest-dom/matchers'\nimport '@testing-library/jest-dom/vitest'\n\nexpect.extend(matchers)\n\nafterEach(() => {\n  cleanup()\n})\n```\n\nExample stub test:\n\n```ts\nimport { describe, it, expect } from 'vitest'\n\n// pnpm --filter @bitcurve/reactor-<project-name> test test/stub.test.ts\n\ndescribe('@bitcurve/reactor-<project-name> test stub', () => {\n  it('stub test always passes', () => {\n    expect(true).toBe(true)\n  })\n})\n```\n\n","readmeFilename":"README.md"}