Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add an initial test - really doesn't do the tests we need though

  • Loading branch information...
commit 1f3b9d4b4206e68e50d88249598029c490840a28 1 parent 8c4ec3f
@chilts authored
Showing with 56 additions and 0 deletions.
  1. +56 −0 test/winston-simpledb-test.js
View
56 test/winston-simpledb-test.js
@@ -0,0 +1,56 @@
+// --------------------------------------------------------------------------------------------------------------------
+//
+// winston-simpledb-test.js : tests for instances of the SimpleDB transport
+//
+// Author : Andrew Chilton
+// Web : http://www.chilts.org/blog/
+// Email : <chilts@appsattic.com>
+//
+// Copyright (c) : 2011 AppsAttic Ltd
+// Web : http://www.appsattic.com/
+// License : http://opensource.org/licenses/MIT
+//
+// --------------------------------------------------------------------------------------------------------------------
+
+var path = require('path'),
+ vows = require('vows'),
+ assert = require('assert'),
+ winston = require('winston'),
+ helpers = require('winston/test/helpers'),
+ amazon = require('awssum/lib/amazon/amazon'),
+ SimpleDB = require('../winston-simpledb').SimpleDB;
+
+function assertSimpleDB (transport) {
+ assert.instanceOf(transport, SimpleDB);
+ assert.isFunction(transport.log);
+};
+
+var options = {
+ accessKeyId : '...',
+ secretAccessKey : '...',
+ awsAccountId : '...',
+ domainName : '...',
+ region : amazon.US_EAST_1,
+ itemName : 'uuid',
+};
+
+var transport = new SimpleDB(options);
+
+vows.describe('winston-simpledb').addBatch({
+ "An instance of the SimpleDB Transport": {
+ "should have the proper methods defined": function () {
+ assertSimpleDB(transport);
+ },
+// HELP: I tried to do this (similar to the winston-riak module) but it just doesn't work - any help appreciated?
+// "the log() method": helpers.testNpmLevels(
+// transport,
+// "should log msgs to sdb",
+// function (ign, err, meta, result) {
+// assert.isTrue(!err);
+// assert.isObject(result);
+// }
+// ),
+ }
+}).export(module);
+
+// --------------------------------------------------------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.