Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't use require.paths

node will remove this at some point, let's get rid of it.
  • Loading branch information...
commit eb4468be17f438be9bef36fe8e4f83661d6267eb 1 parent 230d0d3
@felixge authored
View
0  lib/formidable/file.js → lib/file.js
File renamed without changes
View
0  lib/formidable/incoming_form.js → lib/incoming_form.js
File renamed without changes
View
0  lib/formidable/index.js → lib/index.js
File renamed without changes
View
0  lib/formidable/multipart_parser.js → lib/multipart_parser.js
File renamed without changes
View
0  lib/formidable/querystring_parser.js → lib/querystring_parser.js
File renamed without changes
View
0  lib/formidable/util.js → lib/util.js
File renamed without changes
View
9 test/common.js
@@ -1,21 +1,16 @@
var path = require('path'),
fs = require('fs');
-require.paths.unshift(path.dirname(__dirname)+'/lib');
-var util = require('formidable/util');
-
try {
global.Gently = require('gently');
} catch (e) {
throw new Error('this test suite requires node-gently');
}
+exports.lib = path.join(__dirname, '../lib');
+
global.GENTLY = new Gently();
-global.puts = util.puts;
-global.p = function() {
- util.error(util.inspect.apply(null, arguments));
-};
global.assert = require('assert');
global.TEST_PORT = 13532;
global.TEST_FIXTURES = path.join(__dirname, 'fixture');
View
4 test/integration/test-multipart-parser.js
@@ -1,6 +1,6 @@
-require('../common');
+var common = require('../common');
var CHUNK_LENGTH = 10,
- multipartParser = require('formidable/multipart_parser'),
+ multipartParser = require(common.lib + '/multipart_parser'),
MultipartParser = multipartParser.MultipartParser,
parser = new MultipartParser(),
fixtures = require('../fixture/multipart'),
View
4 test/simple/test-file.js
@@ -1,7 +1,7 @@
-require('../common');
+var common = require('../common');
var WriteStreamStub = GENTLY.stub('fs', 'WriteStream');
-var File = require('formidable/file'),
+var File = require(common.lib + '/file'),
EventEmitter = require('events').EventEmitter,
file,
gently;
View
4 test/simple/test-incoming-form.js
@@ -1,10 +1,10 @@
-require('../common');
+var common = require('../common');
var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'),
QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'),
EventEmitterStub = GENTLY.stub('events', 'EventEmitter'),
FileStub = GENTLY.stub('./file');
-var formidable = require('formidable'),
+var formidable = require(common.lib + '/index'),
IncomingForm = formidable.IncomingForm,
events = require('events'),
fs = require('fs'),
View
4 test/simple/test-multipart-parser.js
@@ -1,5 +1,5 @@
-require('../common');
-var multipartParser = require('formidable/multipart_parser'),
+var common = require('../common');
+var multipartParser = require(common.lib + '/multipart_parser'),
MultipartParser = multipartParser.MultipartParser,
events = require('events'),
Buffer = require('buffer').Buffer,
View
4 test/simple/test-querystring-parser.js
@@ -1,5 +1,5 @@
-require('../common');
-var QuerystringParser = require('formidable/querystring_parser').QuerystringParser,
+var common = require('../common');
+var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser,
Buffer = require('buffer').Buffer,
gently,
parser;
View
6 test/system/test-multi-video-upload.js
@@ -1,10 +1,10 @@
-require('../common');
+var common = require('../common');
var BOUNDARY = '---------------------------10102754414578508781458777923',
FIXTURE = TEST_FIXTURES+'/multi_video.upload',
fs = require('fs'),
- util = require('formidable/util'),
+ util = require(common.lib + '/util'),
http = require('http'),
- formidable = require('formidable'),
+ formidable = require(common.lib + '/index'),
server = http.createServer();
server.on('request', function(req, res) {
Please sign in to comment.
Something went wrong with that request. Please try again.