Skip to content

Commit 6bf177f

Browse files
authored
Merge pull request #73 from vivki/main
add unit test for js_periodic
2 parents badc29f + 3a98076 commit 6bf177f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

analyze_test.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func TestAnalyze_njs(t *testing.T) {
234234
blockCtx{"http", "location"},
235235
false,
236236
},
237-
"js_periodic not ok in http": {
237+
"js_periodic not ok in http if": {
238238
&Directive{
239239
Directive: "js_periodic",
240240
Args: []string{"function"},
@@ -252,6 +252,15 @@ func TestAnalyze_njs(t *testing.T) {
252252
blockCtx{"stream", "server"},
253253
false,
254254
},
255+
"js_periodic not ok in stream": {
256+
&Directive{
257+
Directive: "js_periodic",
258+
Args: []string{"function"},
259+
Line: 5,
260+
},
261+
blockCtx{"stream"},
262+
true,
263+
},
255264
}
256265

257266
for name, tc := range testcases {

0 commit comments

Comments
 (0)