summaryrefslogtreecommitdiffhomepage
path: root/test/node/write_callback/app.js
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-12-04 19:05:10 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-12-04 19:05:10 +0300
commit2ef5011236b1088c2f8b460c2c13c07e9b727477 (patch)
treec8f0a42ec657e1da5669bb575aa435babb1bf76b /test/node/write_callback/app.js
parentd500e29f8818247c1eb6fe38c0d802405aa2c283 (diff)
downloadunit-2ef5011236b1088c2f8b460c2c13c07e9b727477.tar.gz
unit-2ef5011236b1088c2f8b460c2c13c07e9b727477.tar.bz2
Tests: fixed test_node_application_write_callback.
Fixed the write() callback order test. Also introduced a separate test to verify the callback call itself.
Diffstat (limited to 'test/node/write_callback/app.js')
-rwxr-xr-xtest/node/write_callback/app.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/node/write_callback/app.js b/test/node/write_callback/app.js
index 9d4bc1c5..3a9e51e8 100755
--- a/test/node/write_callback/app.js
+++ b/test/node/write_callback/app.js
@@ -1,10 +1,13 @@
#!/usr/bin/env node
+var fs = require('fs');
+
require('unit-http').createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
- var a = 'blah';
+ var a = 'world';
res.write('hello', 'utf8', function() {
- a = 'world';
+ a = 'blah';
+ fs.appendFile('callback', '', function() {});
});
res.end(a);
}).listen(7080);