Skip to content

Commit f4bddc5

Browse files
committed
Making paths windows friendly.
1 parent f3eb628 commit f4bddc5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/integration/test-errors.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ var common = require('../common');
22
var assert = common.assert;
33
var FormData = require(common.dir.lib + '/form_data');
44
var fake = require('fake').create();
5+
var path = require('path');
56
var fs = require('fs');
67
var http = require('http');
78

@@ -66,16 +67,17 @@ var http = require('http');
6667
(function testStreamError() {
6768
var req;
6869
var form = new FormData();
69-
var path = '/why/u/no/exists';
70-
var src = fs.createReadStream(path);
70+
// make it windows friendly
71+
var fakePath = path.resolve('/why/u/no/exists');
72+
var src = fs.createReadStream(fakePath);
7173
var server = http.createServer();
7274
var addr = 'http://localhost:' + common.port;
7375

7476
form.append('fake-stream', src);
7577

7678
form.on('error', function(err) {
7779
assert.equal(err.code, 'ENOENT');
78-
assert.equal(err.path, path);
80+
assert.equal(err.path, fakePath);
7981
req.on('error', function() {});
8082
server.close();
8183
});

0 commit comments

Comments
 (0)