Skip to content

Commit 932b39b

Browse files
committed
Updated tests to play nice with 0.10.
1 parent 3131d7f commit 932b39b

9 files changed

Lines changed: 35 additions & 16 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ language: node_js
22
node_js:
33
- "0.6"
44
- "0.8"
5+
- "0.10"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Felix Geisendörfer <[email protected]> (http://debuggable.com/)",
33
"name": "form-data",
44
"description": "A module to create readable `\"multipart/form-data\"` streams. Can be used to submit forms and file uploads to other web applications.",
5-
"version": "0.0.9",
5+
"version": "0.0.10",
66
"repository": {
77
"type": "git",
88
"url": "git://github.com/felixge/node-form-data.git"

test/integration/test-custom-filename.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ server.listen(common.port, function() {
4646
}
4747

4848
assert.strictEqual(res.statusCode, 200);
49+
50+
// unstuck new streams
51+
res.resume();
52+
4953
server.close();
5054
});
5155

test/integration/test-custom-headers.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,12 @@ var expectedLength;
1818

1919
var server = http.createServer(function(req, res) {
2020
var data = '';
21-
req.setEncoding('utf8');
2221

23-
req.on('data', function(d) {
24-
data += d;
25-
});
26-
27-
req.on('end', function() {
28-
assert.ok( data.indexOf( testHeader ) != -1 );
29-
30-
// content-length would be 1000+ w/actual buffer size,
31-
// but smaller w/overridden size.
32-
assert.ok( typeof req.headers['content-length'] !== 'undefined' );
33-
assert.equal(req.headers['content-length'], expectedLength);
22+
assert.ok( typeof req.headers['content-length'] !== 'undefined' );
23+
assert.equal(req.headers['content-length'], expectedLength);
3424

35-
res.writeHead(200);
36-
res.end('done');
37-
});
25+
res.writeHead(200);
26+
res.end('done');
3827
});
3928

4029

@@ -69,6 +58,10 @@ server.listen(common.port, function() {
6958
}
7059

7160
assert.strictEqual(res.statusCode, 200);
61+
62+
// unstuck new streams
63+
res.resume();
64+
7265
server.close();
7366
});
7467

test/integration/test-http-response.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ http.request(options, function(res) {
4545
}
4646

4747
assert.strictEqual(res.statusCode, 200);
48+
49+
// unstuck new streams
50+
res.resume();
51+
4852
server.close();
4953
});
5054

test/integration/test-pipe.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ server.listen(common.port, function() {
6464
form.pipe(request);
6565

6666
request.on('response', function(res) {
67+
68+
// unstuck new streams
69+
res.resume();
70+
6771
server.close();
6872
});
6973
});

test/integration/test-submit-custom.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ server.listen(common.port, function() {
6767
}
6868

6969
assert.strictEqual(res.statusCode, 200);
70+
71+
// unstuck new streams
72+
res.resume();
73+
7074
server.close();
7175
});
7276

test/integration/test-submit.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ server.listen(common.port, function() {
6363
}
6464

6565
assert.strictEqual(res.statusCode, 200);
66+
67+
// unstuck new streams
68+
res.resume();
69+
6670
server.close();
6771
});
6872

test/run.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env node
22
var far = require('far').create();
33

4+
if (process.env.verbose)
5+
{
6+
far.verbose(process.env.verbose);
7+
}
8+
49
far.add(__dirname);
510
far.include(/test-.*\.js$/);
611

0 commit comments

Comments
 (0)