Mercurial > hg > nginx-tests
comparison js_paths.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 |
---|---|
36 %%TEST_GLOBALS_HTTP%% | 36 %%TEST_GLOBALS_HTTP%% |
37 | 37 |
38 js_path "%%TESTDIR%%/lib1"; | 38 js_path "%%TESTDIR%%/lib1"; |
39 js_path "lib2"; | 39 js_path "lib2"; |
40 | 40 |
41 js_include test.js; | 41 js_import test.js; |
42 | 42 |
43 server { | 43 server { |
44 listen 127.0.0.1:8080; | 44 listen 127.0.0.1:8080; |
45 server_name localhost; | 45 server_name localhost; |
46 | 46 |
47 location /test { | 47 location /test { |
48 js_content test; | 48 js_content test.test; |
49 } | 49 } |
50 | 50 |
51 location /test2 { | 51 location /test2 { |
52 js_content test2; | 52 js_content test.test2; |
53 } | 53 } |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 EOF | 57 EOF |
70 } | 70 } |
71 | 71 |
72 function test3(r) { | 72 function test3(r) { |
73 r.return(200, m3.sum(r.args.a, r.args.b)); | 73 r.return(200, m3.sum(r.args.a, r.args.b)); |
74 } | 74 } |
75 | |
76 export default {test, test2}; | |
75 | 77 |
76 EOF | 78 EOF |
77 | 79 |
78 my $d = $t->testdir(); | 80 my $d = $t->testdir(); |
79 | 81 |