aboutsummaryrefslogtreecommitdiff
path: root/nginx/t
diff options
context:
space:
mode:
Diffstat (limited to 'nginx/t')
-rw-r--r--nginx/t/js_fetch.t4
-rw-r--r--nginx/t/js_fetch_https.t2
-rw-r--r--nginx/t/js_fetch_objects.t23
-rw-r--r--nginx/t/js_fetch_resolver.t2
-rw-r--r--nginx/t/js_fetch_timeout.t2
-rw-r--r--nginx/t/js_fetch_verify.t2
-rw-r--r--nginx/t/js_periodic_fetch.t2
-rw-r--r--nginx/t/stream_js_fetch.t2
-rw-r--r--nginx/t/stream_js_fetch_https.t2
-rw-r--r--nginx/t/stream_js_fetch_init.t2
-rw-r--r--nginx/t/stream_js_periodic_fetch.t1
11 files changed, 22 insertions, 22 deletions
diff --git a/nginx/t/js_fetch.t b/nginx/t/js_fetch.t
index ae9d1f61..7ee1a602 100644
--- a/nginx/t/js_fetch.t
+++ b/nginx/t/js_fetch.t
@@ -342,6 +342,8 @@ $t->write_file('test.js', <<EOF);
}
}
+ out.sort();
+
r.return(200, JSON.stringify(out));
}
@@ -411,8 +413,6 @@ EOF
$t->try_run('no njs.fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(37);
$t->run_daemon(\&http_daemon, port(8082));
diff --git a/nginx/t/js_fetch_https.t b/nginx/t/js_fetch_https.t
index 9a44a339..8ede1048 100644
--- a/nginx/t/js_fetch_https.t
+++ b/nginx/t/js_fetch_https.t
@@ -196,8 +196,6 @@ foreach my $name ('default.example.com', '1.example.com') {
$t->try_run('no njs.fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(7);
$t->run_daemon(\&dns_daemon, port(8981), $t);
diff --git a/nginx/t/js_fetch_objects.t b/nginx/t/js_fetch_objects.t
index 67cabdfc..bc5cc7ed 100644
--- a/nginx/t/js_fetch_objects.t
+++ b/nginx/t/js_fetch_objects.t
@@ -271,7 +271,9 @@ $t->write_file('test.js', <<EOF);
})
} catch (e) {
- if (!e.message.startsWith('Cannot assign to read-only p')) {
+ if (!e.message.startsWith('Cannot assign to read-only p')
+ && !e.message.startsWith('no setter for property'))
+ {
throw e;
}
}
@@ -386,6 +388,17 @@ $t->write_file('test.js', <<EOF);
var body = await r.text();
return `\${body}: \${r.headers.get('Content-Type')}`;
}, 'ABC: text/plain;charset=UTF-8'],
+ ['arrayBuffer()', async () => {
+ var r = new Request("http://nginx.org", {body: 'ABC'});
+ var body = await r.arrayBuffer();
+ body = new Uint8Array(body);
+ return new TextDecoder().decode(body);
+ }, 'ABC'],
+ ['json()', async () => {
+ var r = new Request("http://nginx.org", {body: '{"a": 42}'});
+ var body = await r.json();
+ return body.a;
+ }, 42],
['user content type', async () => {
var r = new Request("http://nginx.org",
{body: 'ABC',
@@ -443,6 +456,12 @@ $t->write_file('test.js', <<EOF);
var body = await r.text();
return `\${r.url}: \${body} \${r.headers.get('b')}`;
}, ': Y'],
+ ['arrayBuffer', async () => {
+ var r = new Response('foo');
+ var body = await r.arrayBuffer();
+ body = new Uint8Array(body);
+ return new TextDecoder().decode(body);
+ }, 'foo'],
['json', async () => {
var r = new Response('{"a": {"b": 42}}');
var json = await r.json();
@@ -515,8 +534,6 @@ EOF
$t->try_run('no njs');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(5);
###############################################################################
diff --git a/nginx/t/js_fetch_resolver.t b/nginx/t/js_fetch_resolver.t
index 7cea3386..031ff43c 100644
--- a/nginx/t/js_fetch_resolver.t
+++ b/nginx/t/js_fetch_resolver.t
@@ -146,8 +146,6 @@ EOF
$t->try_run('no njs.fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(5);
$t->run_daemon(\&dns_daemon, port(8981), $t);
diff --git a/nginx/t/js_fetch_timeout.t b/nginx/t/js_fetch_timeout.t
index 5b207b90..ab1ba24a 100644
--- a/nginx/t/js_fetch_timeout.t
+++ b/nginx/t/js_fetch_timeout.t
@@ -116,8 +116,6 @@ EOF
$t->try_run('no js_fetch_timeout');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(2);
###############################################################################
diff --git a/nginx/t/js_fetch_verify.t b/nginx/t/js_fetch_verify.t
index 4c97e04d..f98b4d8c 100644
--- a/nginx/t/js_fetch_verify.t
+++ b/nginx/t/js_fetch_verify.t
@@ -114,8 +114,6 @@ foreach my $name ('localhost') {
$t->try_run('no js_fetch_verify');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(2);
$t->run_daemon(\&dns_daemon, port(8981), $t);
diff --git a/nginx/t/js_periodic_fetch.t b/nginx/t/js_periodic_fetch.t
index d7bcfb76..0231b662 100644
--- a/nginx/t/js_periodic_fetch.t
+++ b/nginx/t/js_periodic_fetch.t
@@ -121,8 +121,6 @@ EOF
$t->try_run('no js_periodic with fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(3);
###############################################################################
diff --git a/nginx/t/stream_js_fetch.t b/nginx/t/stream_js_fetch.t
index c57128a8..9a42ae29 100644
--- a/nginx/t/stream_js_fetch.t
+++ b/nginx/t/stream_js_fetch.t
@@ -171,8 +171,6 @@ EOF
$t->try_run('no stream njs available');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(9);
$t->run_daemon(\&stream_daemon, port(8090), port(8091));
diff --git a/nginx/t/stream_js_fetch_https.t b/nginx/t/stream_js_fetch_https.t
index 5d7c5c20..987a896a 100644
--- a/nginx/t/stream_js_fetch_https.t
+++ b/nginx/t/stream_js_fetch_https.t
@@ -273,8 +273,6 @@ foreach my $name ('default.example.com', '1.example.com') {
$t->try_run('no njs.fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(6);
$t->run_daemon(\&dns_daemon, port(8981), $t);
diff --git a/nginx/t/stream_js_fetch_init.t b/nginx/t/stream_js_fetch_init.t
index 3f6d7262..f48b9d5e 100644
--- a/nginx/t/stream_js_fetch_init.t
+++ b/nginx/t/stream_js_fetch_init.t
@@ -92,8 +92,6 @@ EOF
$t->try_run('no stream njs available');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
-
$t->plan(1);
$t->run_daemon(\&stream_daemon, port(8090));
diff --git a/nginx/t/stream_js_periodic_fetch.t b/nginx/t/stream_js_periodic_fetch.t
index e88d69d5..60599423 100644
--- a/nginx/t/stream_js_periodic_fetch.t
+++ b/nginx/t/stream_js_periodic_fetch.t
@@ -147,7 +147,6 @@ EOF
$t->run_daemon(\&stream_daemon, port(8090));
$t->try_run('no js_periodic with fetch');
-plan(skip_all => 'not yet') if http_get('/engine') =~ /QuickJS$/m;
$t->plan(3);
$t->waitforsocket('127.0.0.1:' . port(8090));