changeset 1331:f48d2792730e

Tests: added njs empty js_content handler test.
author Dmitry Volyntsev <xeioex@nginx.com>
date Fri, 01 Jun 2018 16:03:19 +0300
parents b82ed2061f65
children fe60c3959069
files js.t
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js.t
+++ b/js.t
@@ -96,6 +96,10 @@ http {
             return 200 $test_except;
         }
 
+        location /req_empty {
+            js_content content_empty;
+        }
+
         location /res_status {
             js_content status;
         }
@@ -259,9 +263,12 @@ EOF
         JSON.parse({}.a.a);
     }
 
+    function content_empty(req, res) {
+    }
+
 EOF
 
-$t->try_run('no njs available')->plan(22);
+$t->try_run('no njs available')->plan(23);
 
 ###############################################################################
 
@@ -276,6 +283,7 @@ like(http_get('/req_iarg?foo=12345&foo2=
 	'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/,