Skip to content

Commit

Permalink
Add E2E snippet serving spec
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Feb 3, 2015
1 parent 9d26a71 commit 1a54312
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 44 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions test/specs/e2e/cli/e2e.cli.snippet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"use strict";

var path = require("path");
var request = require("supertest");
var assert = require("chai").assert;
var browserSync = require(path.resolve("./"));

var pkg = require(path.resolve("package.json"));
var cli = require(path.resolve(pkg.bin));

describe("E2E CLI Snippet test", function () {

var instance;

before(function (done) {

browserSync.reset();

cli({
cli: {
input: ["start"],
flags: {
logLevel: "silent"
}
},
cb: function (err, bs) {
instance = bs;
done();
}
});
});
after(function () {
instance.cleanup();
});
it("serves versioned browser-sync client js", function (done) {
request(instance.server)
.get(instance.options.getIn(["scriptPaths", "versioned"]))
.set("accept", "text/html")
.expect(200)
.end(function (err, res) {
assert.include(res.text, "Connected to BrowserSync");
done();
});
});
it("serves browser-sync client js", function (done) {
request(instance.server)
.get(instance.options.getIn(["scriptPaths", "path"]))
.set("accept", "text/html")
.expect(200)
.end(function (err, res) {
assert.include(res.text, "Connected to BrowserSync");
done();
});
});
});
44 changes: 0 additions & 44 deletions test/specs/e2e/e2e.cli.snippet.js

This file was deleted.

0 comments on commit 1a54312

Please sign in to comment.