-
Notifications
You must be signed in to change notification settings - Fork 754
/
init.reload.stream.noop.js
40 lines (32 loc) · 1.13 KB
/
init.reload.stream.noop.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"use strict";
var browserSync = require("../../../");
var assert = require("chai").assert;
var File = require("vinyl");
var sinon = require("sinon");
describe("API: .stream() noop", function () {
before(function () {
browserSync.reset();
});
it("should can handle a reload + stream call when there's no instance", function () {
assert.doesNotThrow(function () {
var stream = browserSync.stream();
stream.write(new File({path: "styles.css"}));
stream.end();
});
});
it("should can handle a reload + stream call after there IS an instance", function (done) {
var emitterStub;
var bs = browserSync(function () {
var stream = bs.stream();
emitterStub = sinon.spy(bs.emitter, "emit");
stream.write(new File({path: "styles.css"}));
stream.end();
sinon.assert.calledWithExactly(emitterStub, "file:changed", {
path: "styles.css",
log: false,
namespace: "core"
});
done();
});
});
});