File tree 4 files changed +17
-6
lines changed
4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -136,14 +136,14 @@ const onSocketMessage = {
136
136
// TODO: remove in v5 in favor of 'static-changed'
137
137
'content-changed' : function contentChanged ( file ) {
138
138
log . info (
139
- `${ file || 'Contents ' } from static directory were changed. Reloading...`
139
+ `${ file || 'Content ' } from static directory was changed. Reloading...`
140
140
) ;
141
141
142
142
self . location . reload ( ) ;
143
143
} ,
144
144
'static-changed' : function staticChanged ( file ) {
145
145
log . info (
146
- `${ file || 'Contents ' } from static directory were changed. Reloading...`
146
+ `${ file || 'Content ' } from static directory was changed. Reloading...`
147
147
) ;
148
148
149
149
self . location . reload ( ) ;
Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ Array [
76
76
]
77
77
`;
78
78
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..."`;
80
80
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..."`;
82
84
83
85
exports[`index should run onSocketMessage['still-ok'] 1`] = `"Nothing changed."`;
84
86
Original file line number Diff line number Diff line change @@ -76,9 +76,11 @@ Array [
76
76
]
77
77
`;
78
78
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..."`;
80
80
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..."`;
82
84
83
85
exports[`index should run onSocketMessage['still-ok'] 1`] = `"Nothing changed."`;
84
86
Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ describe('index', () => {
173
173
expect ( self . location . reload ) . toBeCalled ( ) ;
174
174
} ) ;
175
175
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
+
176
183
test ( 'should run onSocketMessage.warnings' , ( ) => {
177
184
{
178
185
const res = onSocketMessage . warnings ( [
You can’t perform that action at this time.
0 commit comments