E2E test node server using nightmare.
$ npm install --save-dev hypnotize
const assert = require('assert')
const hypnotize = require('hypnotize')
const express = require('express')
const app = express()
app.get('/info', function (req, res) {
res.send('<p>Info</p>')
})
hypnotize(app)
.goto('/info')
.evaluate(function () {
return document.querySelector('p').innerText
})
.end()
.then(function (text) {
assert.equal(text, 'Info')
})
MIT