Mercurial > hg > nginx-tests
comparison js.t @ 1607:0411d30859ad
Tests: changed log js test.
SEE-THIS label is already used in 'return text' test. To avoid potential
overlap, a different label should be used for 'log js' test.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 10 Nov 2020 18:45:10 +0000 |
parents | ca0858ef7d3d |
children | bc0990ea2e5b |
comparison
equal
deleted
inserted
replaced
1606:e4e0695552ed | 1607:0411d30859ad |
---|---|
220 function arg_keys(r) { | 220 function arg_keys(r) { |
221 r.return(200, Object.keys(r.args).sort()); | 221 r.return(200, Object.keys(r.args).sort()); |
222 } | 222 } |
223 | 223 |
224 function test_log(r) { | 224 function test_log(r) { |
225 r.log('SEE-THIS'); | 225 r.log('SEE-LOG'); |
226 } | 226 } |
227 | 227 |
228 function test_except(r) { | 228 function test_except(r) { |
229 var fs = require('fs'); | 229 var fs = require('fs'); |
230 fs.readFileSync(); | 230 fs.readFileSync(); |
296 like(http_get('/content_empty'), qr/500 Internal Server Error/, | 296 like(http_get('/content_empty'), qr/500 Internal Server Error/, |
297 'empty handler'); | 297 'empty handler'); |
298 | 298 |
299 $t->stop(); | 299 $t->stop(); |
300 | 300 |
301 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'log js'); | 301 ok(index($t->read_file('error.log'), 'SEE-LOG') > 0, 'log js'); |
302 ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, | 302 ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, |
303 'js_set backtrace'); | 303 'js_set backtrace'); |
304 ok(index($t->read_file('error.log'), 'at JSON.parse') > 0, | 304 ok(index($t->read_file('error.log'), 'at JSON.parse') > 0, |
305 'js_content backtrace'); | 305 'js_content backtrace'); |
306 | 306 |