Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request sintaxi#454 from jvandemo/feat/expose-middleware
Browse files Browse the repository at this point in the history
Expose middleware when Harp is used as library
  • Loading branch information
sintaxi committed Sep 10, 2015
2 parents d77ec85 + e7ed0d0 commit d6e2321
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ exports.pipeline = function(root){

exports.pkg = pkg

/**
* Export middleware
*
* Make sure middleware is accessible
* when using harp as a library
*
*/
exports.middleware = middleware;

/**
* Compile
Expand Down
15 changes: 15 additions & 0 deletions test/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var should = require("should")
var harp = require('../lib');
var middleware = require('../lib/middleware');

describe("harp as a library", function() {

it("should expose a mount function", function() {
should(harp.mount).be.type('function');
});

it("should expose the middleware", function() {
should(harp.middleware).be.equal(middleware);
});

});

0 comments on commit d6e2321

Please sign in to comment.