{"id":16592731,"url":"https://github.com/arielshaqed/kurkar","last_synced_at":"2026-05-26T13:38:58.430Z","repository":{"id":42220678,"uuid":"171280443","full_name":"arielshaqed/kurkar","owner":"arielshaqed","description":"Ava macros to test RxJS","archived":false,"fork":false,"pushed_at":"2022-04-10T02:14:10.000Z","size":153,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-25T12:40:39.327Z","etag":null,"topics":["ava","ava-macros","hacktoberfest","marbles","observables","rxjs","rxjs6","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arielshaqed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-18T12:29:24.000Z","updated_at":"2020-10-05T16:39:39.000Z","dependencies_parsed_at":"2022-08-12T09:50:52.788Z","dependency_job_id":null,"html_url":"https://github.com/arielshaqed/kurkar","commit_stats":null,"previous_names":["binaris/kurkar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fkurkar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fkurkar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fkurkar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fkurkar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arielshaqed","download_url":"https://codeload.github.com/arielshaqed/kurkar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242240794,"owners_count":20095331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ava","ava-macros","hacktoberfest","marbles","observables","rxjs","rxjs6","testing"],"created_at":"2024-10-11T23:22:11.321Z","updated_at":"2026-05-26T13:38:58.388Z","avatar_url":"https://github.com/arielshaqed.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build status on Cirrus](https://img.shields.io/cirrus/github/binaris/kurkar?style=plastic)\n[![Build status on GitHub Actions](https://github.com/binaris/kurkar/workflows/Node%20CI/badge.svg)](https://github.com/binaris/kurkar/actions)\n\n# Kurkar: Ava macros to test RxJS\n\nKurkar helps you test [RxJS][rxjs] operators and pipelines with\n[marbles][marbles] using [Ava][ava].  Ava macros let you write concise\ntests.\n\n## Install\n\n```bash\nnpm install --save-dev kurkar\n```\n\n## Basic usage\n\n```js\nimport test from 'ava';\nimport marbles from 'kurkar';\n\ntest('observable', marbles, (_t, _sched, helpers) =\u003e {\n  const letters = 'the quick brown fox jumps over the lazy dog|';\n  const source$ = helpers.hot(letters);\n  helpers.expectObservable(source$).toBe(letters);\n});\n```\n\nKurkar provides an [Ava test macro][macros] to easily set up RxJS\ntests in Ava.  Include the macro function `marbles` before the test\nfunction to hook up an RxJS [`TestScheduler`][TestScheduler] to the\nAva execution context \"`t`\".  The test function will be run inside a\ntest scheduler, with these parameters:\n* `t`: Ava execution context for this test.\n* `sched`: RxJS `TestScheduler` running this test.  Use when you need\n  to pass a scheduler argument into some operators.\n* `helpers`: Helper functions created by\n  [`TestScheduler.run`][TestScheduler.run] for easily creating and\n  comparing Observables.\n\n`TestScheduler` runs synchronously, so the test function is _not_\n`async`.\n\nThe `marbles` macro uses `t.deepEqual` to compare actual and expected\nresults.  Pass a different comparison function to `withEquals` to\ngenerate other versions of the macro.  `marbles` is just\n```js\nconst marbles = withEquals((t, a, e) =\u003e t.deepEqual(a, e));\n```\n\n## TypeScript support\n\nKurkar fully supports TypeScript types and exports useful types.  You\ndo not need to install additional `@types` to enjoy TypeScript.\n\nHere's a typed version of the above test:\n```ts\nimport test from 'ava';\nimport marbles, { withEquals, ExecutionContext, TestScheduler, RunHelpers } from 'kurkar';\n\ntest('observable', marbles, (_t: ExecutionContext, _sched: TestScheduler, helpers: RunHelpers) =\u003e {\n  const letters = 'the quick brown fox jumps over the lazy dog|';\n  const source$ = helpers.hot(letters);\n  helpers.expectObservable(source$).toBe(letters);\n});\n```\n\nDue to current limitations with Ava types, TypeScript language servers\ncurrently cannot always deduce the types of the test function parameters.\n\n## FAQ\n\n### Why _another_ Ava RxJS marbles library?\n\nBecause it provides an Ava test macro, Kurkar removes the most\nboilerplate from your tests.  It is native TypeScript and can provide\nexact type-checking.\n\n### Why the name?\n\n\"Kurkar\" (\"כורכר\") is a soft middle-eastern sandstone -- a _very_ different rock from marble.\n\n### What are all these other names?\n\n* [Ava][ava]: A JavaScript and TypeScript test runner.\n* [RxJS][rxjs]: A library for composing asynchronous and event-based\n  programs by using observable sequences.\n* [Marbles][marbles]: Diagram-based testing of RxJS operators and pipelines.\n\n[![Build Status][status.image]][status.link]\n\n[ava]: https://github.com/avajs/ava\n[rxjs]: http://rxjs-dev.firebaseapp.com/\n[marbles]: https://github.com/ReactiveX/rxjs/blob/master/doc/marble-testing.md\n[macros]: https://github.com/avajs/ava/blob/master/docs/01-writing-tests.md#reusing-test-logic-through-macros\n[testscheduler]: https://rxjs-dev.firebaseapp.com/api/testing/TestScheduler\n[testscheduler.run]: https://rxjs-dev.firebaseapp.com/api/testing/TestScheduler#run-\n[status.link]: https://cirrus-ci.com/github/binaris/kurkar\n[status.image]: https://api.cirrus-ci.com/github/binaris/kurkar.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielshaqed%2Fkurkar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farielshaqed%2Fkurkar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielshaqed%2Fkurkar/lists"}