[njs] Tests: making exception test more portable in stream_js.t.

noreply at nginx.com noreply at nginx.com
Wed Sep 4 00:59:02 UTC 2024


details:   https://github.com/nginx/njs/commit/a3a4dd45a5377723042df2194b06565e9abc0f2f
branches:  master
commit:    a3a4dd45a5377723042df2194b06565e9abc0f2f
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed, 28 Aug 2024 16:57:49 -0700
description:
Tests: making exception test more portable in stream_js.t.


---
 nginx/t/stream_js.t | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nginx/t/stream_js.t b/nginx/t/stream_js.t
index ed80be65..52ab688e 100644
--- a/nginx/t/stream_js.t
+++ b/nginx/t/stream_js.t
@@ -366,8 +366,7 @@ $t->write_file('test.js', <<EOF);
     }
 
     function preread_except(s) {
-        var fs = require('fs');
-        fs.readFileSync();
+        decodeURI("%E0");
     }
 
     function filter_except(s) {
@@ -441,7 +440,7 @@ like(stream('127.0.0.1:' . port(8101))->read(), qr/\xaa\xbb\xcc\xdd/,
 $t->stop();
 
 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'stream js log');
-ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0,
+ok(index($t->read_file('error.log'), 'at decodeURI') > 0,
 	'stream js_preread backtrace');
 ok(index($t->read_file('error.log'), 'at filter_except') > 0,
 	'stream js_filter backtrace');


More information about the nginx-devel mailing list