Skip to content

Commit

Permalink
fixes sending text only / stable release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkida committed Feb 28, 2016
1 parent 1cf380c commit 77355fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ Events

Updates
-------
* Stable Release - @v1.0.1 21:58 PDT Feb 27th, 2016
* Initial Release - 20:11 PDT Feb 27th, 2016
* Check back notice - 08:09 PDT Feb 27th, 2016
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class Transport { //jshint ignore:line
break;
}
}
if (!opts.text) {
opts.text = text;
}
req.write(JSON.stringify(opts));
req.end();
opts.text = null;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "winston-datadog",
"version": "1.0.0",
"version": "1.0.1",
"description": "Super light transport for logging Datadog events",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 13 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,20 @@ describe('Transport', () => {
});
logger.log('info', text, data);
});

it ('should be able to send text data', (done) => {
var text = 'Something really awesome.';
logger.once('DatadogResult', (res) => {
assert.equal(res.body.status, 'ok');
assert(res.body.event);
assert.equal(res.body.event.text, text);
done();
});
logger.log('info', text);
});


it ('should disable the receiver', function (done) {
it ('should disable the receiver', (done) => {
logger.once('DatadogResult', (res) => {
done(new Error('data receieved'));
});
Expand Down

0 comments on commit 77355fb

Please sign in to comment.