Mock of roe server for testing
$ npm i roe-mock
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)
- baseDir
path
base directory contains the roe app - options?
Object
- copy?
boolean=false
if true, roe-mock will copy things insidebaseDir
to an temp dir before creating the application
- copy?
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
MIT