Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Read about the [features of LoopBack](https://github.com/strongloop/loopback/wik
A brief guide for [contributing to LoopBack projects](https://github.com/strongloop/loopback/wiki/How-To-Contribute).

[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8caf6b5cce4be4d13c01ea9aafc9f407 "githalytics.com")](http://githalytics.com/strongloop/loopback)

10 changes: 9 additions & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ app.docs = function (options) {
swagger(remotes, options);
}

/*!
/**
* Get a handler of the specified type from the handler cache.
*/

Expand All @@ -264,6 +264,14 @@ app.handler = function (type) {
return handler;
}

/**
* Clears handler of the specified type from the handler cache.
*/

app.clearHandlerCache = function (type) {
this._handlers[type] = undefined;
}

/**
* An object to store dataSource instances.
*/
Expand Down
8 changes: 8 additions & 0 deletions test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ describe('app', function() {
});
});

describe('app.clearHandlerCache(type)', function() {
it('clears handler of given type from cache', function() {
var restHandler = app.handler('rest');
app.clearHandlerCache('rest');
expect(restHandler).to.not.equal(app.handler('rest'));
});
});

describe('app.boot([options])', function () {
beforeEach(function () {
app.boot({
Expand Down