roe-mock

2.0.4 • Public • Published

Build Status Coverage

roe-mock

Mock of roe server for testing

Install

$ npm i roe-mock

Usage

const path = require('path')
const create = require('roe-mock')

const baseDir = path.join(__dirname, 'fixtures', 'myApp')
const mock = await create(baseDir)

// Write test cases as well as supertest
await mock.get('/foo/bar')
.expect(200)

create(baseDir, options?)

  • baseDir path base directory contains the roe app
  • options? Object
    • copy? boolean=false if true, roe-mock will copy things inside baseDir to an temp dir before creating the application

Creates an supertest instance with an additional method listen(port) to start the server:

const {
  listen
} = await create(baseDir)

listen(8888) // Server started at 127.0.0.1:8888

License

MIT

Package Sidebar

Install

npm i roe-mock

Weekly Downloads

2

Version

2.0.4

License

MIT

Unpacked Size

5.35 kB

Total Files

5

Last publish

Collaborators

  • kael