@@ -75,7 +75,7 @@ describe("API: .stream()", function () {
7575 stream . write ( new File ( { path : "styles3.css" } ) ) ;
7676 stream . end ( ) ;
7777 sinon . assert . calledOnce ( emitterStub ) ;
78- sinon . assert . calledWithExactly ( emitterStub , "browser :reload" ) ;
78+ sinon . assert . calledWithExactly ( emitterStub , "_browser :reload" ) ;
7979 } ) ;
8080 it ( "does not log file info if (once: true)" , function ( ) {
8181 var stream = browserSync . stream ( { once : true } ) ;
@@ -84,7 +84,7 @@ describe("API: .stream()", function () {
8484 stream . write ( new File ( { path : "styles3.js" } ) ) ;
8585 stream . end ( ) ;
8686 sinon . assert . calledOnce ( emitterStub ) ;
87- sinon . assert . calledWithExactly ( emitterStub , "browser :reload" ) ;
87+ sinon . assert . calledWithExactly ( emitterStub , "_browser :reload" ) ;
8888 } ) ;
8989 it ( "only emits file-changed event if filter matched" , function ( ) {
9090 var stream = browserSync . stream ( { match : "**/*.js" } ) ;
@@ -93,13 +93,12 @@ describe("API: .stream()", function () {
9393 stream . end ( ) ;
9494 sinon . assert . calledThrice ( emitterStub ) ;
9595 sinon . assert . calledWithExactly ( emitterStub , "file:changed" , {
96- path : "/users/shane/styles.js" ,
97- basename : "styles.js" ,
98- log : false ,
96+ event : "change" ,
97+ log : false ,
9998 namespace : "core" ,
100- event : "change" ,
101- ext : "js"
99+ path : "/users/shane/styles.js"
102100 } ) ;
101+ sinon . assert . calledWithExactly ( emitterStub , "browser:reload" ) ;
103102 sinon . assert . calledWithExactly ( emitterStub , "stream:changed" , {
104103 changed : [ "styles.js" ]
105104 } ) ;
@@ -151,12 +150,15 @@ describe("API: .stream()", function () {
151150 clock . tick ( ) ;
152151
153152 assert . isFalse ( emitterStub . getCall ( 0 ) . args [ 1 ] . log ) ;
154- assert . isFalse ( emitterStub . getCall ( 1 ) . args [ 1 ] . log ) ;
153+
154+ assert . equal ( emitterStub . getCall ( 1 ) . args [ 0 ] , "browser:reload" ) ;
155+
155156 assert . isFalse ( emitterStub . getCall ( 2 ) . args [ 1 ] . log ) ;
157+ assert . equal ( emitterStub . getCall ( 2 ) . args [ 0 ] , "file:changed" ) ;
158+ assert . equal ( emitterStub . getCall ( 3 ) . args [ 0 ] , "file:reload" ) ;
159+ assert . equal ( emitterStub . getCall ( 3 ) . args [ 1 ] . path , "core.css" ) ;
156160
157- sinon . assert . callCount ( emitterStub , 7 ) ;
158- assert . equal ( emitterStub . getCall ( 6 ) . args [ 0 ] , "stream:changed" ) ;
159- assert . equal ( emitterStub . getCall ( 6 ) . args [ 1 ] . changed . length , 3 ) ;
160- sinon . assert . called ( emitterStub ) ;
161+ assert . equal ( emitterStub . getCall ( 4 ) . args [ 0 ] , "file:changed" ) ;
162+ assert . equal ( emitterStub . getCall ( 5 ) . args , "browser:reload" ) ;
161163 } ) ;
162164} ) ;
0 commit comments