{"id":13674851,"url":"https://github.com/jest-express/jest-express","last_synced_at":"2026-04-06T01:01:40.528Z","repository":{"id":48308159,"uuid":"121066119","full_name":"jest-express/jest-express","owner":"jest-express","description":"Mock Express for testing with Jest","archived":false,"fork":false,"pushed_at":"2023-07-03T11:29:15.000Z","size":3661,"stargazers_count":181,"open_issues_count":26,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-03-12T01:18:12.548Z","etag":null,"topics":["express","jest","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/jest-express.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"jameswlane"}},"created_at":"2018-02-11T00:08:38.000Z","updated_at":"2025-07-15T10:30:56.000Z","dependencies_parsed_at":"2024-01-14T18:01:54.774Z","dependency_job_id":null,"html_url":"https://github.com/jest-express/jest-express","commit_stats":{"total_commits":655,"total_committers":27,"mean_commits":24.25925925925926,"dds":0.6381679389312978,"last_synced_commit":"239af8e30093a8abf45e1cd078b54a241c6072a7"},"previous_names":["jameswlane/jest-express"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/jest-express/jest-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-express%2Fjest-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-express%2Fjest-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-express%2Fjest-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-express%2Fjest-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jest-express","download_url":"https://codeload.github.com/jest-express/jest-express/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-express%2Fjest-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31455474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["express","jest","testing"],"created_at":"2024-08-02T11:01:04.841Z","updated_at":"2026-04-06T01:01:40.468Z","avatar_url":"https://github.com/jest-express.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jameswlane"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Jest Express\n[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors)\n![Master Build](https://github.com/jameswlane/jest-express/actions/workflows/npm-publish.yml/badge.svg)\n[![Downloads/week](https://img.shields.io/npm/dw/jest-express.svg)](https://npmjs.org/package/jest-express)\n\nMock Express for testing with Jest\n\n* [express()](#express)\n    * [json()](#expressjson)\n    * [static()](#expressstatic)\n    * [Router()](#expressrouter)\n    * [urlencoded()](#expressurlencoded)\n    * [resetMocked()](#resetmocked)\n* [Application](#application)\n    * [locals](#applocals)\n    * [mountpath](#appmountpath)\n    * [all()](#appall)\n    * [delete()](#appdelete)\n    * [disable()](#appdisable)\n    * [disabled()](#appdisabled)\n    * [enable()](#appenable)\n    * [enabled()](#appenabled)\n    * [engine()](#appengine)\n    * [get()](#appget)\n    * [listen()](#applisten)\n    * [head()](#apphead)\n    * [post()](#apppost)\n    * [put()](#appput)\n    * [connect()](#appconnect)\n    * [options()](#appoptions)\n    * [trace()](#apptrace)\n    * [patch()](#apppatch)\n    * [param()](#appparam)\n    * [path()](#apppath)\n    * [render()](#apprender)\n    * [route()](#approute)\n    * [set()](#appset)\n    * [use()](#appuse)\n    * [request()](#apprequest)\n    * [response()](#appresponse)\n    * [setMountPath()](#appmountpath)\n    * [setLocals()](#applocals)\n    * [resetMocked()](#resetmocked)\n* [Request](#request)\n    * [baseUrl](#requestbaseUrl)\n    * [body](#requestbody)\n    * [cookies](#requestcookies)\n    * [fresh](#requestfresh)\n    * [hostname](#requesthostname)\n    * [ip](#requestip)\n    * [ips](#requestips)\n    * [method](#requestmethod)\n    * [originalUrl](#requestoriginalurl)\n    * [params](#requestbaseUrl)\n    * [path](#requestpath)\n    * [protocol](#requestprotocol)\n    * [query](#requestquery)\n    * [route](#requestroute)\n    * [baseUrl](#requestbaseurl)\n    * [secure](#requestsecure)\n    * [signedCookies](#requestsignedcookies)\n    * [stale](#requeststale)\n    * [subdomains](#requestsubdomains)\n    * [xhr](#requestxhr)\n    * [accepts()](#requestaccepts)\n    * [acceptsCharsets()](#requestacceptscharsets)\n    * [acceptsEncodings()](#requestacceptsEncodings)\n    * [acceptsLanguages()](#requestacceptsLanguages)\n    * [get()](#requestget)\n    * [is()](#requestis)\n    * [range()](#requestrange)\n    * [setBaseUrl()](#requestsetbaseurl)\n    * [setBody()](#requestsetbody)\n    * [setCookies()](#requestsetcookies)\n    * [setFresh()](#requestsetfresh)\n    * [setHostname()](#requestsethostname)\n    * [setHeaders()](#requestsetheaders)\n    * [setIp()](#requestsetip)\n    * [setIps()](#requestsetips)\n    * [setMethod()](#requestsetmethod)\n    * [setOriginalUrl()](#requestsetoriginalurl)\n    * [setParams()](#requestsetparams)\n    * [setPath()](#requestsetpath)\n    * [setProtocol()](#requestsetprotocol)\n    * [setQuery()](#requestsetquery)\n    * [setRoute()](#requestsetroute)\n    * [setSecure()](#requestsetsecure)\n    * [setSignedCookies()](#requestsetsignedcookies)\n    * [setStale()](#requestsetStale)\n    * [setSubdomains()](#requestsetsubdomains)\n    * [setXhr()](#requestsetXhr)\n    * [resetMocked()](#resetmocked)\n* [Response](#response)\n    * [headersSent](#responseheaderssent)\n    * [locals](#responselocals)\n    * [append()](#responseappend)\n    * [attachment()](#responseattachment)\n    * [body](#reponsebody)\n    * [cookie()](#responsecookie)\n    * [clearCookie()](#responseclearcookie)\n    * [download()](#responsedownload)\n    * [end()](#responseend)\n    * [format()](#responseformat)\n    * [get()](#responseget)\n    * [getHeader()](#responsegetheader)\n    * [header()](#responseheader)\n    * [json()](#responsejson)\n    * [jsonp()](#responsejsonp)\n    * [links()](#responselinks)\n    * [location()](#responselocation)\n    * [redirect()](#responseredirect)\n    * [render()](#responserender)\n    * [send()](#responsesend)\n    * [sendFile()](#responsesendfile)\n    * [sendStatus()](#responsesendstatus)\n    * [set()](#responseset)\n    * [status()](#responsestatus)\n    * [statusCode]($responsestatuscode)\n    * [type()](#responsetype)\n    * [vary()](#responsevary)\n    * [setHeader()](#responsesetheader)\n    * [removeHeader()](#responseremoveHeader)\n    * [setHeadersSent()](#responsesetheaderssent)\n    * [setLocals()](#responsesetlocals)\n    * [resetMocked()](#resetmocked)\n* [Router](#router)\n    * [request()](#routerrequest)\n    * [response()](#routerresponse)\n    * [all()](#routerall)\n    * [get()](#routerget)\n    * [param()](#routerparam)\n    * [route()](#routerroute)\n    * [use()](#routeruse)\n    * [resetMocked()](#resetmocked)\n\n_Other_\n\n1. [Development](#development)\n1. [Contributing](#contributing)\n1. [License](#license)\n\n### `express()`\n\nHow to setup Application to use in Jest:\n\n```js\njest.mock('express', () =\u003e {\n  return require('jest-express');\n});\n```\n\n#### `express.json()`\n\nWays to use this API:\n\n```js\nexpect(express.json).toHaveBeenCalledWith([options]);\n```\n\n#### `express.static()`\n\nWays to use this API:\n\n```js\nexpect(express.static).toHaveBeenCalledWith(root, [options]);\n```\n\n#### `express.Router()`\n\nWays to use this API:\n\n```js\nexpect(express.Router).toHaveBeenCalledWith([options]);\n```\n\n#### `express.urlencoded()`\n\nWays to use this API:\n\n```js\nexpect(express.urlencoded).toHaveBeenCalledWith([options]);\n```\n\n### `Application`\n\nHow to setup Application to use in Jest:\n\n```js\nimport { Express } from 'jest-express/lib/express';\nimport { server } from '../src/server.js';\n\nlet app;\n\ndescribe('Server', () =\u003e {\n  beforeEach(() =\u003e {\n    app = new Express();\n  });\n\n  afterEach(() =\u003e {\n    app.resetMocked();\n  });\n\n  test('should setup server', () =\u003e {\n    const options = {\n      port: 3000,\n    };\n\n    server(app, options);\n\n    expect(app.set).toBeCalledWith('port', options.port);\n  });\n});\n```\n\n#### `app.locals`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  app = new Express();\n  app.setLocals('title', 'My App');\n});\n```\n\n#### `app.mountpath`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  app = new Express();\n  app.setMountPath('/admin');\n});\n```\n\n#### `app.all()`\n\nWays to use this API:\n\n```js\nexpect(app.all).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.get()`\n\nWays to use this API:\n\n```js\nexpect(app.get).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.head()`\n\nWays to use this API:\n\n```js\nexpect(app.head).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.post()`\n\nWays to use this API:\n\n```js\nexpect(app.post).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.put()`\n\nWays to use this API:\n\n```js\nexpect(app.put).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.delete()`\n\nWays to use this API:\n\n```js\nexpect(app.delete).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.connect()`\n\nWays to use this API:\n\n```js\nexpect(app.connect).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.options()`\n\nWays to use this API:\n\n```js\nexpect(app.options).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.trace()`\n\nWays to use this API:\n\n```js\nexpect(app.trace).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.patch()`\n\nWays to use this API:\n\n```js\nexpect(app.patch).toBeCalledWith(path, callback [, callback ...]);\n```\n\n#### `app.param()`\n\nWays to use this API:\n\n```js\nexpect(app.param).toBeCalledWith([name], callback);\n```\n\n#### `app.render()`\n\nWays to use this API:\n\n```js\nexpect(app.param).toBeCalledWith(view, [locals], callback);\n```\n\n#### `app.use()`\n\nWays to use this API:\n\n```js\nexpect(app.use).toBeCalledWith([path,] callback [, callback...]);\n```\n\n### `Request`\n\nHow to setup Request to use in Jest:\n\n```js\nimport { Request } from 'jest-express/lib/request';\nimport { endpoint } from '../src/endpoint.js';\n\nlet request;\n\ndescribe('Endpoint', () =\u003e {\n  beforeEach(() =\u003e {\n    request = new Request('/users?sort=desc', {\n      headers: {\n        Accept: 'text/html'\n      }\n    });\n  });\n\n  afterEach(() =\u003e {\n    request.resetMocked();\n  });\n\n  test('should setup endpoint', () =\u003e {\n    endpoint(request);\n\n    expect(request).toBeCalled();\n  });\n});\n```\n\n#### `request.baseUrl`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setBaseUrl(baseUrl);\n});\n```\n\n#### `request.body`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setBody(body);\n});\n```\n\n#### `request.cookies`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setCookies(cookies);\n});\n```\n\n#### `request.fresh`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setFresh(boolean);\n});\n```\n\n#### `request.hostname`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setHostname(string);\n});\n```\n\n#### `request.setHeaders`\n\nWays to use this API:\n\nSetup:\n\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setHeaders(\"X-Custom-Header\", \"foo\");\n});\n\n// or\n\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setHeaders({  \n    \"X-Custom-Header\", \"foo\",\n    \"X-Custom-Header-2\", \"bar\"\n  });\n});\n\n```\n\n#### `request.ip`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setIp(ip);\n});\n```\n\n#### `request.ips`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setIps(ips);\n});\n```\n\n#### `request.method`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setMethod(method);\n});\n```\n\n#### `request.originalUrl`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setOriginalUrl(originalUrl);\n});\n```\n\n#### `request.params`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setParams(params);\n});\n```\n\n#### `request.path`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setPath(path);\n});\n```\n\n#### `request.protocol`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setProtocol(protocol);\n});\n```\n\n#### `request.query`\n\nYou can use it by passing key value pair:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setQuery('Accept', 'text/html');\n});\n```\n\nOr by passing an object:\n\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setQuery({ 'Accept': 'text/html', 'Accept-Language': 'en' });\n});\n```\n\n#### `request.route`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setRoute(route);\n});\n```\n\n#### `request.secure`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setSecure(secure);\n});\n```\n\n#### `request.signedCookies`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setSignedCookies(signedCookies);\n});\n```\n\n#### `request.stale`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setStale(boolean);\n});\n```\n\n#### `request.subdomains`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setSubdomains(subdomains);\n});\n```\n\n#### `request.xhr`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  request = new Request();\n  request.setXhr(boolean);\n});\n```\n\n#### `request.accepts()`\n\nWays to use this API:\n\n```js\nexpect(request.accepts).toBeCalledWith(types);\n```\n\n#### `request.acceptsCharsets()`\n\nWays to use this API:\n\n```js\nexpect(request.acceptsCharsets).toBeCalledWith(charset [, ...]);\n```\n\n#### `request.acceptsEncodings()`\n\nWays to use this API:\n\n```js\nexpect(request.acceptsEncodings).toBeCalledWith(encoding [, ...]);\n```\n\n#### `request.acceptsLanguages()`\n\nWays to use this API:\n\n```js\nexpect(request.acceptsLanguages).toBeCalledWith(lang [, ...]);\n```\n\n#### `request.get()`\n\nWays to use this API:\n\n```js\nexpect(request.get).toBeCalledWith(field);\n```\n\n#### `request.is()`\n\nWays to use this API:\n\n```js\nexpect(request.is).toBeCalledWith(type);\n```\n\n#### `request.param()`\n\nWays to use this API:\n\n```js\nexpect(request.param).toBeCalledWith(name [, defaultValue]);\n```\n\n#### `request.range()`\n\nWays to use this API:\n\n```js\nexpect(request.range).toBeCalledWith(size[, options]);\n```\n\n### `Response`\n\nHow to setup Response to use in Jest:\n\n```js\nimport { Response } from 'jest-express/lib/response';\nimport { endpoint } from '../src/endpoint.js';\n\nlet response;\n\ndescribe('Endpoint', () =\u003e {\n  beforeEach(() =\u003e {\n    response = new Response();\n  });\n\n  afterEach(() =\u003e {\n    response.resetMocked();\n  });\n\n  test('should setup endpoint', () =\u003e {\n    endpoint(response);\n\n    expect(response).toBeCalled();\n  });\n});\n```\n\n#### `response.setHeader`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  response = new Response();\n  response.setHeader(key, value);\n  expect(response.setHeader).toBeCalledWith(key, value);\n});\n```\n\n#### `response.removeHeader`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  response = new Response();\n  response.removeHeader(key);\n  expect(response.removeHeader).toBeCalledWith(key);\n});\n```\n\n#### `response.headersSent`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  response = new Response();\n  response.setHeadersSent(boolean);\n});\n```\n\n#### `response.locals`\n\nWays to use this API:\n\nSetup:\n```js\nbeforeEach(() =\u003e {\n  response = new Response();\n  response.setLocals('title', 'My App');\n});\n```\n\n#### `response.append()`\n\nWays to use this API:\n\n```js\nexpect(response.append).toBeCalledWith(field [, value]);\n```\n\n#### `response.attachment()`\n\nWays to use this API:\n\n```js\nexpect(response.attachment).toBeCalledWith([filename]);\n```\n\n#### `reponse.body`\n\nWays to use this API:\n\n```js\nexpect(response.body).toEqual(value);\n```\n\n#### `response.cookie()`\n\nWays to use this API:\n\n```js\nexpect(response.cookie).toBeCalledWith(name, value [, options]);\n```\n\n#### `response.clearCookie()`\n\nWays to use this API:\n\n```js\nexpect(response.clearCookie).toBeCalledWith(name [, options]);\n```\n\n#### `response.download()`\n\nWays to use this API:\n\n```js\nexpect(response.download).toBeCalledWith(path [, filename] [, options] [, fn]);\n```\n\n#### `response.end()`\n\nWays to use this API:\n\n```js\nexpect(response.end).toBeCalledWith([data] [, encoding]);\n```\n\n#### `response.format()`\n\nWays to use this API:\n\n```js\nexpect(response.format).toBeCalledWith(object);\n```\n\n#### `response.get()`\n\nWays to use this API:\n\n```js\nexpect(response.get).toBeCalledWith(field);\n```\n\n#### `response.getHeader()`\n\nWays to use this API:\n\n```js\nresponse.setHeader('Accept', 'text/html')\nexpect(response.getHeader('Accept')).toEqual('text/html');\n```\n\n#### `response.header()`\n\nAn alias for `response.set()`\n\n```js\nexpect(response.header).toBeCalledWith(field, [value]);\n```\n\n#### `response.json()`\n\nWays to use this API:\n\n```js\nexpect(response.json).toBeCalledWith([body]);\n```\n\n#### `response.jsonp()`\n\nWays to use this API:\n\n```js\nexpect(response.jsonp).toBeCalledWith([body]);\n```\n\n#### `response.links()`\n\nWays to use this API:\n\n```js\nexpect(response.links).toBeCalledWith(links);\n```\n\n#### `response.location()`\n\nWays to use this API:\n\n```js\nexpect(response.location).toBeCalledWith(path);\n```\n\n#### `response.redirect()`\n\nWays to use this API:\n\n```js\nexpect(response.redirect).toBeCalledWith([status,] path);\n```\n\n#### `response.render()`\n\nWays to use this API:\n\n```js\nexpect(response.render).toBeCalledWith(view [, locals] [, callback]);\n```\n\n#### `response.send()`\n\nWays to use this API:\n\n```js\nexpect(response.send).toBeCalledWith([body]);\n```\n\n#### `response.sendFile()`\n\nWays to use this API:\n\n```js\nexpect(response.sendFile).toBeCalledWith(path [, options] [, fn]);\n```\n\n#### `response.sendStatus()`\n\nWays to use this API:\n\n```js\nexpect(response.sendStatus).toBeCalledWith(statusCode);\n```\n\n#### `response.set()`\n\nSets headers. It is calling `response.setHeader()` internally.\n\n```js\nexpect(response.set).toBeCalledWith(field [, value]);\n```\n\n#### `response.status()`\n\nWays to use this API:\n\n```js\nexpect(response.status).toBeCalledWith(code);\n```\n\n#### `response.statusCode`\n\nways to use this API:\n```js\nexpect(response.statusCode).toEqual(code);\n```\n\n#### `response.type()`\n\nWays to use this API:\n\n```js\nexpect(response.type).toBeCalledWith(type);\n```\n \n#### `response.vary()`\n\nWays to use this API:\n\n```js\nexpect(response.vary).toBeCalledWith(field);\n```\n\n### `Router`\n\nHow to setup Response to use in Jest:\n\n```js\nimport { Router } from 'jest-express/lib/router';\nimport { endpoint } from '../src/endpoint.js';\n\nlet router;\n\ndescribe('Endpoint', () =\u003e {\n  beforeEach(() =\u003e {\n    router = new Router();\n  });\n\n  afterEach(() =\u003e {\n    router.resetMocked();\n  });\n\n  test('should setup endpoint', () =\u003e {\n    endpoint(router);\n\n    expect(router).toBeCalled();\n  });\n});\n```\n\n#### `router.all()`\n\nWays to use this API:\n\n```js\nexpect(router.all).toBeCalledWith(path, [callback, ...] callback);\n```\n\n#### `router.get()`\n\nWays to use this API:\n\n```js\nexpect(router.get).toBeCalledWith(path, [callback, ...] callback);\n```\n\n#### `router.param()`\n\nWays to use this API:\n\n```js\nexpect(router.param).toBeCalledWith(name, callback);\n```\n\n#### `router.route()`\n\nWays to use this API:\n\n```js\nexpect(router.route).toBeCalledWith(path);\n```\n\n#### `router.use()`\n\nWays to use this API:\n\n```js\nexpect(router.use).toBeCalledWith([path], [function, ...] function);\n```\n\n#### `resetMocked()`\n\nResets all information stored in the mock, including any initial implementation and mock name given.\n\nThis is useful when you want to completely restore a mock back to its initial state.\n\n## Development\n\n#### Setup\n\n```shell\n$ git clone git@github.com:jameswlane/jest-express.git\n$ cd jest-express\n$ npm install\n```\n\n#### Tests\n\nLinters:\n\n```shell\n$ npm run tslint\n```\n\nTests:\n\n```shell\n$ npm test\n```\n\n## Contributing\n\n## License\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://fueledbydreams.com\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/794161?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJames W. Lane III\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=jameswlane\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=jameswlane\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#infra-jameswlane\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=jameswlane\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#tool-jameswlane\" title=\"Tools\"\u003e🔧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://sheerun.net\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/292365?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdam Stankiewicz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/issues?q=author%3Asheerun\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=sheerun\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=sheerun\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=sheerun\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#example-sheerun\" title=\"Examples\"\u003e💡\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/gjtorikian\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/64050?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGaren Torikian\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=gjtorikian\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=gjtorikian\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/G07cha\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6943514?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKonstantin Azizov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=G07cha\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dozenne\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1186932?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edozenne\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=dozenne\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=dozenne\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/racer01\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/14020544?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLászló Székely-Tóth\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=racer01\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=racer01\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mattmarcello\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/4753479?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003emattmarcello\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=mattmarcello\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=mattmarcello\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://hrkeni.me\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/1170292?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHarshith Keni\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=hrkeni\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.maxholman.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/250517?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMax Holman\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=maxholman\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=maxholman\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mnalsup\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/5252756?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMatthew Alsup\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=mnalsup\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ttxndrx\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6355781?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ettxndrx\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=ttxndrx\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/benbakhar\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/7517258?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBen Bakhar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=benbakhar\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=benbakhar\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=benbakhar\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tamias\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/478001?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRonald J Kimball\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=tamias\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/jameswlane/jest-express/commits?author=tamias\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjest-express%2Fjest-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjest-express%2Fjest-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjest-express%2Fjest-express/lists"}