Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Oct 7, 2017
1 parent 852923e commit 6c24f72
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
4 changes: 1 addition & 3 deletions packages/hemera-opentracing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ function hemeraOpentracing(hemera, opts, done) {
}

const sampler = new Jaeger.RateLimitingSampler(opts.jaeger.maxTracesPerSecond)
const reporter = new Jaeger.RemoteReporter(
new UDPSender()
)
const reporter = new Jaeger.RemoteReporter(new UDPSender())
const tracer = new Jaeger.Tracer(opts.serviceName, reporter, sampler, opts)

hemera.on('serverPreRequest', function(ctx) {
Expand Down
62 changes: 33 additions & 29 deletions test/hemera/promise.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ describe('Promise', function() {
}
)

hemera.act(
{
topic: 'math',
cmd: 'add',
a: 1,
b: 2
},
(err, resp) => {
expect(err).not.to.be.exists()
return Promise.resolve(resp.result)
}
).then((result) => {
expect(result).to.be.equals(3)
hemera.close(done)
})
hemera
.act(
{
topic: 'math',
cmd: 'add',
a: 1,
b: 2
},
(err, resp) => {
expect(err).not.to.be.exists()
return Promise.resolve(resp.result)
}
)
.then(result => {
expect(result).to.be.equals(3)
hemera.close(done)
})
})
})

Expand All @@ -65,20 +67,22 @@ describe('Promise', function() {
}
)

hemera.act(
{
topic: 'math',
cmd: 'add',
a: 1,
b: 2
},
(err, resp) => {
return Promise.reject(err)
}
).catch((err) => {
expect(err).to.be.exists()
hemera.close(done)
})
hemera
.act(
{
topic: 'math',
cmd: 'add',
a: 1,
b: 2
},
(err, resp) => {
return Promise.reject(err)
}
)
.catch(err => {
expect(err).to.be.exists()
hemera.close(done)
})
})
})
})

0 comments on commit 6c24f72

Please sign in to comment.