{"id":16625500,"url":"https://github.com/aleclarson/rethinkdb-mock","last_synced_at":"2025-09-16T03:32:22.571Z","repository":{"id":65489744,"uuid":"98612154","full_name":"aleclarson/rethinkdb-mock","owner":"aleclarson","description":"In-memory RethinkDB","archived":false,"fork":false,"pushed_at":"2018-12-15T09:53:41.000Z","size":220,"stargazers_count":7,"open_issues_count":21,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T22:58:12.954Z","etag":null,"topics":["mock","rethinkdb"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-28T05:35:03.000Z","updated_at":"2021-06-21T19:15:10.000Z","dependencies_parsed_at":"2023-01-25T17:25:12.326Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/rethinkdb-mock","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Frethinkdb-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Frethinkdb-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Frethinkdb-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Frethinkdb-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/rethinkdb-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233200423,"owners_count":18640370,"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":["mock","rethinkdb"],"created_at":"2024-10-12T04:05:55.479Z","updated_at":"2025-09-16T03:32:17.224Z","avatar_url":"https://github.com/aleclarson.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rethinkdb-mock v0.7.1\n\nSpec-compliant unit-testing for RethinkDB queries\n\nThe **end goal** is to replicate the API of [`rethinkdbdash`](https://github.com/neumino/rethinkdbdash).\u003cbr/\u003e\nFor all intents and purposes, you should get the same results.\u003cbr/\u003e\nPlease review the **Feature support** table before opening an issue.\n\nReusing and nesting queries are fully supported. :+1:\n\nCheck out the **Releases** tab for details about the newest versions.\n\n\u0026nbsp;\n\n### Why use this?\n\n- Load JSON data into the database with `db.load()`\n- Or call `db.init()` to easily populate the database\n- Easily run specific tests (`fit` in Jasmine)\n- Avoid teardown between test suites\n- Avoid having to start a `rethinkdb` process before you can run tests\n- Avoid mutilating your development `rethinkdb_data`\n- Continuous integration compatibility\n\n\u0026nbsp;\n\n### Getting started\n\n1. Install from Github:\n\n```sh\nnpm install --save-dev rethinkdb-mock\n```\n\n2. Put some boilerplate in your test environment:\n\n```js\nconst rethinkdb = require('rethinkdb-mock')\n\n// Replace `rethinkdbdash` with `rethinkdb-mock`\nconst mock = require('mock-require')\nmock('rethinkdbdash', rethinkdb)\n\n// You must use the same database name as the code you're testing.\nconst db = rethinkdb({\n  name: 'test' // The default value\n})\n```\n\n3. Use it in your test suites:\n\n```js\ndescribe('Some test suite', () =\u003e {\n\n  // Reset the database between suites.\n  beforeAll(() =\u003e {\n    db.init({\n      users: [],\n      friends: [],\n    })\n\n    // Optionally, load JSON into the database.\n    db.load(__dirname, './data.json')\n  })\n\n  // Now create your tests...\n})\n```\n\n\u0026nbsp;\n\n### Feature support\n\nThe entire Rethink API is not yet implemented.\u003cbr/\u003e\nGet an idea of what's supported by referencing the table below.\n\n**Open an issue to request a feature be implemented.**\u003cbr/\u003e\nBut try implementing it yourself if you have time! :+1:\n\nIf a method is not behaving as expected, **please open an issue!**\u003cbr/\u003e\nBut first check out `TODO.md` for a list of missing behaviors.\n\n\u003e ❌ means \"not implemented yet\"\n\u003e\n\u003e ⚠️ means \"partially implemented\"\n\u003e\n\u003e 💯 means \"fully implemented\"\n\n% | Feature\n--- | ---\n❌ | Changefeeds\n❌ | Binary support\n❌ | Date-time support\n❌ | Geospatial support\n💯 | `r.table()`\n💯 | `r.tableCreate()`\n❌ | `r.tableList()`\n💯 | `r.tableDrop()`\n❌ | `r.indexCreate()`\n❌ | `r.indexList()`\n❌ | `r.indexDrop()`\n❌ | `r.indexRename()`\n❌ | `r.indexStatus()`\n❌ | `r.indexWait()`\n⚠️ | `r.row`\n💯 | `r()` or `r.expr()`\n💯 | `r.do()`\n❌ | `r.args()`\n💯 | `r.object()`\n💯 | `r.branch()`\n⚠️ | `r.typeOf()`\n💯 | `r.uuid()`\n⚠️ | `r.desc()`\n⚠️ | `r.asc()`\n❌ | `r.js()`\n❌ | `r.json()`\n❌ | `r.http()`\n❌ | `r.error()`\n❌ | `r.range()`\n💯 | `table.get()`\n💯 | `table.getAll()`\n⚠️ | `table.insert()`\n💯 | `table.delete()`\n💯 | `query()` or `query.bracket()`\n💯 | `query.nth()`\n💯 | `query.getField()`\n⚠️ | `query.hasFields()`\n❌ | `query.withFields()`\n⚠️ | `query.offsetsOf()`\n⚠️ | `query.contains()`\n⚠️ | `query.orderBy()`\n💯 | `query.isEmpty()`\n💯 | `query.count()`\n💯 | `query.skip()`\n💯 | `query.limit()`\n💯 | `query.slice()`\n❌ | `query.between()`\n💯 | `query.merge()`\n💯 | `query.pluck()`\n⚠️ | `query.without()`\n⚠️ | `query.replace()`\n⚠️ | `query.update()`\n⚠️ | `query.delete()`\n💯 | `query.default()`\n💯 | `query.and()`\n💯 | `query.or()`\n⚠️ | `query.eq()`\n⚠️ | `query.ne()`\n⚠️ | `query.gt()`\n⚠️ | `query.lt()`\n⚠️ | `query.ge()`\n⚠️ | `query.le()`\n⚠️ | `query.add()`\n⚠️ | `query.sub()`\n⚠️ | `query.mul()`\n💯 | `query.div()`\n❌ | `query.mod()`\n❌ | `query.sum()`\n❌ | `query.avg()`\n❌ | `query.min()`\n❌ | `query.max()`\n❌ | `query.not()`\n❌ | `query.ceil()`\n❌ | `query.floor()`\n❌ | `query.round()`\n❌ | `query.random()`\n❌ | `query.coerceTo()`\n💯 | `query.map()`\n⚠️ | `query.filter()`\n❌ | `query.fold()`\n❌ | `query.reduce()`\n❌ | `query.forEach()`\n❌ | `query.distinct()`\n❌ | `query.concatMap()`\n❌ | `query.innerJoin()`\n❌ | `query.outerJoin()`\n❌ | `query.eqJoin()`\n❌ | `query.zip()`\n❌ | `query.group()`\n❌ | `query.ungroup()`\n❌ | `query.sample()`\n❌ | `query.setInsert()`\n❌ | `query.setUnion()`\n❌ | `query.setIntersection()`\n❌ | `query.setDifference()`\n❌ | `query.append()`\n❌ | `query.prepend()`\n❌ | `query.union()`\n❌ | `query.difference()`\n❌ | `query.insertAt()`\n❌ | `query.spliceAt()`\n❌ | `query.deleteAt()`\n❌ | `query.changeAt()`\n❌ | `query.keys()`\n❌ | `query.values()`\n❌ | `query.literal()`\n❌ | `query.match()`\n❌ | `query.split()`\n❌ | `query.upcase()`\n❌ | `query.downcase()`\n❌ | `query.toJSON()` or `query.toJsonString()`\n❌ | `query.info()`\n❌ | `query.sync()`\n\n\u0026nbsp;\n\n### Contributing\n\nIssues and pull requests are always appreciated! :grin:\n\nIf you have any questions, feel free to open an issue.\n\n\u0026nbsp;\n\n#### Getting started\n\n```sh\n# This tool compiles the `src` directory during `npm install`.\nnpm install -g coffee-build\n\ngit clone https://github.com/aleclarson/rethinkdb-mock\nnpm install\n\n# Manually compile the `src` directory after you make any changes.\ncoffee -cb -o js src\n```\n\n\u0026nbsp;\n\n### Similar repositories\n\n- [JohanObrink/rethink-mock](https://github.com/JohanObrink/rethink-mock): Stubs for `sinon` (last updated October 2017)\n- [vasc/rethinkdb-mock](https://github.com/vasc/rethinkdb-mock): Small subset of Rethink API, not spec-compliant (last updated April 2014)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Frethinkdb-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Frethinkdb-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Frethinkdb-mock/lists"}