File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ http {
55
55
location /sub_token {
56
56
js_content sub_token;
57
57
}
58
+
59
+ location /njs {
60
+ js_content test_njs;
61
+ }
58
62
}
59
63
}
60
64
@@ -160,14 +164,24 @@ $t->write_file('test.js', <<EOF);
160
164
r.return(parseInt(code), '{"token": "'+ token +'"}');
161
165
}
162
166
167
+ function test_njs(r) {
168
+ r.return(200, njs.version);
169
+ }
170
+
163
171
EOF
164
172
165
173
$t -> try_run(' no njs available' )-> plan(3);
166
174
167
175
# ##############################################################################
168
176
177
+ TODO: {
178
+ local $TODO = ' not yet'
179
+ unless http_get(' /njs' ) =~ / ^([.0-9]+)$ /m && $1 ge ' 0.3.8' ;
180
+
169
181
like(http_get(' /promise' ), qr / {"token": "b"}/ , " Promise" );
170
182
like(http_get(' /promise_throw' ), qr / {"token": "x"}/ , " Promise throw and catch" );
171
183
like(http_get(' /timeout' ), qr / {"token": "R"}/ , " Promise with timeout" );
172
184
185
+ }
186
+
173
187
# ##############################################################################
You can’t perform that action at this time.
0 commit comments