Created
September 29, 2015 03:07
-
-
Save danielb2/daf20de4a61e36701db3 to your computer and use it in GitHub Desktop.
despite dependency setting, this fail to work in hapi 9.x and node 4.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.register = function (server, options, next) { | |
server.dependency(['oksdcsdcok']); | |
server.route({ | |
method: 'GET', | |
path: '/{url*}', | |
config: { | |
handler: { | |
proxy: { | |
host: 'www.google.com', | |
timeout: 123456, | |
passThrough: true, | |
rejectUnauthorized: false | |
} | |
} | |
} | |
}); | |
return next(); | |
}; | |
exports.register.attributes = { | |
name: 'sams', | |
version: '1.0.0' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load libraries | |
var Code = require('code'); | |
var Glue = require('glue'); | |
var Lab = require('lab'); | |
// Test shortcuts | |
var lab = exports.lab = Lab.script(); | |
var describe = lab.describe; | |
var it = lab.it; | |
var expect = Code.expect; | |
var internals = {}; | |
describe('with glue', function () { | |
it('fails to load dependency', function (done) { | |
var manifest = { | |
server: {}, | |
connections: [{ | |
port: 40180 | |
}], | |
plugins: { | |
'./plugin': {}, | |
h2o2: {}, | |
vision: {} | |
} | |
}; | |
Glue.compose(manifest, { relativeTo: __dirname }, function (err, server) { | |
if (err) { | |
return callback(err); | |
} | |
server.inject('/intl/en/about/', function (res) { | |
expect(res.statusCode).to.equal(200); | |
done(); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment