loopback/test/error-handler.test.js

26 lines
761 B
JavaScript
Raw Normal View History

2016-05-03 22:50:21 +00:00
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var loopback = require('../');
var app;
var assert = require('assert');
var request = require('supertest');
2016-06-08 07:27:23 +00:00
var expect = require('chai').expect;
describe('loopback.errorHandler(options)', function() {
2016-06-08 07:27:23 +00:00
it('should throw a descriptive error', function(done) {
try {
//arrange
var app = loopback();
app.use(loopback.urlNotFound());
app.use(loopback.errorHandler({ log: false }));
} catch (e) {
expect(function() { loopback.errorHandler(); })
.to.throw(/no longer available.*strong-error-handler/);
done();
2016-06-08 07:27:23 +00:00
}
});
});