File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -136,14 +136,14 @@ const onSocketMessage = {
136136 // TODO: remove in v5 in favor of 'static-changed'
137137 'content-changed' : function contentChanged ( file ) {
138138 log . info (
139- `${ file || 'Contents ' } from static directory were changed. Reloading...`
139+ `${ file || 'Content ' } from static directory was changed. Reloading...`
140140 ) ;
141141
142142 self . location . reload ( ) ;
143143 } ,
144144 'static-changed' : function staticChanged ( file ) {
145145 log . info (
146- `${ file || 'Contents ' } from static directory were changed. Reloading...`
146+ `${ file || 'Content ' } from static directory was changed. Reloading...`
147147 ) ;
148148
149149 self . location . reload ( ) ;
Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ Array [
7676]
7777`;
7878
79- exports[`index should run onSocketMessage['content-changed'] 1`] = `"Content base changed. Reloading..."`;
79+ exports[`index should run onSocketMessage['content-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
8080
81- exports[`index should run onSocketMessage['static-changed'] 1`] = `"Contents from static directory were changed. Reloading..."`;
81+ exports[`index should run onSocketMessage['static-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
82+
83+ exports[`index should run onSocketMessage['static-changed'](file) 1`] = `"/static/assets/index.html from static directory was changed. Reloading..."`;
8284
8385exports[`index should run onSocketMessage['still-ok'] 1`] = `"Nothing changed."`;
8486
Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ Array [
7676]
7777`;
7878
79- exports[`index should run onSocketMessage['content-changed'] 1`] = `"Content base changed. Reloading..."`;
79+ exports[`index should run onSocketMessage['content-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
8080
81- exports[`index should run onSocketMessage['static-changed'] 1`] = `"Contents from static directory were changed. Reloading..."`;
81+ exports[`index should run onSocketMessage['static-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
82+
83+ exports[`index should run onSocketMessage['static-changed'](file) 1`] = `"/static/assets/index.html from static directory was changed. Reloading..."`;
8284
8385exports[`index should run onSocketMessage['still-ok'] 1`] = `"Nothing changed."`;
8486
Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ describe('index', () => {
173173 expect ( self . location . reload ) . toBeCalled ( ) ;
174174 } ) ;
175175
176+ test ( "should run onSocketMessage['static-changed'](file)" , ( ) => {
177+ onSocketMessage [ 'static-changed' ] ( '/static/assets/index.html' ) ;
178+
179+ expect ( log . log . info . mock . calls [ 0 ] [ 0 ] ) . toMatchSnapshot ( ) ;
180+ expect ( self . location . reload ) . toBeCalled ( ) ;
181+ } ) ;
182+
176183 test ( 'should run onSocketMessage.warnings' , ( ) => {
177184 {
178185 const res = onSocketMessage . warnings ( [
You can’t perform that action at this time.
0 commit comments