commit
fc9b9806c8
|
@ -8,6 +8,8 @@
|
|||
}],
|
||||
// NOTE(bajtos) we should eventually remove this override
|
||||
// and fix all of those 100+ violations
|
||||
"one-var": "off"
|
||||
"one-var": "off",
|
||||
"no-unused-expressions": "off",
|
||||
"strict": ["warn", "global"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var DataSource = require('../../loopback-datasource-juggler').DataSource;
|
||||
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
|
||||
var introspectType = require('../lib/introspection')(ModelBuilder);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
|
||||
var modelBuilder = new ModelBuilder();
|
||||
// define models
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var DataSource = require('../../loopback-datasource-juggler').DataSource;
|
||||
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
|
||||
var ds = new DataSource('memory');
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var jdb = require('../index');
|
||||
|
||||
var User, Post, Passport, City, Street, Building;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var path = require('path'),
|
||||
fs = require('fs'),
|
||||
DataSource = require('../lib/datasource').DataSource;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
|
||||
var modelBuilder = new ModelBuilder();
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var DataSource = require('../index').DataSource;
|
||||
var ds = new DataSource('memory');
|
||||
|
||||
|
|
1
index.js
1
index.js
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var SG = require('strong-globalize');
|
||||
SG.SetRootDir(__dirname);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
// A lightweight alternative to "depd" that works in the browser
|
||||
module.exports = function depd(namespace) {
|
||||
var warned = {};
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var g = require('strong-globalize')();
|
||||
var util = require('util');
|
||||
var Connector = require('loopback-connector').Connector;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var g = require('strong-globalize')();
|
||||
var util = require('util');
|
||||
var Connector = require('loopback-connector').Connector;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
|
|
@ -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');
|
||||
|
||||
/*!
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var deprecated = require('depd')('loopback-datasource-juggler');
|
||||
var g = require('strong-globalize')();
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
var g = require('strong-globalize')();
|
||||
var utils = require('./utils');
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports.buildOneToOneIdentityMapWithOrigKeys = buildOneToOneIdentityMapWithOrigKeys;
|
||||
module.exports.buildOneToManyIdentityMapWithOrigKeys = buildOneToManyIdentityMapWithOrigKeys;
|
||||
module.exports.join = join;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function getIntrospector(ModelBuilder) {
|
||||
function introspectType(value) {
|
||||
// Unknown type, using Any
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var g = require('strong-globalize')();
|
||||
var util = require('util');
|
||||
var Any = require('./types').Types.Any;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var debug = require('debug')('loopback:mixin');
|
||||
var assert = require('assert');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var assert = require('assert');
|
||||
var util = require('util');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
var utils = require('./utils');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
/*!
|
||||
* Dependencies
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var i8n = require('inflection');
|
||||
var utils = require('./utils');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var g = require('strong-globalize')();
|
||||
var debug = require('debug')('loopback:connector:transaction');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var Types = {};
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
exports.safeRequire = safeRequire;
|
||||
exports.fieldsToArray = fieldsToArray;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var g = require('strong-globalize')();
|
||||
var util = require('util');
|
||||
var extend = util._extend;
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
],
|
||||
"devDependencies": {
|
||||
"async-iterators": "^0.2.2",
|
||||
"eslint": "^2.5.3",
|
||||
"eslint-config-loopback": "^2.0.0",
|
||||
"eslint": "^2.13.1",
|
||||
"eslint-config-loopback": "^4.0.0",
|
||||
"mocha": "^2.1.0",
|
||||
"should": "^8.0.2"
|
||||
},
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* Describe context objects of operation hooks in comprehensive HTML table.
|
||||
* Usage:
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var ModelBuilder = require('../').ModelBuilder;
|
||||
var should = require('./init');
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
var async = require('async');
|
||||
var db, User;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
require('./datatype.test.js');
|
||||
require('./basic-querying.test.js');
|
||||
require('./manipulation.test.js');
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var Schema = require('../index').Schema;
|
||||
var Text = Schema.Text;
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
var async = require('async');
|
||||
var db, User, options, filter;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
var DataSource = require('../lib/datasource.js').DataSource;
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
|
||||
var db, Model;
|
||||
|
@ -12,7 +14,7 @@ describe('datatypes', function() {
|
|||
|
||||
before(function(done) {
|
||||
db = getSchema();
|
||||
Nested = db.define('Nested', {});
|
||||
var Nested = db.define('Nested', {});
|
||||
|
||||
Model = db.define('Model', {
|
||||
str: String,
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
var async = require('async');
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
|
||||
var db = getSchema();
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var jdb = require('../');
|
||||
var DataSource = jdb.DataSource;
|
||||
var should = require('./init.js');
|
||||
|
@ -436,7 +438,7 @@ describe('discoverModelProperties', function() {
|
|||
|
||||
describe('discoverPrimaryKeys', function() {
|
||||
var ds;
|
||||
var modelProperties;
|
||||
var modelProperties, primaryKeys;
|
||||
before(function() {
|
||||
ds = new DataSource({connector: 'memory'});
|
||||
|
||||
|
@ -496,7 +498,7 @@ describe('discoverPrimaryKeys', function() {
|
|||
|
||||
describe('discoverForeignKeys', function() {
|
||||
var ds;
|
||||
var modelProperties;
|
||||
var modelProperties, foreignKeys;
|
||||
before(function() {
|
||||
ds = new DataSource({connector: 'memory'});
|
||||
|
||||
|
@ -553,7 +555,7 @@ describe('discoverForeignKeys', function() {
|
|||
|
||||
describe('discoverExportedForeignKeys', function() {
|
||||
var ds;
|
||||
var modelProperties;
|
||||
var modelProperties, exportedForeignKeys;
|
||||
before(function() {
|
||||
ds = new DataSource({connector: 'memory'});
|
||||
|
||||
|
@ -610,9 +612,9 @@ describe('discoverExportedForeignKeys', function() {
|
|||
});
|
||||
|
||||
describe('Mock connector', function() {
|
||||
mockConnectors = require('./mock-connectors');
|
||||
var mockConnectors = require('./mock-connectors');
|
||||
describe('customFieldSettings', function() {
|
||||
ds = new DataSource(mockConnectors.customFieldSettings);
|
||||
var ds = new DataSource(mockConnectors.customFieldSettings);
|
||||
|
||||
it('should be present in discoverSchemas', function(done) {
|
||||
ds.discoverSchemas('person', function(err, schemas) {
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
/*global describe,it*/
|
||||
/*jshint expr:true */
|
||||
|
||||
'use strict';
|
||||
|
||||
require('should');
|
||||
|
||||
var GeoPoint = require('../lib/geo').GeoPoint;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
var traverse = require('traverse');
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Node module: loopback-datasource-juggler
|
||||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
'use strict';
|
||||
|
||||
module.exports = HookMonitor;
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var lastId = 0;
|
||||
|
||||
exports.next = function() {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
// This test written in mocha+should.js
|
||||
var should = require('./init.js');
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var should = require('./init.js');
|
||||
var async = require('async');
|
||||
var assert = require('assert');
|
||||
|
@ -427,7 +429,7 @@ describe('include', function() {
|
|||
user.name.should.equal('User A');
|
||||
user.age.should.equal(21);
|
||||
user.id.should.equal(1);
|
||||
profile = user.profile();
|
||||
var profile = user.profile();
|
||||
profile.profileName.should.equal('Profile A');
|
||||
profile.userId.should.equal(1);
|
||||
profile.id.should.equal(1);
|
||||
|
@ -450,9 +452,9 @@ describe('include', function() {
|
|||
});
|
||||
|
||||
it('works when hasManyThrough is called', function(done) {
|
||||
Physician = db.define('Physician', { name: String });
|
||||
Patient = db.define('Patient', { name: String });
|
||||
Appointment = db.define('Appointment', {
|
||||
var Physician = db.define('Physician', {name: String});
|
||||
var Patient = db.define('Patient', {name: String});
|
||||
var Appointment = db.define('Appointment', {
|
||||
date: {
|
||||
type: Date,
|
||||
default: function() {
|
||||
|
@ -460,7 +462,7 @@ describe('include', function() {
|
|||
},
|
||||
},
|
||||
});
|
||||
Address = db.define('Address', { name: String });
|
||||
var Address = db.define('Address', {name: String});
|
||||
|
||||
Physician.hasMany(Patient, {through: Appointment});
|
||||
Patient.hasMany(Physician, {through: Appointment});
|
||||
|
@ -502,7 +504,7 @@ describe('include', function() {
|
|||
profile.profileName.should.equal('Profile A');
|
||||
profile.userId.should.equal(1);
|
||||
profile.id.should.equal(1);
|
||||
user = profile.user();
|
||||
var user = profile.user();
|
||||
user.name.should.equal('User A');
|
||||
user.age.should.equal(21);
|
||||
user.id.should.equal(1);
|
||||
|
|
|
@ -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 should = require('should');
|
||||
|
||||
|
|
|
@ -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 = require('should');
|
||||
|
||||
/*
|
||||
|
|
|
@ -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 ModelBuilder = require('..').ModelBuilder;
|
||||
var DataSource = require('../').DataSource;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
|
||||
var Schema = require('../').Schema;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
var kvMemory = require('../lib/connectors/kv-memory');
|
||||
var DataSource = require('..').DataSource;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
|
||||
var loopbackData = require('../');
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var assert = require('assert');
|
||||
var async = require('async');
|
||||
|
@ -581,6 +582,7 @@ describe('DataSource define model', function() {
|
|||
|
||||
it('should update the instance with unknown properties', function(done) {
|
||||
var ds = new DataSource('memory');// define models
|
||||
var Post;
|
||||
Post = ds.define('Post', {
|
||||
title: {type: String, length: 255, index: true},
|
||||
content: {type: String},
|
||||
|
@ -1317,7 +1319,7 @@ describe('Model with scopes', function() {
|
|||
});
|
||||
|
||||
describe('DataAccessObject', function() {
|
||||
var ds, model, where, error;
|
||||
var ds, model, where, error, filter;
|
||||
|
||||
before(function() {
|
||||
ds = new DataSource('memory');
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var async = require('async');
|
||||
var should = require('./init.js');
|
||||
|
||||
|
@ -34,6 +35,8 @@ describe('manipulation', function() {
|
|||
// to reproduce problems related to properties with dynamic setters
|
||||
// For the purpose of the tests, we use a counter instead of a hash fn.
|
||||
var StubUser;
|
||||
var stubPasswordCounter;
|
||||
|
||||
before(function setupStubUserModel(done) {
|
||||
StubUser = db.createModel('StubUser', {password: String}, {forceId: true});
|
||||
StubUser.setter.password = function(plain) {
|
||||
|
@ -62,6 +65,7 @@ describe('manipulation', function() {
|
|||
});
|
||||
|
||||
describe('forceId', function() {
|
||||
var TestForceId;
|
||||
before(function(done) {
|
||||
TestForceId = db.define('TestForceId');
|
||||
db.automigrate('TestForceId', done);
|
||||
|
@ -1253,7 +1257,7 @@ describe('manipulation', function() {
|
|||
});
|
||||
|
||||
it('fails the upsertWithWhere operation when data object is empty', function(done) {
|
||||
options = {};
|
||||
var options = {};
|
||||
Person.upsertWithWhere({name: 'John Lennon'}, {}, options,
|
||||
function(err) {
|
||||
err.message.should.equal('data object cannot be empty!');
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
var jdb = require('../');
|
||||
var DataSource = jdb.DataSource;
|
||||
var path = require('path');
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
|
||||
var jdb = require('../');
|
||||
|
|
|
@ -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 = {
|
||||
|
||||
// connector which uses custom field settings
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var assert = require('assert');
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
var contextTestHelpers = require('../helpers/context-test-helpers');
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var Promise = require('bluebird');
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
|
@ -46,7 +48,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
|
|||
}
|
||||
});
|
||||
|
||||
var ownerInstance, existingInstance;
|
||||
var ownerInstance, existingInstance, existingItem, existingItem;
|
||||
beforeEach(function setupData() {
|
||||
return Owner.create({})
|
||||
.then(function(inst) {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var Promise = require('bluebird');
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
var contextTestHelpers = require('../helpers/context-test-helpers');
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
var contextTestHelpers = require('../helpers/context-test-helpers');
|
||||
|
@ -45,7 +47,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
|
|||
}
|
||||
});
|
||||
|
||||
var ownerInstance, existingInstance;
|
||||
var ownerInstance, existingInstance, existingItem;
|
||||
beforeEach(function setupData() {
|
||||
return Owner.create({})
|
||||
.then(function(inst) {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
|
||||
var ValidationError = require('../..').ValidationError;
|
||||
|
||||
var contextTestHelpers = require('../helpers/context-test-helpers');
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
var debug = require('debug')('test');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var async = require('async');
|
||||
var should = require('./init.js');
|
||||
var db, User, options, ModelWithForceId, whereCount = 0;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
var ValidationError = require('../').ValidationError;
|
||||
|
||||
var contextTestHelpers = require('./helpers/context-test-helpers');
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var jdb = require('../');
|
||||
var DataSource = jdb.DataSource;
|
||||
|
@ -3826,7 +3827,7 @@ describe('relations', function() {
|
|||
// This test spefically uses the Memory connector
|
||||
// in order to test the use of the auto-generated
|
||||
// id, in the sequence of the related model.
|
||||
|
||||
var Passport;
|
||||
before(function() {
|
||||
db = getMemoryDataSource();
|
||||
Person = db.define('Person', {name: String});
|
||||
|
@ -3878,7 +3879,7 @@ describe('relations', function() {
|
|||
});
|
||||
|
||||
describe('embedsOne - generated id', function() {
|
||||
|
||||
var Passport;
|
||||
before(function() {
|
||||
tmp = getTransientDataSource();
|
||||
// db = getSchema();
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
|
||||
var db = getSchema(), slave = getSchema(), Model, SlaveModel;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
|
||||
var db, Railway, Station;
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
}
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var group_name = false, EXT_EXP;
|
||||
function it(should, test_case) {
|
||||
check_external_exports();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
var jdb = require('../');
|
||||
var DataSource = jdb.DataSource;
|
||||
var assert = require('assert');
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// This file is licensed under the MIT License.
|
||||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var utils = require('../lib/utils');
|
||||
var fieldsToArray = utils.fieldsToArray;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
// License text available at https://opensource.org/licenses/MIT
|
||||
|
||||
// This test written in mocha+should.js
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var async = require('async');
|
||||
|
||||
|
|
Loading…
Reference in New Issue