changeset 1540:5e2b8621aa5d

Tests: TODO js_promise.t on njs < 0.3.8.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 27 Dec 2019 13:15:37 +0300
parents 57a92c20f974
children b9de5364dfc9
files js_promise.t
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/js_promise.t
+++ b/js_promise.t
@@ -55,6 +55,10 @@ http {
         location /sub_token {
             js_content sub_token;
         }
+
+        location /njs {
+            js_content test_njs;
+        }
     }
 }
 
@@ -160,14 +164,24 @@ EOF
         r.return(parseInt(code), '{"token": "'+ token +'"}');
     }
 
+    function test_njs(r) {
+        r.return(200, njs.version);
+    }
+
 EOF
 
 $t->try_run('no njs available')->plan(3);
 
 ###############################################################################
 
+TODO: {
+local $TODO = 'not yet'
+	unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.3.8';
+
 like(http_get('/promise'), qr/{"token": "b"}/, "Promise");
 like(http_get('/promise_throw'), qr/{"token": "x"}/, "Promise throw and catch");
 like(http_get('/timeout'), qr/{"token": "R"}/, "Promise with timeout");
 
+}
+
 ###############################################################################