Skip to content

Commit

Permalink
tests(api): Add spec for attempts to init twice
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Feb 26, 2015
1 parent f9e1245 commit 9f711b3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/specs/api/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

var browserSync = require("../../../");

var assert = require("chai").assert;

describe("API: .init - don't not call init when already running.", function () {

var instance;

before(function (done) {
browserSync.reset();
var config = {
logLevel: "silent",
open: false
};

instance = browserSync(config, function () {
done();
});
});

after(function () {
instance.cleanup();
});

it("should know the active State of BrowserSync", function () {
var spy = require("sinon").spy(console, "log");
browserSync({server: "test/fixtures"});
var arg = spy.getCall(0).args[0];
assert.include(arg, "browserSync.create().init()");
console.log.restore();
});
});

0 comments on commit 9f711b3

Please sign in to comment.