{"_id":"@chejholloway/result-guard-vitest","_rev":"2-746716e34e06777c3e16b03a0b8d5adc","name":"@chejholloway/result-guard-vitest","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@chejholloway/result-guard-vitest","version":"0.1.1","keywords":["vitest","result","neverthrow","testing","matchers"],"license":"MIT","_id":"@chejholloway/result-guard-vitest@0.1.1","maintainers":[{"name":"chejholloway","email":"chejholloway@protonmail.com"}],"dist":{"shasum":"81490365b4216901268b25e543ae3f853484785a","tarball":"https://registry.npmjs.org/@chejholloway/result-guard-vitest/-/result-guard-vitest-0.1.1.tgz","fileCount":16,"integrity":"sha512-5GK6rFpXksqTC/kM7b52nkWGmojf91K46lTKZYBfXy8v9ykDrEflQHC9ezfWBnfey+zzhWV5jf/R194+dDL5pw==","signatures":[{"sig":"MEUCIFAeu2MR4SXQyit1hKwFH3h/+X9IGKEzvxTJ9Iz7BT3eAiEAnpQPW17Yz3WbZeSCO5I7EdKFEZVGW8KW2/C1U1qgkkg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16603},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./jest.setup.cjs":"./jest.setup.cjs"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","lint:self":"eslint . --ext .ts,.tsx","test:jest":"jest --config jest.config.cjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"chejholloway","email":"chejholloway@protonmail.com"},"repository":{"url":"git+https://github.com/chejholloway/result-guard.git","type":"git","directory":"packages/vitest"},"description":"Vitest matchers for asserting on neverthrow Result/ResultAsync values: toBeOk, toBeErr, toMatchOk, toMatchErr.","directories":{},"_nodeVersion":"24.18.1","dependencies":{"neverthrow":"^8.1.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","vitest":"^2.1.4","ts-jest":"^29.2.5","typescript":"^5.6.3","@types/jest":"^29.5.14","@types/node":"^22.9.0","@chejholloway/result-guard":"0.1.1"},"peerDependencies":{"vitest":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/result-guard-vitest_0.1.1_1785975451696_0.1968950355516168","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@chejholloway/result-guard-vitest","version":"0.1.2","description":"Vitest matchers for asserting on neverthrow Result/ResultAsync values: toBeOk, toBeErr, toMatchOk, toMatchErr.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chejholloway/result-guard.git","directory":"packages/vitest"},"keywords":["vitest","result","neverthrow","testing","matchers"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./jest.setup.cjs":"./jest.setup.cjs"},"dependencies":{"neverthrow":"^8.1.1"},"peerDependencies":{"vitest":">=1.0.0"},"devDependencies":{"typescript":"^5.6.3","vitest":"^2.1.4","jest":"^29.7.0","ts-jest":"^29.2.5","@types/jest":"^29.5.14","@types/node":"^22.9.0","@chejholloway/result-guard":"0.1.2"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","lint:self":"eslint . --ext .ts,.tsx","test":"vitest run","test:jest":"jest --config jest.config.cjs"},"_nodeVersion":"24.18.1","_id":"@chejholloway/result-guard-vitest@0.1.2","dist":{"integrity":"sha512-osm4HccVMpNd3GP0nfZ83GPEwhfznF5Yg3LtA8KPb+lGyhnd8v7RtLzSbdSeiN+Atu+xQpLgASRBhJSN3PUJXg==","shasum":"46df9c6270669b1a084cc589fd021afb230b3561","tarball":"https://registry.npmjs.org/@chejholloway/result-guard-vitest/-/result-guard-vitest-0.1.2.tgz","fileCount":16,"unpackedSize":16603,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFV75HEKn33LjwKzmDsv4yplrYgjVGTsksZ2l4Y3VYBjAiEAlDkAi+GdsTfgF9EybLualYbmafWS12XGeYyYuokWcv8="}]},"_npmUser":{"name":"chejholloway","email":"chejholloway@protonmail.com"},"directories":{},"maintainers":[{"name":"chejholloway","email":"chejholloway@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/result-guard-vitest_0.1.2_1786032067379_0.44906366246664176"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-06T00:17:31.560Z","modified":"2026-08-06T16:01:07.674Z","0.1.1":"2026-08-06T00:17:31.848Z","0.1.2":"2026-08-06T16:01:07.545Z"},"license":"MIT","keywords":["vitest","result","neverthrow","testing","matchers"],"repository":{"type":"git","url":"git+https://github.com/chejholloway/result-guard.git","directory":"packages/vitest"},"description":"Vitest matchers for asserting on neverthrow Result/ResultAsync values: toBeOk, toBeErr, toMatchOk, toMatchErr.","maintainers":[{"name":"chejholloway","email":"chejholloway@protonmail.com"}],"readme":"# result-guard-vitest\n\nVitest matchers for asserting on [neverthrow](https://github.com/supermacro/neverthrow) `Result`/`ResultAsync` values.\n\n## Install\n\n```bash\nnpm install -D result-guard-vitest\n```\n\nAdd it to your Vitest config:\n\n```ts\n// vitest.config.ts\nexport default defineConfig({\n  test: {\n    setupFiles: [\"result-guard-vitest\"],\n  },\n});\n```\n\n## Usage\n\n```ts\nimport { guard } from \"result-guard\";\n\nconst guardedFetch = guard(fetchUser);\n\ntest(\"returns Ok for a valid id\", async () => {\n  const result = await guardedFetch(\"123\");\n  expect(result).toBeOk();\n  expect(result).toMatchOk({ id: \"123\", name: \"Alice\" });\n});\n\ntest(\"returns Err for an empty id\", async () => {\n  const result = await guardedFetch(\"\");\n  expect(result).toBeErr();\n});\n```\n\n`toMatchOk`/`toMatchErr` support the same partial matchers as `toMatchObject` — `expect.objectContaining(...)` works fine.\n\nIf you pass an un-awaited `ResultAsync` directly, the matchers give you a specific error telling you to await it first, instead of a confusing generic assertion failure.\n\n## License\n\nMIT\n","readmeFilename":""}