egg.js plugin of hypnotize
$ npm install --save-dev egg-hypnotize
Add following to plugin.unittest.js
exports.hypnotize = {
enable: true,
package: 'egg-hypnotize',
};
Now you can use hypnotize in your unit test
it('title of `/foo` should be "Foo"', function* () {
const title = yield app.hypnotize()
.goto('/foo')
.title()
.end();
assert(title === 'Foo');
});
MIT