Permalink
Browse files

feat(tests): pass the server object to backend tests

Doing this enables functional testing of server emitted events.
  • Loading branch information...
1 parent da35361 commit 122bc686b9b45f9a9886f19a23b880d9a0291232 @philbooth philbooth committed Jul 9, 2015
Showing with 3 additions and 3 deletions.
  1. +3 −3 test/backend/remote.js
@@ -26,14 +26,14 @@ DB.connect(config)
server = dbServer.createServer(db)
var d = P.defer()
server.listen(config.port, config.hostname, function() {
- d.resolve()
+ d.resolve(server)
})
server.on('failure', function (d) { console.error(d.err.code, d.url)})
server.on('success', function (d) { console.log(d.method, d.url)})
return d.promise
})
- .then(function() {
- return backendTests.remote(config)
+ .then(function(server) {
+ return backendTests.remote(config, server)
})
.then(function() {
server.close()

0 comments on commit 122bc68

Please sign in to comment.