2.0.4 • Published 5 years ago

roe-mock v2.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.0

5 years ago