File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
- require ( '../test/common' ) ;
1
+ var common = require ( '../test/common' ) ;
2
2
var http = require ( 'http' ) ,
3
3
util = require ( 'util' ) ,
4
- formidable = require ( 'formidable' ) ,
4
+ formidable = common . formidable ,
5
+ port = common . port ,
5
6
server ;
6
7
7
8
server = http . createServer ( function ( req , res ) {
@@ -38,6 +39,6 @@ server = http.createServer(function(req, res) {
38
39
res . end ( '404' ) ;
39
40
}
40
41
} ) ;
41
- server . listen ( TEST_PORT ) ;
42
+ server . listen ( port ) ;
42
43
43
- console . log ( 'listening on http://localhost:' + TEST_PORT + '/' ) ;
44
+ console . log ( 'listening on http://localhost:' + port + '/' ) ;
Original file line number Diff line number Diff line change 1
- require ( '../test/common' ) ;
1
+ var common = require ( '../test/common' ) ;
2
2
var http = require ( 'http' ) ,
3
3
util = require ( 'util' ) ,
4
- formidable = require ( 'formidable' ) ,
4
+ os = require ( 'os' ) ,
5
+ formidable = common . formidable ,
6
+ port = common . port ,
5
7
server ;
6
8
7
9
server = http . createServer ( function ( req , res ) {
@@ -19,7 +21,7 @@ server = http.createServer(function(req, res) {
19
21
files = [ ] ,
20
22
fields = [ ] ;
21
23
22
- form . uploadDir = TEST_TMP ;
24
+ form . uploadDir = os . tmpdir ( ) ;
23
25
24
26
form
25
27
. on ( 'field' , function ( field , value ) {
@@ -43,6 +45,6 @@ server = http.createServer(function(req, res) {
43
45
res . end ( '404' ) ;
44
46
}
45
47
} ) ;
46
- server . listen ( TEST_PORT ) ;
48
+ server . listen ( port ) ;
47
49
48
- console . log ( 'listening on http://localhost:' + TEST_PORT + '/' ) ;
50
+ console . log ( 'listening on http://localhost:' + port + '/' ) ;
You can’t perform that action at this time.
0 commit comments