-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(api): Add spec for attempts to init twice
- Loading branch information
1 parent
f9e1245
commit 9f711b3
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |