Skip to content

Instantly share code, notes, and snippets.

@ArnaudBuchholz
Created March 7, 2020 04:57
Show Gist options
  • Save ArnaudBuchholz/5ddd226cc3bbf117bbae341f7018ce42 to your computer and use it in GitHub Desktop.
Save ArnaudBuchholz/5ddd226cc3bbf117bbae341f7018ce42 to your computer and use it in GitHub Desktop.
require('reserve/mock')({
port: 8080,
mappings: [{
match: /^\/(.*)/,
file: path.join(__dirname, '$1')
}]
})
.then(mocked => mocked.request('GET', '/'))
.then(response => {
assert(response.statusCode === 200)
assert(response.toString() === '<html />')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment