{"_id":"@alphinex/testing","_rev":"3-a7164b22d77fd1a0515074f4622c8adc","name":"@alphinex/testing","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@alphinex/testing","version":"1.0.0","license":"UNLICENSED","_id":"@alphinex/testing@1.0.0","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"6c59c9787e55396b4d6d06fde7f0355d3329c0cc","tarball":"https://registry.npmjs.org/@alphinex/testing/-/testing-1.0.0.tgz","fileCount":5,"integrity":"sha512-XbCRRLIEKk5Tp+pkLNQ/GiyIbagY9hFdiTpyiUXrGog7DtL13GXN7POCQxetdAuMtANUs0iBx+nDvzfb4aceqw==","signatures":[{"sig":"MEUCIQD+TWgA1RuyIpZyN/eCdOYdK2HSWJQQMXGPJE76YaK0KAIgQyGQTeB1mYI+BwGRdDI11dYzvnYwZAvEJsx62XN5pJI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16327},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run --passWithNoTests","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared test utilities: provider-wrapped render(), mock server setup, fixtures.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/api":"1.0.0","@alphinex/core":"1.0.0","@alphinex/theme":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.7.0","vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","react-router-dom":"^7.1.1","@vitejs/plugin-react":"^4.3.4","@tanstack/react-query":"^5.62.7","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0"},"peerDependencies":{"msw":"^2.7.0","react":"^19.0.0","vitest":"^2.1.8","react-dom":"^19.0.0","react-router-dom":"^7.1.1","@tanstack/react-query":"^5.62.7","@testing-library/react":"^16.1.0"},"peerDependenciesMeta":{"msw":{"optional":false},"react":{"optional":false},"vitest":{"optional":false},"react-dom":{"optional":false},"react-router-dom":{"optional":false},"@tanstack/react-query":{"optional":false},"@testing-library/react":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/testing_1.0.0_1785852484913_0.2794525982953595","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alphinex/testing","version":"1.0.1","license":"UNLICENSED","_id":"@alphinex/testing@1.0.1","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"2fbb0cb052333e9fe38527b77472c86f35d474b1","tarball":"https://registry.npmjs.org/@alphinex/testing/-/testing-1.0.1.tgz","fileCount":5,"integrity":"sha512-AxWgnGdLQX7EetksjbAt4DquUeaY7BOlAkohMDC4V1klORUIy9WbjJJy8mWdrqnZrgPsmzfdwdFkMVY5Lp4W1g==","signatures":[{"sig":"MEUCIEGpV09foVEYKqHxwf0dLXLNPcKgJqyWxGWzlnt0xUd2AiEA4paf2IM71w0HU0mADmRwIiKZ0WewPbsb++KLjsCzBCI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16327},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run --passWithNoTests","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared test utilities: provider-wrapped render(), mock server setup, fixtures.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/api":"1.0.0","@alphinex/core":"1.0.0","@alphinex/theme":"1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.7.0","vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","react-router-dom":"^7.1.1","@vitejs/plugin-react":"^4.3.4","@tanstack/react-query":"^5.62.7","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0"},"peerDependencies":{"msw":"^2.7.0","react":"^19.0.0","vitest":"^2.1.8","react-dom":"^19.0.0","react-router-dom":"^7.1.1","@tanstack/react-query":"^5.62.7","@testing-library/react":"^16.1.0"},"peerDependenciesMeta":{"msw":{"optional":false},"react":{"optional":false},"vitest":{"optional":false},"react-dom":{"optional":false},"react-router-dom":{"optional":false},"@tanstack/react-query":{"optional":false},"@testing-library/react":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/testing_1.0.1_1785858426756_0.09655208914932323","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alphinex/testing","version":"1.0.2","private":false,"description":"Shared test utilities: provider-wrapped render(), mock server setup, fixtures.","license":"UNLICENSED","type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"dependencies":{"@alphinex/theme":"1.1.0","@alphinex/core":"1.0.0","@alphinex/api":"1.1.0"},"peerDependencies":{"vitest":"^2.1.8","@testing-library/react":"^16.1.0","msw":"^2.7.0","react":"^19.0.0","react-dom":"^19.0.0","@tanstack/react-query":"^5.62.7","react-router-dom":"^7.1.1"},"peerDependenciesMeta":{"vitest":{"optional":false},"@testing-library/react":{"optional":false},"msw":{"optional":false},"react":{"optional":false},"react-dom":{"optional":false},"@tanstack/react-query":{"optional":false},"react-router-dom":{"optional":false}},"devDependencies":{"typescript":"^5.7.2","vite":"^6.0.5","vitest":"^2.1.8","react":"^19.0.0","react-dom":"^19.0.0","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@testing-library/react":"^16.1.0","@testing-library/jest-dom":"^6.6.3","@vitejs/plugin-react":"^4.3.4","jsdom":"^25.0.1","eslint":"^9.17.0","msw":"^2.7.0","@tanstack/react-query":"^5.62.7","react-router-dom":"^7.1.1","@alphinex/eslint-config":"0.0.0","@alphinex/build-config":"0.0.0","@alphinex/typescript-config":"0.0.0"},"scripts":{"build":"vite build","dev":"vite build --watch","lint":"eslint .","typecheck":"tsc --noEmit","test":"vitest run --passWithNoTests","clean":"rimraf dist .turbo"},"_nodeVersion":"22.14.0","_id":"@alphinex/testing@1.0.2","dist":{"integrity":"sha512-1oUGAMMdxrDkirNdqos/MQq7up3ANrp78HDl1MunpC4/Vk9qKW/fQcuTc8X/Oc7bBQcrQ3q4CUSFNIuXK8Xsqg==","shasum":"8938b8677b363690ae4c5b8efd912cbfe31f68fd","tarball":"https://registry.npmjs.org/@alphinex/testing/-/testing-1.0.2.tgz","fileCount":5,"unpackedSize":16327,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFtZpiNTSermrUX4/zV/0QsKgNBg0NPiGB51AuwRcMW1AiEAwFdzr+u/dR2ZuiYtMBze/FOg8i7AZmkTjgc3TFmIcoE="}]},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"directories":{},"maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/testing_1.0.2_1786525497205_0.48184010570318137"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-04T14:08:04.801Z","modified":"2026-08-12T09:04:57.524Z","1.0.0":"2026-08-04T14:08:05.102Z","1.0.1":"2026-08-04T15:47:06.941Z","1.0.2":"2026-08-12T09:04:57.346Z"},"license":"UNLICENSED","description":"Shared test utilities: provider-wrapped render(), mock server setup, fixtures.","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"readme":"# @alphinex/testing\n\nShared test utilities: provider-wrapped render(), mock server setup.\n\n## `renderWithProviders(ui, options?)`\n\n`render()` pre-wrapped with the platform's standard provider stack — Theme (always), Query\n(always, unless `query: false`), Router (always, unless `router: false`), and Auth/Permissions\nwhen their options are supplied:\n\n```tsx\nimport { renderWithProviders } from \"@alphinex/testing\";\n\nrenderWithProviders(<AccountMenu />, {\n  auth: { adapter: myAdapter },\n  router: { initialEntries: [\"/settings\"] },\n});\n```\n\nFor `renderHook()` cases (hooks with no natural render tree — `useAuth`, `usePermission`), use\n`createProvidersWrapper(options)` to get the same stack as a `{ wrapper }`:\n\n```tsx\nimport { renderHook } from \"@testing-library/react\";\nimport { createProvidersWrapper } from \"@alphinex/testing\";\n\nconst { Wrapper } = createProvidersWrapper({ auth: { adapter: myAdapter } });\nrenderHook(() => useAuth(), { wrapper: Wrapper });\n```\n\n## `setupMockServer(...handlers)`\n\nWires an MSW `setupServer()` instance to Vitest's `beforeAll`/`afterEach`/`afterAll` lifecycle:\n\n```ts\nimport { http, HttpResponse } from \"msw\";\nimport { setupMockServer } from \"@alphinex/testing\";\n\nconst server = setupMockServer(http.get(\"/api/widgets\", () => HttpResponse.json({ widgets: [] })));\n\nit(\"shows an override for one test\", () => {\n  server.use(http.get(\"/api/widgets\", () => HttpResponse.json({ widgets: [\"a\"] })));\n  // ...\n});\n```\n\nSee [documentation/ARCHITECTURE.md](../../documentation/ARCHITECTURE.md) for the full package contract, dependency rules, and roadmap placement.\n","readmeFilename":""}