1
0
Fork 0

Fix windows test for Foxx socket request URL (#7536)

* Fix windows test for Foxx socket request URL

* Fix unix abs path test
This commit is contained in:
Alan Plum 2018-12-10 15:44:00 +01:00 committed by Michael Hackstein
parent 2e680a7f9b
commit c74583b089
2 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,10 @@
// //////////////////////////////////////////////////////////////////////////////
const parseUrl = require('url').parse;
const {join: joinPath, resolve: resolvePath} = require('path').posix;
const {
posix: {join: joinPath},
resolve: resolvePath
} = require('path');
const typeIs = require('type-is').is;
const accepts = require('accepts');
const parseRange = require('range-parser');

View File

@ -543,17 +543,20 @@ describe('SyntheticRequest', function () {
);
});
it('correctly handles unix sockets', function () {
const socketPath = require('internal').platform.substr(0, 3) === 'win'
? "C:\\tmp\\arangod.sock"
: "/tmp/arangod.sock";
const rawReq = createNativeRequest({
db: 'bananas',
mount: '/foxx',
path: '/some/place/special',
search: '?a=1&b=2',
protocol: 'https',
socketPath: '/tmp/arangod.sock'
socketPath
});
const req = new SyntheticRequest(rawReq, {mount: '/foxx'});
expect(req.makeAbsolute('../another/place')).to.equal(
'https://unix:/tmp/arangod.sock:/_db/bananas/another/place'
`https://unix:${socketPath}:/_db/bananas/another/place`
);
});
it('correctly handles relative unix sockets', function () {