@@ -124,13 +124,19 @@ func Test_WatchOpts_IsAvailable(t *testing.T) {
124124
125125func Test_WatchOpts_GetManifestWatchConfig (t * testing.T ) {
126126 tests := map [string ]struct {
127- watchOpts WatchOpts
127+ watchOpts * WatchOpts
128128 expectedPaths []string
129129 expectedRegex string
130130 expectedEnabled bool
131131 }{
132+ "Nil WatchOpts pointer" : {
133+ watchOpts : nil ,
134+ expectedPaths : nil ,
135+ expectedRegex : "" ,
136+ expectedEnabled : false ,
137+ },
132138 "Nested manifest config" : {
133- watchOpts : WatchOpts {
139+ watchOpts : & WatchOpts {
134140 Manifest : & ManifestWatchOpts {
135141 Paths : []string {"manifest.json" , "workflows/" },
136142 FilterRegex : "\\ .json$" ,
@@ -141,7 +147,7 @@ func Test_WatchOpts_GetManifestWatchConfig(t *testing.T) {
141147 expectedEnabled : true ,
142148 },
143149 "Legacy flat config" : {
144- watchOpts : WatchOpts {
150+ watchOpts : & WatchOpts {
145151 Paths : []string {"manifest.json" , "src/" },
146152 FilterRegex : "\\ .(json|ts)$" ,
147153 },
@@ -150,7 +156,7 @@ func Test_WatchOpts_GetManifestWatchConfig(t *testing.T) {
150156 expectedEnabled : true ,
151157 },
152158 "Nested config takes precedence over legacy" : {
153- watchOpts : WatchOpts {
159+ watchOpts : & WatchOpts {
154160 Paths : []string {"old-path/" },
155161 FilterRegex : "old-regex" ,
156162 Manifest : & ManifestWatchOpts {
@@ -163,7 +169,7 @@ func Test_WatchOpts_GetManifestWatchConfig(t *testing.T) {
163169 expectedEnabled : true ,
164170 },
165171 "Empty nested manifest config" : {
166- watchOpts : WatchOpts {
172+ watchOpts : & WatchOpts {
167173 Manifest : & ManifestWatchOpts {
168174 Paths : []string {},
169175 },
@@ -173,7 +179,7 @@ func Test_WatchOpts_GetManifestWatchConfig(t *testing.T) {
173179 expectedEnabled : false ,
174180 },
175181 "Empty legacy config" : {
176- watchOpts : WatchOpts {
182+ watchOpts : & WatchOpts {
177183 Paths : []string {},
178184 },
179185 expectedPaths : []string {},
@@ -193,13 +199,19 @@ func Test_WatchOpts_GetManifestWatchConfig(t *testing.T) {
193199
194200func Test_WatchOpts_GetAppWatchConfig (t * testing.T ) {
195201 tests := map [string ]struct {
196- watchOpts WatchOpts
202+ watchOpts * WatchOpts
197203 expectedPaths []string
198204 expectedRegex string
199205 expectedEnabled bool
200206 }{
207+ "Nil WatchOpts pointer" : {
208+ watchOpts : nil ,
209+ expectedPaths : nil ,
210+ expectedRegex : "" ,
211+ expectedEnabled : false ,
212+ },
201213 "Nested app config" : {
202- watchOpts : WatchOpts {
214+ watchOpts : & WatchOpts {
203215 App : & AppWatchOpts {
204216 Paths : []string {"src/" , "functions/" },
205217 FilterRegex : "\\ .(ts|js)$" ,
@@ -210,7 +222,7 @@ func Test_WatchOpts_GetAppWatchConfig(t *testing.T) {
210222 expectedEnabled : true ,
211223 },
212224 "Legacy config does not enable app watching" : {
213- watchOpts : WatchOpts {
225+ watchOpts : & WatchOpts {
214226 Paths : []string {"manifest.json" , "src/" },
215227 FilterRegex : "\\ .(json|ts)$" ,
216228 },
@@ -219,7 +231,7 @@ func Test_WatchOpts_GetAppWatchConfig(t *testing.T) {
219231 expectedEnabled : false ,
220232 },
221233 "Empty nested app config" : {
222- watchOpts : WatchOpts {
234+ watchOpts : & WatchOpts {
223235 App : & AppWatchOpts {
224236 Paths : []string {},
225237 },
@@ -229,7 +241,7 @@ func Test_WatchOpts_GetAppWatchConfig(t *testing.T) {
229241 expectedEnabled : false ,
230242 },
231243 "Nil app config" : {
232- watchOpts : WatchOpts {},
244+ watchOpts : & WatchOpts {},
233245 expectedPaths : nil ,
234246 expectedRegex : "" ,
235247 expectedEnabled : false ,
0 commit comments