comparison js_paths.t @ 1614:bc0990ea2e5b

Tests: js TODO adjusted up to 0.4.0.
author Dmitry Volyntsev <xeioex@nginx.com>
date Tue, 17 Nov 2020 17:49:16 +0000
parents f4ae08adc23f
children 18ac4d9e5a2a
comparison
equal deleted inserted replaced
1613:d7ec131d305a 1614:bc0990ea2e5b
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 /njs {
48 js_content test_njs;
49 }
50
51 location /test { 47 location /test {
52 js_content test; 48 js_content test;
53 } 49 }
54 50
55 location /test2 { 51 location /test2 {
62 58
63 $t->write_file('test.js', <<EOF); 59 $t->write_file('test.js', <<EOF);
64 import m1 from 'module1.js'; 60 import m1 from 'module1.js';
65 import m2 from 'module2.js'; 61 import m2 from 'module2.js';
66 import m3 from 'lib1/module1.js'; 62 import m3 from 'lib1/module1.js';
67
68 function test_njs(r) {
69 r.return(200, njs.version);
70 }
71 63
72 function test(r) { 64 function test(r) {
73 r.return(200, m1[r.args.fun](r.args.a, r.args.b)); 65 r.return(200, m1[r.args.fun](r.args.a, r.args.b));
74 } 66 }
75 67