# HG changeset patch # User Dmitry Volyntsev # Date 1605635356 0 # Node ID bc0990ea2e5b74f86cdad796974d767b9d8a897e # Parent d7ec131d305a600d4cd4c8d4a7dc972632252213 Tests: js TODO adjusted up to 0.4.0. diff --git a/js.t b/js.t --- a/js.t +++ b/js.t @@ -244,7 +244,6 @@ EOF ############################################################################### - like(http_get('/method'), qr/method=GET/, 'r.method'); like(http_get('/version'), qr/version=1.0/, 'r.httpVersion'); like(http_get('/addr'), qr/addr=127.0.0.1/, 'r.remoteAddress'); @@ -278,14 +277,8 @@ like(http_get('/return_method?c=301&t=pa like(http_get('/return_method?c=404'), qr/404 Not.*html/s, 'return error page'); like(http_get('/return_method?c=inv'), qr/ 500 /, 'return invalid'); -TODO: { -local $TODO = 'not yet' - unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.3.7'; - like(http_get('/arg_keys?b=1&c=2&a=5'), qr/a,b,c/m, 'r.args sorted keys'); -} - like(http_get('/var'), qr/variable=127.0.0.1/, 'r.variables'); like(http_get('/global'), qr/global=njs/, 'global code'); like(http_get('/log'), qr/200 OK/, 'r.log'); diff --git a/js_dump.t b/js_dump.t --- a/js_dump.t +++ b/js_dump.t @@ -42,10 +42,6 @@ http { listen 127.0.0.1:8080; server_name localhost; - location /njs { - js_content test_njs; - } - location /dump { js_content test_dump; } @@ -67,10 +63,6 @@ http { EOF $t->write_file('test.js', <write_file('test.js', <write_file('test.js', <write_file('test.js', <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"); -} - ############################################################################### diff --git a/js_request_body.t b/js_request_body.t --- a/js_request_body.t +++ b/js_request_body.t @@ -43,10 +43,6 @@ http { listen 127.0.0.1:8080; server_name localhost; - location /njs { - js_content test_njs; - } - location /body { js_content test_body; } @@ -61,10 +57,6 @@ http { EOF $t->write_file('test.js', <write_file('test.js', <write_file('test.js', <read_file('error.log'), 'js subrequest: failed to get the parent context') > 0, 'zero parent ctx'); -TODO: { -local $TODO = 'not yet' - unless $ver =~ /^([.0-9]+)$/m && $1 ge '0.3.9'; - ok(index($t->read_file('error.log'), 'DETACHED') > 0, 'detached subrequest'); -} ############################################################################### diff --git a/js_variables.t b/js_variables.t --- a/js_variables.t +++ b/js_variables.t @@ -45,10 +45,6 @@ http { set $foo foo_orig; - location /njs { - js_content test_njs; - } - location /var_set { return 200 $test_var$foo; } @@ -66,10 +62,6 @@ http { EOF $t->write_file('test.js', <new()->has(qw/http stream stream_return/) +my $t = Test::Nginx->new()->has(qw/stream stream_return/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -33,21 +33,6 @@ daemon off; events { } -http { - %%TEST_GLOBALS_HTTP%% - - js_include test.js; - - server { - listen 127.0.0.1:8080; - server_name localhost; - - location /njs { - js_content test_njs; - } - } -} - stream { %%TEST_GLOBALS_STREAM%% @@ -64,10 +49,6 @@ stream { EOF $t->write_file('test.js', <read(), 'true400', 'var set'); -} - ############################################################################### diff --git a/stream_js_variables.t b/stream_js_variables.t --- a/stream_js_variables.t +++ b/stream_js_variables.t @@ -23,7 +23,7 @@ use Test::Nginx::Stream qw/ stream /; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http stream stream_return/) +my $t = Test::Nginx->new()->has(qw/stream stream_return/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -33,21 +33,6 @@ daemon off; events { } -http { - %%TEST_GLOBALS_HTTP%% - - js_include test.js; - - server { - listen 127.0.0.1:8080; - server_name localhost; - - location /njs { - js_content test_njs; - } - } -} - stream { %%TEST_GLOBALS_STREAM%% @@ -70,10 +55,6 @@ stream { EOF $t->write_file('test.js', <