comparison js_object.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 bc0990ea2e5b
children
comparison
equal deleted inserted replaced
1750:b28f88e352dd 1751:18ac4d9e5a2a
34 } 34 }
35 35
36 http { 36 http {
37 %%TEST_GLOBALS_HTTP%% 37 %%TEST_GLOBALS_HTTP%%
38 38
39 js_include test.js; 39 js_import test.js;
40 40
41 server { 41 server {
42 listen 127.0.0.1:8080; 42 listen 127.0.0.1:8080;
43 server_name localhost; 43 server_name localhost;
44 44
45 location /to_string { 45 location /to_string {
46 js_content to_string; 46 js_content test.to_string;
47 } 47 }
48 48
49 location /define_prop { 49 location /define_prop {
50 js_content define_prop; 50 js_content test.define_prop;
51 } 51 }
52 52
53 location /in_operator { 53 location /in_operator {
54 js_content in_operator; 54 js_content test.in_operator;
55 } 55 }
56 56
57 location /redefine_bind { 57 location /redefine_bind {
58 js_content redefine_bind; 58 js_content test.redefine_bind;
59 } 59 }
60 60
61 location /redefine_proxy { 61 location /redefine_proxy {
62 js_content redefine_proxy; 62 js_content test.redefine_proxy;
63 } 63 }
64 64
65 location /redefine_proto { 65 location /redefine_proto {
66 js_content redefine_proto; 66 js_content test.redefine_proto;
67 } 67 }
68 68
69 location /get_own_prop_descs { 69 location /get_own_prop_descs {
70 js_content get_own_prop_descs; 70 js_content test.get_own_prop_descs;
71 } 71 }
72 } 72 }
73 } 73 }
74 74
75 EOF 75 EOF
111 function get_own_prop_descs(r) { 111 function get_own_prop_descs(r) {
112 r.return(200, 112 r.return(200,
113 Object.getOwnPropertyDescriptors(r)['log'].value === r.log); 113 Object.getOwnPropertyDescriptors(r)['log'].value === r.log);
114 } 114 }
115 115
116 export default {to_string, define_prop, in_operator, redefine_bind,
117 redefine_proxy, redefine_proto, get_own_prop_descs};
118
116 EOF 119 EOF
117 120
118 $t->try_run('no njs request object')->plan(7); 121 $t->try_run('no njs request object')->plan(7);
119 122
120 ############################################################################### 123 ###############################################################################