Skip to content

Instantly share code, notes, and snippets.

@sombriks
Last active March 30, 2017 16:07
Show Gist options
  • Save sombriks/4d8ab3cc481cdb312a24a725e893a6e9 to your computer and use it in GitHub Desktop.
Save sombriks/4d8ab3cc481cdb312a24a725e893a6e9 to your computer and use it in GitHub Desktop.
mocha+chai+budo+nightmare
"use strict"
const Nightmare = require("nightmare");
const expect = require("chai").expect;
const budo = require("budo");
describe("\u263C basic tests \u263E", () => {
const b = budo("../src/main.js");
it("should check document title", (done) => {
Nightmare().goto("http://127.0.0.1:9966")
.wait("#mount").evaluate(() => {
return document.title;
}).end().then((result) => {
expect(result).to.equal("BTT");
done();
});
});
it("should close test server", (done) => {
b.close();
done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment