{"id":15834942,"url":"https://github.com/kaelzhang/roe-mock","last_synced_at":"2025-07-30T02:10:55.640Z","repository":{"id":65480662,"uuid":"177900230","full_name":"kaelzhang/roe-mock","owner":"kaelzhang","description":"Mock of roe server for testing","archived":false,"fork":false,"pushed_at":"2020-03-31T11:34:34.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T06:49:35.081Z","etag":null,"topics":["roe","testing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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-03-27T02:01:57.000Z","updated_at":"2019-07-01T10:47:12.000Z","dependencies_parsed_at":"2023-01-25T09:25:15.452Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/roe-mock","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kaelzhang/roe-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Froe-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Froe-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Froe-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Froe-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/roe-mock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Froe-mock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267501196,"owners_count":24097886,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["roe","testing"],"created_at":"2024-10-05T14:02:48.212Z","updated_at":"2025-07-30T02:10:55.584Z","avatar_url":"https://github.com/kaelzhang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kaelzhang/roe-mock.svg?branch=master)](https://travis-ci.org/kaelzhang/roe-mock)\n[![Coverage](https://codecov.io/gh/kaelzhang/roe-mock/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/roe-mock)\n\u003c!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/roe-mock?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kaelzhang/roe-mock)\n--\u003e\n\u003c!-- optional npm version\n[![NPM version](https://badge.fury.io/js/roe-mock.svg)](http://badge.fury.io/js/roe-mock)\n--\u003e\n\u003c!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/roe-mock.svg)](https://www.npmjs.org/package/roe-mock)\n--\u003e\n\u003c!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/roe-mock.svg)](https://david-dm.org/kaelzhang/roe-mock)\n--\u003e\n\n# roe-mock\n\nMock of roe server for testing\n\n## Install\n\n```sh\n$ npm i roe-mock\n```\n\n## Usage\n\n```js\nconst path = require('path')\nconst create = require('roe-mock')\n\nconst baseDir = path.join(__dirname, 'fixtures', 'myApp')\nconst mock = await create(baseDir)\n\n// Write test cases as well as supertest\nawait mock.get('/foo/bar')\n.expect(200)\n```\n\n## create(baseDir, options?)\n\n- **baseDir** `path` base directory contains the roe app\n- **options?** `Object`\n  - **copy?** `boolean=false` if true, roe-mock will copy things inside `baseDir` to an temp dir before creating the application\n\nCreates an [`supertest`](https://npmjs.org/package/supertest) instance with an additional method `listen(port)` to start the server:\n\n```js\nconst {\n  listen\n} = await create(baseDir)\n\nlisten(8888) // Server started at 127.0.0.1:8888\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Froe-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Froe-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Froe-mock/lists"}