@@ -33,8 +33,8 @@ describe("file-watching", function () {
3333
3434 it ( "Watches files with no namespace" , function ( done ) {
3535
36- assert . ok ( instance . watchers . core ) ;
37- assert . ok ( instance . watchers . core [ 0 ] ) ;
36+ assert . ok ( instance . watchers . core . watchers ) ;
37+ assert . equal ( instance . watchers . core . watchers . length , 1 ) ;
3838 done ( ) ;
3939 } ) ;
4040 } ) ;
@@ -50,9 +50,7 @@ describe("file-watching", function () {
5050 file = path . join ( outpath , "watch-func.txt" ) ;
5151
5252 var config = {
53- files : {
54- "*.html" : true
55- } ,
53+ files : "*.html" ,
5654 logLevel : "silent"
5755 } ;
5856
@@ -63,10 +61,48 @@ describe("file-watching", function () {
6361 instance . cleanup ( ) ;
6462 } ) ;
6563
66- it ( "Watches files when object given" , function ( done ) {
64+ it ( "Watches files when multi given" , function ( done ) {
6765
68- assert . ok ( instance . watchers . core ) ;
69- assert . ok ( instance . watchers . core [ 0 ] ) ;
66+ assert . ok ( instance . watchers . core . watchers ) ;
67+ assert . ok ( instance . watchers . core . watchers [ 0 ] ) ;
68+ done ( ) ;
69+ } ) ;
70+ } ) ;
71+
72+ describe ( "E2E Adding namespaced watchers" , function ( ) {
73+
74+ var instance , file ;
75+
76+ before ( function ( done ) {
77+
78+ browserSync . reset ( ) ;
79+
80+ file = path . join ( outpath , "watch-func.txt" ) ;
81+
82+ var config = {
83+ files : [
84+ "*.html" ,
85+ {
86+ match : "*.css" ,
87+ fn : function ( event , file ) {
88+ console . log ( file ) ;
89+ }
90+ }
91+ ] ,
92+ logLevel : "silent"
93+ } ;
94+
95+ instance = browserSync ( config , done ) . instance ;
96+ } ) ;
97+
98+ after ( function ( ) {
99+ instance . cleanup ( ) ;
100+ } ) ;
101+
102+ it ( "Watches files when multi given + objs" , function ( done ) {
103+
104+ assert . ok ( instance . watchers . core . watchers ) ;
105+ assert . equal ( instance . watchers . core . watchers . length , 2 ) ;
70106 done ( ) ;
71107 } ) ;
72108 } ) ;
0 commit comments