Merge pull request #788 from strongloop/feature/fix-loopback-express

Make sure loopback has all properties from express
This commit is contained in:
Raymond Feng 2014-11-11 15:50:57 -08:00
commit bc9076595c
2 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,8 @@
* Module dependencies. * Module dependencies.
*/ */
var express = require('./server-app'); var express = require('express');
var loopbackExpress = require('./server-app');
var proto = require('./application'); var proto = require('./application');
var fs = require('fs'); var fs = require('fs');
var ejs = require('ejs'); var ejs = require('ejs');
@ -52,7 +53,7 @@ loopback.mime = express.mime;
*/ */
function createApplication() { function createApplication() {
var app = express(); var app = loopbackExpress();
merge(app, proto); merge(app, proto);

View File

@ -359,6 +359,13 @@ describe('loopback', function() {
}); });
describe('loopback object', function() { describe('loopback object', function() {
it('inherits properties from express', function() {
var express = require('express');
for (var i in express) {
expect(loopback).to.have.property(i, express[i]);
}
});
it('exports all built-in models', function() { it('exports all built-in models', function() {
var expectedModelNames = [ var expectedModelNames = [
'Email', 'Email',