Tests: js TODO adjusted up to 0.4.0.
diff --git a/js.t b/js.t
index ead6b8a..e779ccf 100644
--- a/js.t
+++ b/js.t
@@ -244,7 +244,6 @@
###############################################################################
-
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=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
index 3f5a41c..02eddc2 100644
--- a/js_dump.t
+++ b/js_dump.t
@@ -42,10 +42,6 @@
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 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_dump(r) {
r.headersOut.baz = 'bar';
r.return(200, njs.dump(r));
@@ -94,10 +86,6 @@
###############################################################################
-TODO: {
-local $TODO = 'not yet'
- unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.3.8';
-
like(http(
'GET /dump?v=1&t=x HTTP/1.0' . CRLF
. 'Foo: bar' . CRLF
@@ -117,6 +105,4 @@
. 'Host: localhost' . CRLF . CRLF
), qr/responseBody":"\{GET}"/, 'JSON.stringify(reply)');
-}
-
###############################################################################
diff --git a/js_internal_redirect.t b/js_internal_redirect.t
index c0785a4..ddbf0f7 100644
--- a/js_internal_redirect.t
+++ b/js_internal_redirect.t
@@ -41,10 +41,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location /test {
js_content test_redirect;
}
@@ -63,10 +59,6 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_redirect(r) {
if (r.variables.arg_dest == 'named') {
r.internalRedirect('\@named');
diff --git a/js_modules.t b/js_modules.t
index c3ce7a9..198ff46 100644
--- a/js_modules.t
+++ b/js_modules.t
@@ -41,10 +41,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location /test {
js_content test;
}
@@ -56,10 +52,6 @@
$t->write_file('test.js', <<EOF);
import m from 'module.js';
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test(r) {
r.return(200, m[r.args.fun](r.args.a, r.args.b));
}
diff --git a/js_object.t b/js_object.t
index 80259dc..1429bb4 100644
--- a/js_object.t
+++ b/js_object.t
@@ -42,10 +42,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location /to_string {
js_content to_string;
}
@@ -79,10 +75,6 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function to_string(r) {
r.return(200, r.toString());
}
@@ -127,11 +119,6 @@
###############################################################################
-TODO: {
-local $TODO = 'not yet'
- unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.4.0';
-
-
like(http_get('/to_string'), qr/\[object Request\]/, 'toString');
like(http_get('/define_prop'), qr/Foo: bar/, 'define_prop');
like(http(
@@ -144,6 +131,4 @@
like(http_get('/redefine_proto'), qr/a|b/, 'redefine_proto');
like(http_get('/get_own_prop_descs'), qr/true/, 'get_own_prop_descs');
-}
-
###############################################################################
diff --git a/js_paths.t b/js_paths.t
index 11e8422..41254d9 100644
--- a/js_paths.t
+++ b/js_paths.t
@@ -44,10 +44,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location /test {
js_content test;
}
@@ -65,10 +61,6 @@
import m2 from 'module2.js';
import m3 from 'lib1/module1.js';
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test(r) {
r.return(200, m1[r.args.fun](r.args.a, r.args.b));
}
diff --git a/js_promise.t b/js_promise.t
index 5a4590a..cf54c18 100644
--- a/js_promise.t
+++ b/js_promise.t
@@ -55,10 +55,6 @@
location /sub_token {
js_content sub_token;
}
-
- location /njs {
- js_content test_njs;
- }
}
}
@@ -164,24 +160,14 @@
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");
-}
-
###############################################################################
diff --git a/js_request_body.t b/js_request_body.t
index 529991f..ffb9375 100644
--- a/js_request_body.t
+++ b/js_request_body.t
@@ -43,10 +43,6 @@
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 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_body(r) {
try {
var body = r.requestBody;
diff --git a/js_return.t b/js_return.t
index f7f9db7..9ec0b8d 100644
--- a/js_return.t
+++ b/js_return.t
@@ -43,10 +43,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location / {
js_content test_return;
}
@@ -56,10 +52,6 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_return(r) {
r.return(Number(r.args.c), r.args.t);
}
diff --git a/js_subrequests.t b/js_subrequests.t
index e2213cf..3c6ccf8 100644
--- a/js_subrequests.t
+++ b/js_subrequests.t
@@ -52,10 +52,6 @@
listen 127.0.0.1:8080;
server_name localhost;
- location /njs {
- js_content test_njs;
- }
-
location /sr {
js_content sr;
}
@@ -259,10 +255,6 @@
$t->write_file('test.js', <<EOF);
this.Failed = {get toConvert() { return {toString(){return {};}}}};
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function sr(r) {
subrequest_fn(r, ['/p/sub2'], ['uri', 'status'])
}
@@ -518,12 +510,6 @@
'{"status":200,"uri":"/p/delayed"}]',
'sr_multi');
-my $ver = http_get('/njs');
-
-TODO: {
-local $TODO = 'not yet'
- unless $ver =~ /^([.0-9]+)$/m && $1 ge '0.3.8';
-
is(get_json('/sr_pr'), '{"h":"xxx"}', 'sr_promise');
is(get_json('/sr_options_args_pr'), '{"h":"xxx"}', 'sr_options_args_pr');
is(get_json('/sr_options_method_pr?m=PUT'), '["PUT"]', 'sr method PUT');
@@ -532,15 +518,8 @@
is(get_json('/sr_unavail_pr'), '[{"status":502,"uri":"/unavail"}]',
'sr_unavail_pr');
-}
-
-TODO: {
-local $TODO = 'not yet'
- unless $ver =~ /^([.0-9]+)$/m && $1 ge '0.3.9';
-
like(http_get('/sr_detached_in_variable_handler'), qr/subrequest_var/,
'sr_detached_in_variable_handler');
-}
http_get('/sr_broken');
http_get('/sr_in_sr');
@@ -571,13 +550,8 @@
'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
index 2e9f6e3..2b67abd 100644
--- a/js_variables.t
+++ b/js_variables.t
@@ -45,10 +45,6 @@
set $foo foo_orig;
- location /njs {
- js_content test_njs;
- }
-
location /var_set {
return 200 $test_var$foo;
}
@@ -66,10 +62,6 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_var(r) {
r.variables.foo = r.variables.arg_a;
return 'test_var';
diff --git a/stream_js_object.t b/stream_js_object.t
index cf23c57..ccbfcd7 100644
--- a/stream_js_object.t
+++ b/stream_js_object.t
@@ -23,7 +23,7 @@
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 @@
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 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function to_string(s) {
return s.toString() === '[object Stream Session]';
}
@@ -110,12 +91,6 @@
###############################################################################
-TODO: {
-local $TODO = 'not yet'
- unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.4.0';
-
is(stream('127.0.0.1:' . port(8081))->read(), 'true400', 'var set');
-}
-
###############################################################################
diff --git a/stream_js_variables.t b/stream_js_variables.t
index dd18255..fc5075c 100644
--- a/stream_js_variables.t
+++ b/stream_js_variables.t
@@ -23,7 +23,7 @@
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 @@
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 @@
EOF
$t->write_file('test.js', <<EOF);
- function test_njs(r) {
- r.return(200, njs.version);
- }
-
function test_var(s) {
s.variables.status = 400;
return 'test_var';