@@ -5,7 +5,7 @@ var browserSync = require("../../../");
55var sinon = require ( "sinon" ) ;
66var File = require ( "vinyl" ) ;
77
8- describe ( "API: .reload ()" , function ( ) {
8+ describe ( "API: .stream ()" , function ( ) {
99
1010 var emitterStub , clock , bs ;
1111
@@ -30,9 +30,7 @@ describe("API: .reload()", function () {
3030 } ) ;
3131
3232 it ( "should handle a single file changed" , function ( ) {
33- var stream = browserSync . reload ( {
34- stream : true
35- } ) ;
33+ var stream = browserSync . stream ( ) ;
3634 stream . write ( new File ( { path : "styles.css" } ) ) ;
3735 stream . end ( ) ;
3836 sinon . assert . calledWithExactly ( emitterStub , "file:changed" , {
@@ -42,7 +40,7 @@ describe("API: .reload()", function () {
4240 } ) ;
4341 } ) ;
4442 it ( "should accept multiple files in stream" , function ( ) {
45- var stream = browserSync . reload ( { stream : true } ) ;
43+ var stream = browserSync . stream ( ) ;
4644 stream . write ( new File ( { path : "styles.css" } ) ) ;
4745 stream . write ( new File ( { path : "styles2.css" } ) ) ;
4846 stream . end ( ) ;
@@ -61,34 +59,16 @@ describe("API: .reload()", function () {
6159 } ) ;
6260 } ) ;
6361 it ( "should reload browser if once:true given as arg" , function ( ) {
64- var stream = browserSync . reload ( { stream : true , once : true } ) ;
62+ var stream = browserSync . stream ( { once : true } ) ;
6563 stream . write ( new File ( { path : "styles.css" } ) ) ;
6664 stream . write ( new File ( { path : "styles2.css" } ) ) ;
6765 stream . write ( new File ( { path : "styles3.css" } ) ) ;
6866 stream . end ( ) ;
6967 sinon . assert . calledOnce ( emitterStub ) ;
7068 sinon . assert . calledWithExactly ( emitterStub , "browser:reload" ) ;
7169 } ) ;
72- it ( "should be able to call .reload after a stream" , function ( ) {
73- browserSync . reload ( ) ;
74- sinon . assert . calledWithExactly ( emitterStub , "browser:reload" ) ;
75-
76- var stream = browserSync . reload ( { stream : true } ) ;
77- stream . write ( new File ( { path : "styles.css" } ) ) ;
78- stream . end ( ) ;
79-
80- sinon . assert . calledWithExactly ( emitterStub , "browser:reload" ) ;
81- sinon . assert . calledWithExactly ( emitterStub , "file:changed" , {
82- path : "styles.css" ,
83- log : false ,
84- namespace : "core"
85- } ) ;
86- sinon . assert . calledWithExactly ( emitterStub , "stream:changed" , {
87- changed : [ "styles.css" ]
88- } ) ;
89- } ) ;
9070 it ( "does not log file info if (once: true)" , function ( ) {
91- var stream = browserSync . reload ( { stream : true , once : true } ) ;
71+ var stream = browserSync . stream ( { once : true } ) ;
9272 stream . write ( new File ( { path : "styles.js" } ) ) ;
9373 stream . write ( new File ( { path : "styles2.js" } ) ) ;
9474 stream . write ( new File ( { path : "styles3.js" } ) ) ;
0 commit comments