Tests: fixed empty js_content test committed in f48d2792730e.
njs 0.2.1 version is required for the test. The versions prior to
0.2.0 are no longer maintained.
diff --git a/js.t b/js.t
index 2053f95..c7e35ba 100644
--- a/js.t
+++ b/js.t
@@ -52,6 +52,10 @@
listen 127.0.0.1:8080;
server_name localhost;
+ location /njs {
+ js_content test_njs;
+ }
+
location /req_method {
return 200 $test_method;
}
@@ -133,6 +137,10 @@
EOF
$t->write_file('test.js', <<EOF);
+ function test_njs(req, res) {
+ res.return(200, njs.version);
+ }
+
function test_method(req, res) {
return 'method=' + req.method;
}
@@ -283,7 +291,6 @@
'req.args iteration');
like(http_get('/req_var'), qr/variable=127.0.0.1/, 'req.variables');
like(http_get('/req_log'), qr/200 OK/, 'req.log');
-like(http_get('/req_empty'), qr/500 Internal Server Error/, 'empty handler');
like(http_get('/res_status'), qr/204 No Content/, 'res.status');
like(http_get('/res_ctype'), qr/Content-Type: application\/foo/,
@@ -308,6 +315,12 @@
}
+TODO: {
+local $TODO = 'not yet'
+ unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.2.1';
+like(http_get('/req_empty'), qr/500 Internal Server Error/, 'empty handler');
+}
+
$t->stop();
ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'log js');