Update eslint to loopback config v5

Notable side-effects:
 - loopback no longer exports "caller" and "arguments" properties
 - kv-memory connector is now properly added to the connector registry
 - the file "test/support.js" was finally removed
This commit is contained in:
Loay 2016-11-15 16:46:23 -05:00 committed by Miroslav Bajtoš
parent ef0478cc97
commit 06cb481c3f
113 changed files with 1275 additions and 1151 deletions

View File

@ -5,6 +5,7 @@
"ignoreComments": true,
"ignoreUrls": true,
"ignorePattern": "^\\s*var\\s.+=\\s*(require\\s*\\()|(/)"
}]
}],
"no-unused-expressions": "off",
}
}

View File

@ -4,6 +4,7 @@
// License text available at https://opensource.org/licenses/MIT
/*global module:false*/
'use strict';
module.exports = function(grunt) {
// Do not report warnings from unit-tests exercising deprecated paths
process.env.NO_DEPRECATION = 'loopback';

View File

@ -7,6 +7,7 @@
* Module Dependencies.
*/
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../lib/loopback');
var assert = require('assert');

View File

@ -3,13 +3,11 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/*!
Schema ACL options
Object level permissions, for example, an album owned by a user
Factors to be authorized against:
* model name: Album
* model instance properties: userId of the album, friends, shared
* methods
@ -21,19 +19,15 @@
** none
** everyone
** relations: owner/friend/granted
Class level permissions, for example, Album
* model name: Album
* methods
URL/Route level permissions
* url pattern
* application id
* ip addresses
* http headers
Map to oAuth 2.0 scopes
*/
var g = require('../../lib/globalize');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var utils = require('../../lib/utils');
@ -70,18 +71,6 @@ function generateKey(hmacKey, algorithm, encoding) {
*/
module.exports = function(Application) {
// Workaround for https://github.com/strongloop/loopback/issues/292
Application.definition.rawProperties.created.default =
Application.definition.properties.created.default = function() {
return new Date();
};
// Workaround for https://github.com/strongloop/loopback/issues/292
Application.definition.rawProperties.modified.default =
Application.definition.properties.modified.default = function() {
return new Date();
};
/*!
* A hook to generate keys before creation
* @param next

View File

@ -118,7 +118,13 @@
"description": "Status of the application, production/sandbox/disabled"
},
"created": "date",
"modified": "date"
"created": {
"type": "date",
"defaultFn": "now"
},
"modified": {
"type": "date",
"defaultFn": "now"
}
}
}

View File

@ -7,6 +7,7 @@
* Module Dependencies.
*/
'use strict';
var g = require('../../lib/globalize');
var PersistedModel = require('../../lib/loopback').PersistedModel;
var loopback = require('../../lib/loopback');

View File

@ -7,6 +7,7 @@
* Module Dependencies.
*/
'use strict';
var assert = require('assert');
/**

View File

@ -3,6 +3,9 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
/**
* Email model. Extends LoopBack base [Model](#model-new-model).
* @property {String} to Email addressee. Required.
@ -15,8 +18,6 @@
* @inherits {Model}
*/
var g = require('../../lib/globalize');
module.exports = function(Email) {
/**
* Send an email with the given `options`.

View File

@ -1,3 +1,9 @@
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Node module: loopback
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
/**

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../lib/loopback');
/**

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../lib/loopback');
var debug = require('debug')('loopback:security:role');
var assert = require('assert');
@ -20,18 +21,6 @@ assert(RoleMapping, 'RoleMapping model must be defined before Role model');
* @header Role object
*/
module.exports = function(Role) {
// Workaround for https://github.com/strongloop/loopback/issues/292
Role.definition.rawProperties.created.default =
Role.definition.properties.created.default = function() {
return new Date();
};
// Workaround for https://github.com/strongloop/loopback/issues/292
Role.definition.rawProperties.modified.default =
Role.definition.properties.modified.default = function() {
return new Date();
};
Role.resolveRelatedModels = function() {
if (!this.userModel) {
var reg = this.registry;

View File

@ -13,8 +13,12 @@
},
"description": "string",
"created": "date",
"modified": "date"
"created": {
"defaultFn": "now"
},
"modified": {
"defaultFn": "now"
}
},
"relations": {
"principals": {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../../lib/loopback');

View File

@ -7,6 +7,7 @@
* Module Dependencies.
*/
'use strict';
var g = require('../../lib/globalize');
var isEmail = require('isemail');
var loopback = require('../../lib/loopback');
@ -431,7 +432,8 @@ module.exports = function(User) {
options.templateFn = options.templateFn || createVerificationEmailBody;
// Email model
var Email = options.mailer || this.constructor.email || registry.getModelByType(loopback.Email);
var Email =
options.mailer || this.constructor.email || registry.getModelByType(loopback.Email);
// Set a default token generation function if one is not provided
var tokenGenerator = options.generateVerificationToken || User.generateVerificationToken;
@ -493,7 +495,6 @@ module.exports = function(User) {
cb(null, body);
}
/**
* A default verification token generator which accepts the user the token is
* being generated for and a callback function to indicate completion.

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../');
var client = loopback();

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../');
var CartItem = exports.CartItem = loopback.PersistedModel.extend('CartItem', {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../');
var server = module.exports = loopback();
var CartItem = require('./models').CartItem;

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../');
var app = loopback();

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../');
var app = loopback();

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
var models = require('../../lib/models');
var loopback = require('../../');
@ -16,7 +17,6 @@ var Application = models.Application(dataSource);
app.model(Application);
var data = {pushSettings: [
{'platform': 'apns',
'apns': {
@ -40,7 +40,6 @@ Application.create(data, function(err, data) {
g.log('Created: %s', data.toObject());
});
Application.register('rfeng', 'MyApp', {description: g.f('My first mobile application')},
function(err, result) {
console.log(result.toObject());

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../');
var app = loopback();
var db = app.dataSource('db', {connector: 'memory'});

View File

@ -3,13 +3,13 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../');
var app = loopback();
app.use(loopback.rest());
var dataSource = app.dataSource('db', {adapter: 'memory'});
var Color = dataSource.define('color', {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/**
* loopback ~ public api
*/

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('./loopback');
var debug = require('debug')('loopback:security:access-context');

View File

@ -7,6 +7,7 @@
* Module dependencies.
*/
'use strict';
var g = require('./globalize');
var DataSource = require('loopback-datasource-juggler').DataSource;
var Registry = require('./registry');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var EventEmitter = require('events').EventEmitter;
var util = require('util');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(registry) {
// NOTE(bajtos) we must use static require() due to browserify limitations

View File

@ -7,6 +7,7 @@
* Expose `Connector`.
*/
'use strict';
module.exports = Connector;
/**

View File

@ -7,6 +7,7 @@
* Dependencies.
*/
'use strict';
var g = require('../globalize');
var mailer = require('nodemailer');
var assert = require('assert');

View File

@ -7,6 +7,7 @@
* Expose `Memory`.
*/
'use strict';
module.exports = Memory;
/**

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('./globalize');
var juggler = require('loopback-datasource-juggler');
var remoting = require('strong-remoting');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var path = require('path');
var SG = require('strong-globalize');

View File

@ -7,6 +7,7 @@
* Module dependencies.
*/
'use strict';
var express = require('express');
var loopbackExpress = require('./server-app');
var proto = require('./application');
@ -93,6 +94,8 @@ function createApplication(options) {
// and thus browserify can process them (include connectors in the bundle)
app.connector('memory', loopback.Memory);
app.connector('remote', loopback.Remote);
app.connector('kv-memory',
require('loopback-datasource-juggler/lib/connectors/kv-memory'));
if (loopback.localRegistry || options && options.localRegistry === true) {
// setup the app registry

View File

@ -6,7 +6,7 @@
/*!
* Module Dependencies.
*/
'use strict';
var g = require('./globalize');
var assert = require('assert');
var RemoteObjects = require('strong-remoting');

View File

@ -6,7 +6,7 @@
/*!
* Module Dependencies.
*/
'use strict';
var g = require('./globalize');
var runtime = require('./runtime');
var assert = require('assert');
@ -763,7 +763,6 @@ module.exports = function(registry) {
setRemoting(PersistedModel, 'replaceById', replaceByIdOptions);
setRemoting(PersistedModel, 'find', {
description: 'Find all instances of the model matched by filter from the data source.',
accessType: 'READ',

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('./globalize');
var assert = require('assert');
var extend = require('util')._extend;

View File

@ -9,6 +9,7 @@
* @private
*/
'use strict';
var runtime = exports;
/**

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('./globalize');
var assert = require('assert');
var express = require('express');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
exports.createPromiseCallback = createPromiseCallback;
var Promise = require('bluebird');

View File

@ -67,7 +67,7 @@
"chai": "^3.5.0",
"cookie-parser": "^1.3.4",
"es5-shim": "^4.1.0",
"eslint-config-loopback": "^1.0.0",
"eslint-config-loopback": "^5.0.0",
"express-session": "^1.14.0",
"grunt": "^1.0.1",
"grunt-browserify": "^5.0.0",

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var g = require('../../lib/globalize');
module.exports = function() {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(options) {
throw new Error('loopback.errorHandler is no longer available.' +
' Please use the module "strong-error-handler" instead.');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var favicon = require('serve-favicon');
var path = require('path');

View File

@ -7,6 +7,7 @@
* Module dependencies.
*/
'use strict';
var g = require('../../lib/globalize');
var loopback = require('../../lib/loopback');
var async = require('async');

View File

@ -13,4 +13,5 @@
* for the full list of available options.
* @header loopback.static(root, [options])
*/
'use strict';
module.exports = require('express').static;

View File

@ -7,6 +7,7 @@
* Export the middleware.
*/
'use strict';
module.exports = status;
/**

View File

@ -7,6 +7,7 @@
* Module dependencies.
*/
'use strict';
var loopback = require('../../lib/loopback');
var assert = require('assert');
var debug = require('debug')('loopback:middleware:token');

View File

@ -8,6 +8,7 @@
* See discussion in Connect pull request #954 for more details
* https://github.com/senchalabs/connect/pull/954.
*/
'use strict';
module.exports = urlNotFound;
/**

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../');
var lt = require('./helpers/loopback-testing-helper');
var path = require('path');

View File

@ -3,12 +3,17 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var expect = require('chai').expect;
var cookieParser = require('cookie-parser');
var LoopBackContext = require('loopback-context');
var contextMiddleware = require('loopback-context').perRequest;
var loopback = require('../');
var extend = require('util')._extend;
var session = require('express-session');
var request = require('supertest');
var app = loopback();
var Token = loopback.AccessToken.extend('MyToken');
var ds = loopback.createDataSource({connector: loopback.Memory});
@ -279,7 +284,7 @@ describe('loopback.token(options)', function() {
' when enableDoubkecheck is true',
function(done) {
var token = this.token;
var app = loopback();
app.use(function(req, res, next) {
req.accessToken = null;
next();
@ -314,7 +319,7 @@ describe('loopback.token(options)', function() {
function(done) {
var token = this.token;
var tokenStub = {id: 'stub id'};
var app = loopback();
app.use(function(req, res, next) {
req.accessToken = tokenStub;

View File

@ -3,15 +3,20 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../index');
var Scope = loopback.Scope;
var ACL = loopback.ACL;
var request = require('supertest');
var Role = loopback.Role;
var RoleMapping = loopback.RoleMapping;
var User = loopback.User;
var testModel;
// Speed up the password hashing algorithm for tests
User.settings.saltWorkFactor = 4;
function checkResult(err, result) {
// console.log(err, result);
assert(!err);

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var async = require('async');
var path = require('path');
@ -14,6 +16,7 @@ var PersistedModel = loopback.PersistedModel;
var describe = require('./util/describe');
var expect = require('chai').expect;
var it = require('./util/it');
var request = require('supertest');
describe('app', function() {
var app;

View File

@ -3,6 +3,10 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var expect = require('chai').expect;
var loopback = require('../');
describe('PersistedModel.createChangeStream()', function() {
describe('configured to source changes locally', function() {
before(function() {

View File

@ -3,8 +3,11 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var async = require('async');
var expect = require('chai').expect;
var loopback = require('../');
var Change, TestModel;

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var async = require('async');
var loopback = require('../');
var expect = require('chai').expect;

View File

@ -3,6 +3,10 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../');
describe('DataSource', function() {
var memory;
@ -116,3 +120,19 @@ describe('DataSource', function() {
});
});
});
var assertValidDataSource = function(dataSource) {
// has methods
assert.isFunc(dataSource, 'createModel');
assert.isFunc(dataSource, 'discoverModelDefinitions');
assert.isFunc(dataSource, 'discoverSchema');
assert.isFunc(dataSource, 'enableRemote');
assert.isFunc(dataSource, 'disableRemote');
assert.isFunc(dataSource, 'defineOperation');
assert.isFunc(dataSource, 'operations');
};
assert.isFunc = function(obj, name) {
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');
assert(typeof obj[name] === 'function', name + ' is not a function');
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var path = require('path');
var loopback = require('../../');
var models = require('../fixtures/e2e/models');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var path = require('path');
var loopback = require('../../');
var models = require('../fixtures/e2e/models');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../');
var MyEmail;
var assert = require('assert');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../');
var app;
var assert = require('assert');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../../..');
var boot = require('loopback-boot');
var app = module.exports = loopback({

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../../../index');
var PersistedModel = loopback.PersistedModel;

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../../../index');
var app = module.exports = loopback({localRegistry: true});
var models = require('./models');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Todo) {
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('loopback-boot');
var loopback = require('../../../../../index');

View File

@ -3,4 +3,5 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
process.loadedFooJS = true;

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Bar) {
process.loadedBarJS = true;
};

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../../../index');
var boot = require('loopback-boot');
var app = module.exports = loopback({localRegistry: true});

View File

@ -14,5 +14,6 @@
"principalType": "ROLE",
"principalId": "$owner"
}
]
],
"saltWorkFactor": 4
}

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../../../../index');
var boot = require('loopback-boot');
var app = module.exports = loopback({

View File

@ -3,6 +3,11 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../');
var GeoPoint = loopback.GeoPoint;
describe('GeoPoint', function() {
describe('geoPoint.distanceTo(geoPoint, options)', function() {
it('Get the distance to another `GeoPoint`', function() {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var _describe = {};
var _it = {};
var _beforeEach = {};

View File

@ -3,7 +3,10 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../');
var request = require('supertest');
describe('hidden properties', function() {
beforeEach(function(done) {

View File

@ -3,7 +3,11 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var expect = require('chai').expect;
var loopback = require('../');
var net = require('net');
describe('loopback application', function() {
it('pauses request stream during authentication', function(done) {
// This test reproduces the issue reported in

View File

@ -6,6 +6,7 @@
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
'use strict';
module.exports = function(config) {
config.set({
// enable / disable watching file and executing tests whenever any file changes

View File

@ -1,3 +1,4 @@
'use strict';
var expect = require('chai').expect;
var http = require('http');
var loopback = require('..');

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var it = require('./util/it');
var describe = require('./util/describe');
var Domain = require('domain');
@ -61,8 +62,6 @@ describe('loopback', function() {
'User',
'ValidationError',
'application',
'arguments',
'caller',
'configureModel',
'context',
'createContext',

View File

@ -3,6 +3,10 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var loopback = require('../');
describe('Memory Connector', function() {
it('Create a model using the memory connector', function(done) {
// use the built in memory function

View File

@ -1 +0,0 @@
--require ./test/support.js

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require(('../'));
var assert = require('assert');
var Application = loopback.Application;

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var async = require('async');
var chai = require('chai');
var describe = require('./util/describe');
@ -11,6 +13,9 @@ var ACL = loopback.ACL;
var defineModelTestsWithDataSource = require('./util/model-tests');
var PersistedModel = loopback.PersistedModel;
var sinonChai = require('sinon-chai');
var Promise = require('bluebird');
var TaskEmitter = require('strong-task-emitter');
var request = require('supertest');
var expect = chai.expect;
chai.use(sinonChai);

View File

@ -3,6 +3,11 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var expect = require('chai').expect;
var loopback = require('../');
describe('Registry', function() {
describe('createModel', function() {
it('should throw error upon extending non-exist base model', function() {

View File

@ -3,6 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('../');
var lt = require('./helpers/loopback-testing-helper');
var path = require('path');

Some files were not shown because too many files have changed in this diff Show More