{"_id":"@bupkis/rxjs","_rev":"2-5dfe50ea136ad492e00a411b90d8b79b","name":"@bupkis/rxjs","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@bupkis/rxjs","version":"0.1.0","keywords":["bupkis","rxjs","observable","reactive","assert","assertion","test"],"author":{"name":"Christopher Hiller","email":"boneskull@boneskull.com"},"license":"BlueOak-1.0.0","_id":"@bupkis/rxjs@0.1.0","maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"homepage":"https://github.com/boneskull/bupkis#readme","bugs":{"url":"https://github.com/boneskull/bupkis/issues"},"dist":{"shasum":"1682e0416fee4cd6049c97d90c3bac3c4204b055","tarball":"https://registry.npmjs.org/@bupkis/rxjs/-/rxjs-0.1.0.tgz","fileCount":49,"integrity":"sha512-R4KoaNywN0mOdMWhKTXP0qviF9Ghx/lIT2b5/ip6zd3MLqnwxmhdmDemN7XY42QKjO7QcEqqy4B1r2LGrNSmKg==","signatures":[{"sig":"MEYCIQCp9MhIwENsRj7LgeWYFCpldTXPA54J6mTNxNtdsYEbSAIhAJ3/htbtqlzznKzjrBXvqSJapG5jp7vkOHZCN4/NzHyF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":178798},"main":"./dist/index.cjs","type":"module","zshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":"^20.19.0 || ^22.12.0 || >=23"},"exports":{".":{"types":"./dist/index.d.cts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"f09ff1cfb21ceb03dee850971611a3d1e98086b4","scripts":{"test":"npm run test:base -- \"test/*.test.ts\"","build":"zshy","test:dev":"npm run test:base -- --watch \"test/*.test.ts\"","test:base":"node --import tsx --test --test-reporter=spec","test:types":"tsd","test:node20":"npm run test:base -- test/*.test.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"boneskull","email":"boneskull@boneskull.com"},"prettier":{"tsdoc":true,"plugins":["prettier-plugin-jsdoc","prettier-plugin-pkg"],"singleQuote":true,"jsdocPreferCodeFences":true,"jsdocCommentLineStrategy":"keep"},"repository":{"url":"git+https://github.com/boneskull/bupkis.git","type":"git","directory":"packages/rxjs"},"_npmVersion":"11.6.2","description":"RxJS Observable assertions for Bupkis","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"rxjs":"7.8.2","fast-check":"^4.5.2"},"peerDependencies":{"rxjs":">=7.0.0","bupkis":">=0.15.0"},"_npmOperationalInternal":{"tmp":"tmp/rxjs_0.1.0_1768604269577_0.5758955659691425","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@bupkis/rxjs","version":"1.0.0","type":"module","description":"RxJS Observable assertions for Bupkis","repository":{"directory":"packages/rxjs","type":"git","url":"git+https://github.com/boneskull/bupkis.git"},"author":{"name":"Christopher Hiller","email":"boneskull@boneskull.com"},"license":"BlueOak-1.0.0","engines":{"node":"^22.13.0 || >=24.0.0"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.cts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"keywords":["bupkis","rxjs","observable","reactive","assert","assertion","test"],"scripts":{"build":"zshy","prepublishOnly":"npm run build","test":"npm run test:base -- \"test/*.test.ts\"","test:base":"node --import tsx --test --test-reporter=spec","test:ci":"npm run test -- --test-reporter=node-test-github-reporter","test:coverage":"c8 --reporter=lcov --reporter=text npm test","test:dev":"npm run test -- --watch"},"peerDependencies":{"bupkis":">=0.15.0","rxjs":">=7.0.0"},"devDependencies":{"rxjs":"7.8.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"prettier":{"jsdocCommentLineStrategy":"keep","jsdocPreferCodeFences":true,"plugins":["prettier-plugin-jsdoc","prettier-plugin-pkg"],"singleQuote":true,"tsdoc":true},"zshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"gitHead":"c0f3fcd74ca0f7e307d2a68ce12bba81b4059eb5","_id":"@bupkis/rxjs@1.0.0","bugs":{"url":"https://github.com/boneskull/bupkis/issues"},"homepage":"https://github.com/boneskull/bupkis#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-of9ZshV1z86IdjhB3X6WzWxuX+CsYWEHGdGXdwI5gtdHkgYNNqRw4oUls3o/jWKSsXS6vgry/LBCiwr2CrRvOg==","shasum":"86ae6b4bae9434d412021416f21d12201dfad306","tarball":"https://registry.npmjs.org/@bupkis/rxjs/-/rxjs-1.0.0.tgz","fileCount":49,"unpackedSize":178431,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJ6npHx4IdRxJDuCaNQsK9KBcFvP1TNUDJVpcQ1qdw+wIhAODm49q2Zjart8/xoCy/o7TbE9/x7AYeTXaoX2MyN1oC"}]},"_npmUser":{"name":"boneskull","email":"boneskull@boneskull.com"},"directories":{},"maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rxjs_1.0.0_1783650192514_0.48784525148815905"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-16T22:57:49.506Z","modified":"2026-07-10T02:23:12.780Z","0.1.0":"2026-01-16T22:57:49.727Z","1.0.0":"2026-07-10T02:23:12.654Z"},"bugs":{"url":"https://github.com/boneskull/bupkis/issues"},"author":{"name":"Christopher Hiller","email":"boneskull@boneskull.com"},"license":"BlueOak-1.0.0","homepage":"https://github.com/boneskull/bupkis#readme","keywords":["bupkis","rxjs","observable","reactive","assert","assertion","test"],"repository":{"directory":"packages/rxjs","type":"git","url":"git+https://github.com/boneskull/bupkis.git"},"description":"RxJS Observable assertions for Bupkis","maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"readme":"# @bupkis/rxjs\n\nRxJS Observable assertions for [**BUPKIS**][bupkis].\n\nAll assertions are **asynchronous** since Observable operations are inherently async.\n\n## Installation\n\n```bash\nnpm install @bupkis/rxjs bupkis rxjs\n```\n\n## Usage\n\n```typescript\nimport { use } from 'bupkis';\nimport rxjsAssertions from '@bupkis/rxjs';\nimport { EMPTY, of, throwError } from 'rxjs';\n\nconst { expectAsync } = use(rxjsAssertions);\n\n// Completion assertions\nawait expectAsync(of(1, 2, 3), 'to complete');\nawait expectAsync(EMPTY, 'to be empty');\n\n// Error assertions\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n);\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n  'oops',\n);\n\n// Value assertions\nawait expectAsync(of('foo', 'bar'), 'to emit values', ['foo', 'bar']);\nawait expectAsync(of(1, 2, 3), 'to emit times', 3);\nawait expectAsync(of(42), 'to emit once');\n\n// Completion value assertions\nawait expectAsync(of(1, 2, 'final'), 'to complete with value', 'final');\n```\n\n## Assertions\n\n### {Observable} to complete\n\nAsserts that an Observable completes successfully (does not error).\n\n**Success**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to complete');\nawait expectAsync(EMPTY, 'to complete');\n```\n\n**Failure**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to complete',\n);\n// AssertionError: Expected Observable to complete, but it errored with Error: oops\n```\n\n**Negation**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'not to complete',\n);\n```\n\n### {Observable} to be empty\n\n> Aliases:\n>\n>     {Observable} to be empty\n>     {Observable} to complete without emitting\n\nAsserts that an Observable completes without emitting any values.\n\n**Success**:\n\n```js\nawait expectAsync(EMPTY, 'to be empty');\nawait expectAsync(EMPTY, 'to complete without emitting');\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1), 'to be empty');\n// AssertionError: Expected Observable to emit 0 values, but it emitted 1\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1), 'not to be empty');\n```\n\n### {Observable} to emit error\n\nAsserts that an Observable errors (calls the error callback).\n\n**Success**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to emit error');\n// AssertionError: Expected Observable to error, but it completed successfully\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'not to emit error');\n```\n\n### {Observable} to emit error {string | RegExp}\n\nAsserts that an Observable errors with a message matching the given string or regex.\n\n**Success**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n  'oops',\n);\nawait expectAsync(\n  throwError(() => new Error('something went wrong')),\n  'to emit error',\n  /went wrong/,\n);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n  'different',\n);\n// AssertionError: Expected error message to be \"different\", but got \"oops\"\n\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error',\n  /no match/,\n);\n// AssertionError: Expected error message to match /no match/, but got \"oops\"\n```\n\n**Negation**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'not to emit error',\n  'different',\n);\n```\n\n### {Observable} to emit error satisfying {object}\n\nAsserts that an Observable errors with an error object satisfying a partial specification.\n\n**Success**:\n\n```js\nawait expectAsync(\n  throwError(() => new TypeError('type error')),\n  'to emit error satisfying',\n  { name: 'TypeError' },\n);\n\nawait expectAsync(\n  throwError(() => new TypeError('type error')),\n  'to emit error satisfying',\n  { name: 'TypeError', message: 'type error' },\n);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'to emit error satisfying',\n  { name: 'TypeError' },\n);\n// AssertionError: Expected error to satisfy spec, but name did not match: expected Error, got TypeError\n```\n\n**Negation**:\n\n```js\nawait expectAsync(\n  throwError(() => new Error('oops')),\n  'not to emit error satisfying',\n  { name: 'TypeError' },\n);\n```\n\n### {Observable} to emit values {array}\n\nAsserts that an Observable emits exactly the specified values in order. Uses strict equality (`===`) for comparison.\n\n**Success**:\n\n```js\nawait expectAsync(of('foo', 'bar'), 'to emit values', ['foo', 'bar']);\nawait expectAsync(of(1, 2, 3), 'to emit values', [1, 2, 3]);\nawait expectAsync(EMPTY, 'to emit values', []);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to emit values', [1, 2]);\n// AssertionError: Expected Observable to emit 2 values, but it emitted 3\n\nawait expectAsync(of(1, 2), 'to emit values', [2, 1]);\n// AssertionError: Expected value at index 0 to be 2, but got 1\n```\n\n**Note**: Uses strict equality, so objects must be the same reference:\n\n```js\nconst obj = { a: 1 };\nawait expectAsync(of(obj), 'to emit values', [obj]); // passes - same reference\nawait expectAsync(of({ a: 1 }), 'to emit values', [{ a: 1 }]); // fails - different references\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'not to emit values', [3, 2, 1]);\n```\n\n### {Observable} to emit times {number}\n\nAsserts that an Observable emits exactly the specified number of values.\n\n**Success**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to emit times', 3);\nawait expectAsync(EMPTY, 'to emit times', 0);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to emit times', 2);\n// AssertionError: Expected Observable to emit 2 values, but it emitted 3\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'not to emit times', 5);\n```\n\n### {Observable} to emit once\n\nAsserts that an Observable emits exactly one value.\n\n**Success**:\n\n```js\nawait expectAsync(of(42), 'to emit once');\n```\n\n**Failure**:\n\n```js\nawait expectAsync(EMPTY, 'to emit once');\n// AssertionError: Expected Observable to emit 1 value, but it emitted 0\n\nawait expectAsync(of(1, 2), 'to emit once');\n// AssertionError: Expected Observable to emit 1 value, but it emitted 2\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2), 'not to emit once');\n```\n\n### {Observable} to emit twice\n\nAsserts that an Observable emits exactly two values.\n\n**Success**:\n\n```js\nawait expectAsync(of(1, 2), 'to emit twice');\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1), 'to emit twice');\n// AssertionError: Expected Observable to emit 2 values, but it emitted 1\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1), 'not to emit twice');\n```\n\n### {Observable} to emit thrice\n\nAsserts that an Observable emits exactly three values.\n\n**Success**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to emit thrice');\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2), 'to emit thrice');\n// AssertionError: Expected Observable to emit 3 values, but it emitted 2\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2), 'not to emit thrice');\n```\n\n### {Observable} to complete with value {unknown}\n\nAsserts that an Observable completes and its last emitted value equals the expected value (strict equality).\n\n**Success**:\n\n```js\nawait expectAsync(of(1, 2, 'final'), 'to complete with value', 'final');\nawait expectAsync(of(42), 'to complete with value', 42);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to complete with value', 2);\n// AssertionError: Expected Observable to complete with value 2, but got 3\n\nawait expectAsync(EMPTY, 'to complete with value', 'any');\n// AssertionError: Expected Observable to emit at least one value, but it completed without emitting\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'not to complete with value', 5);\n```\n\n### {Observable} to complete with values {array}\n\nAsserts that an Observable completes and emits exactly the specified values in order. Essentially an alias for `to emit values` that emphasizes completion.\n\n**Success**:\n\n```js\nawait expectAsync(of('foo', 'bar', 'baz'), 'to complete with values', [\n  'foo',\n  'bar',\n  'baz',\n]);\nawait expectAsync(EMPTY, 'to complete with values', []);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'to complete with values', [1, 2]);\n// AssertionError: Expected Observable to emit 2 values, but it emitted 3\n```\n\n**Negation**:\n\n```js\nawait expectAsync(of(1, 2, 3), 'not to complete with values', [3, 2, 1]);\n```\n\n### {Observable} to complete with value satisfying {object}\n\nAsserts that an Observable completes and its last emitted value satisfies a partial specification (all specified properties match).\n\n**Success**:\n\n```js\nawait expectAsync(\n  of({ status: 'pending' }, { status: 'done', result: 42 }),\n  'to complete with value satisfying',\n  { status: 'done' },\n);\n\nawait expectAsync(\n  of({ a: 1, b: 2, c: 3 }),\n  'to complete with value satisfying',\n  { a: 1, b: 2 },\n);\n```\n\n**Failure**:\n\n```js\nawait expectAsync(\n  of({ status: 'pending' }),\n  'to complete with value satisfying',\n  { status: 'done' },\n);\n// AssertionError: Expected last value to satisfy spec, but status did not match: expected done, got pending\n\nawait expectAsync(EMPTY, 'to complete with value satisfying', { any: 'spec' });\n// AssertionError: Expected Observable to emit at least one value, but it completed without emitting\n```\n\n**Negation**:\n\n```js\nawait expectAsync(\n  of({ status: 'pending' }),\n  'not to complete with value satisfying',\n  { status: 'done' },\n);\n```\n\n## License\n\nCopyright © 2026 [Christopher \"boneskull\" Hiller][boneskull]. Licensed under [BlueOak-1.0.0](https://blueoakcouncil.org/license/1.0.0).\n\n[boneskull]: https://github.com/boneskull\n[bupkis]: https://bupkis.zip\n","readmeFilename":"README.md"}