Skip to content

Commit

Permalink
Simplify exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Feb 10, 2016
1 parent c9502ce commit 20846b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
16 changes: 3 additions & 13 deletions lib/index.js
@@ -1,21 +1,11 @@
/**
* Module dependencies.
*/
// Load modules.
var Strategy = require('./strategy')
, InternalOAuthError = require('./errors/internaloautherror');


/**
* Expose `Strategy` directly from package.
*/
// Expose Strategy.
exports = module.exports = Strategy;

/**
* Export constructors.
*/
// Exports.
exports.Strategy = Strategy;

/**
* Export errors.
*/
exports.InternalOAuthError = InternalOAuthError;
6 changes: 5 additions & 1 deletion test/package.test.js
Expand Up @@ -2,11 +2,15 @@ var strategy = require('..');

describe('passport-oauth', function() {

it('should export Strategy constructor directly from package', function() {
it('should export Strategy constructor as module', function() {
expect(strategy).to.be.a('function');
expect(strategy).to.equal(strategy.Strategy);
});

it('should export Strategy constructor', function() {
expect(strategy.Strategy).to.be.a('function');
});

it('should export Error constructors', function() {
expect(strategy.InternalOAuthError).to.be.a('function');
});
Expand Down

0 comments on commit 20846b4

Please sign in to comment.