Mercurial > hg > nginx-tests
comparison js_promise.t @ 1751:18ac4d9e5a2a
Tests: rewriting njs tests without deprecated "js_include".
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Thu, 09 Dec 2021 17:36:29 +0000 |
parents | 54f867e69cb5 |
children | f89770df737a |
comparison
equal
deleted
inserted
replaced
1750:b28f88e352dd | 1751:18ac4d9e5a2a |
---|---|
32 } | 32 } |
33 | 33 |
34 http { | 34 http { |
35 %%TEST_GLOBALS_HTTP%% | 35 %%TEST_GLOBALS_HTTP%% |
36 | 36 |
37 js_include test.js; | 37 js_import test.js; |
38 | 38 |
39 server { | 39 server { |
40 listen 127.0.0.1:8080; | 40 listen 127.0.0.1:8080; |
41 server_name localhost; | 41 server_name localhost; |
42 | 42 |
43 location /njs { | 43 location /njs { |
44 js_content test_njs; | 44 js_content test.njs; |
45 } | 45 } |
46 | 46 |
47 location /promise { | 47 location /promise { |
48 js_content promise; | 48 js_content test.promise; |
49 } | 49 } |
50 | 50 |
51 location /promise_throw { | 51 location /promise_throw { |
52 js_content promise_throw; | 52 js_content test.promise_throw; |
53 } | 53 } |
54 | 54 |
55 location /promise_pure { | 55 location /promise_pure { |
56 js_content promise_pure; | 56 js_content test.promise_pure; |
57 } | 57 } |
58 | 58 |
59 location /timeout { | 59 location /timeout { |
60 js_content timeout; | 60 js_content test.timeout; |
61 } | 61 } |
62 | 62 |
63 location /sub_token { | 63 location /sub_token { |
64 js_content sub_token; | 64 js_content test.sub_token; |
65 } | 65 } |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 EOF | 69 EOF |
182 var token = r.variables.arg_token; | 182 var token = r.variables.arg_token; |
183 | 183 |
184 r.return(parseInt(code), '{"token": "'+ token +'"}'); | 184 r.return(parseInt(code), '{"token": "'+ token +'"}'); |
185 } | 185 } |
186 | 186 |
187 export default {njs:test_njs, promise, promise_throw, promise_pure, | |
188 timeout, sub_token}; | |
189 | |
187 EOF | 190 EOF |
188 | 191 |
189 $t->try_run('no njs available')->plan(4); | 192 $t->try_run('no njs available')->plan(4); |
190 | 193 |
191 ############################################################################### | 194 ############################################################################### |