Skip to content

Commit

Permalink
Start mocking out API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
takkaria committed Dec 9, 2015
1 parent 7690a89 commit 8692ea5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,4 @@ var EmailTemplates = function (options) {
}
}

module.exports = function(options) {
return new EmailTemplates(options);
};
module.exports = EmailTemplates;
23 changes: 23 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var EmailTemplates = require('../');
var assert = require('assert');
var path = require('path');

describe('EmailTemplates', function() {
describe('constructor', function() {
it('should return an object');

it('should accept no arguments');

});

describe('render', function() {
it("should feed errors through callback (nonexistent templates)");

it("should feed errors through callback (malformed context)");

it("should respect the 'text' attribute'");

it("should look for templates in the specified location");

});
})
2 changes: 1 addition & 1 deletion test/test.js → test/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function attemptReadFile(path, encoding, cb) {
});
}

describe("swig-email-templates", function() {
describe("EmailTemplates output", function() {
var templatePath = path.resolve(__dirname, "templates");
var templates = new EmailTemplates({
root: templatePath,
Expand Down

0 comments on commit 8692ea5

Please sign in to comment.