{"id":20511177,"url":"https://github.com/lovoo/redmock","last_synced_at":"2026-04-19T11:36:28.645Z","repository":{"id":142007392,"uuid":"65465319","full_name":"lovoo/redmock","owner":"lovoo","description":"Mock redis server for node.js unit tests.","archived":false,"fork":false,"pushed_at":"2018-01-10T02:43:52.000Z","size":29,"stargazers_count":0,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-16T09:07:25.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/lovoo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-11T11:49:43.000Z","updated_at":"2020-10-17T16:36:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"13165e98-d977-470b-b4fe-f64d0cf2ce77","html_url":"https://github.com/lovoo/redmock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovoo%2Fredmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovoo%2Fredmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovoo%2Fredmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovoo%2Fredmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovoo","download_url":"https://codeload.github.com/lovoo/redmock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242117660,"owners_count":20074433,"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":[],"created_at":"2024-11-15T20:34:55.463Z","updated_at":"2026-04-19T11:36:23.608Z","avatar_url":"https://github.com/lovoo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RedMock\n\nMock [Redis](http://redis.io) server for [Node](https://nodejs.org) unit tests.\n\nRequires Node version 5.7.0 or higher for the newest language features.\n\n# Purpose\n\nI created this project to help unit test an application that I was writing that used Redis for caching. I didn't want to stub out my client library code since I felt that would not be reliable enough, \nand I didn't want to get to functional/integration tests and find that my code was broken. I wanted to support sentinel and clustering, and couldn't find something that I felt would work, so I wrote this POS.\n\n# Usage\n\n## Starting the server\n\nCall the start method after creating a new instance of the RedisServer class. This method returns an ES6 promise.\n\n```javascript\nconst RedisServer = require('redmock');\n\nlet redisServer = new RedisServer();\n\nredisServer.start().then((res) =\u003e {\n  // Server is now up\n}).catch((err) =\u003e {\n  // Deal with error\n});\n\n```\n\n## Stopping the server\n\nCall the stop method. This method returns an ES6 promise. You do not have to worry about catching errors from this method.\n\n```javascript\n\nredisServer.stop().then((res) =\u003e {\n  // Server is now stopped\n});\n\n```\n\n## Example test\n\n```javascript\n// require/import needed crap\n\ndescribe('SomeTestSpec', () =\u003e {\n  \n  let redisServer, underTest;\n\n  // Start the server\n  before((done) =\u003e {\n    redisServer = new RedisServer();\n    redisServer.start().then((res) =\u003e {\n      done();\n    }).catch((err) =\u003e {\n      done(err);\n    });\n  });\n\n  // Stop the server\n  after((done) =\u003e {\n    redisServer.stop().then((res) =\u003e {\n      done();\n    });\n  });\n\n  describe('#somemethod()', () =\u003e {\n\n    beforeEach(() =\u003e {\n      underTest = new UnderTest();\n    });\n\n    it('should test it', () =\u003e {\n      return underTest.somemethod().should.eventually.equal(true);\n    });\n\n  });\n\n});\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovoo%2Fredmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovoo%2Fredmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovoo%2Fredmock/lists"}