chore: update dependencies
This commit is contained in:
parent
c4ab39c4e0
commit
d598c3738a
|
@ -1,7 +1,7 @@
|
||||||
sudo: false
|
sudo: false
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "4"
|
|
||||||
- "6"
|
- "6"
|
||||||
- "7"
|
- "8"
|
||||||
|
- "10"
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@
|
||||||
"url": "https://github.com/strongloop/loopback-boot"
|
"url": "https://github.com/strongloop/loopback-boot"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0.0"
|
"node": ">=6"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha",
|
"test": "mocha",
|
||||||
"posttest": "npm run lint",
|
"posttest": "npm run lint",
|
||||||
"lint": "eslint ."
|
"lint": "eslint .",
|
||||||
|
"lint:fix": "eslint . --fix"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^4.2.3",
|
"browserify": "^4.2.3",
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
"coffee-script": "^1.10.0",
|
"coffeescript": "^2.3.1",
|
||||||
"coffeeify": "^2.0.1",
|
"coffeeify": "^2.0.1",
|
||||||
"dirty-chai": "^1.2.2",
|
"dirty-chai": "^1.2.2",
|
||||||
"eslint": "^3.19.0",
|
"eslint": "^3.19.0",
|
||||||
|
|
|
@ -68,40 +68,47 @@ describe('Bootstrapper', function() {
|
||||||
expect(instructions.application, 'application').to.be.an('object');
|
expect(instructions.application, 'application').to.be.an('object');
|
||||||
expect(instructions.tracker, 'instruction: tracker').to.eql('compile');
|
expect(instructions.tracker, 'instruction: tracker').to.eql('compile');
|
||||||
expect(context.executions.tracker, 'execution: tracker').to.eql('start');
|
expect(context.executions.tracker, 'execution: tracker').to.eql('start');
|
||||||
expect(process.bootFlags, 'process: bootFlags').to.eql(['barLoaded',
|
expect(process.bootFlags, 'process: bootFlags').to.eql([
|
||||||
|
'barLoaded',
|
||||||
'barSyncLoaded',
|
'barSyncLoaded',
|
||||||
'fooLoaded',
|
'fooLoaded',
|
||||||
|
'promiseLoaded',
|
||||||
|
'thenableLoaded',
|
||||||
'barStarted',
|
'barStarted',
|
||||||
'barFinished',
|
'barFinished',
|
||||||
'barSyncExecuted',
|
'barSyncExecuted',
|
||||||
|
'promiseStarted',
|
||||||
|
'promiseFinished',
|
||||||
|
'thenableStarted',
|
||||||
|
'thenableFinished',
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('searches boot file extensions specified in options.scriptExtensions',
|
it('searches boot file extensions specified in options.scriptExtensions',
|
||||||
function(done) {
|
function(done) {
|
||||||
var options = {
|
var options = {
|
||||||
app: app,
|
app: app,
|
||||||
appRootDir: path.join(__dirname, './fixtures/simple-app'),
|
appRootDir: path.join(__dirname, './fixtures/simple-app'),
|
||||||
scriptExtensions: ['.customjs', '.customjs2'],
|
scriptExtensions: ['.customjs', '.customjs2'],
|
||||||
};
|
};
|
||||||
|
|
||||||
var bootstrapper = new Bootstrapper(options);
|
var bootstrapper = new Bootstrapper(options);
|
||||||
|
|
||||||
var context = {
|
var context = {
|
||||||
app: app,
|
app: app,
|
||||||
};
|
};
|
||||||
|
|
||||||
bootstrapper.run(context, function(err) {
|
bootstrapper.run(context, function(err) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
expect(process.bootFlags, 'process: bootFlags').to.eql([
|
expect(process.bootFlags, 'process: bootFlags').to.eql([
|
||||||
'customjs',
|
'customjs',
|
||||||
'customjs2',
|
'customjs2',
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
delete process.bootFlags;
|
delete process.bootFlags;
|
||||||
|
|
|
@ -17,7 +17,7 @@ var createBrowserLikeContext = require('./helpers/browser').createContext;
|
||||||
var printContextLogs = require('./helpers/browser').printContextLogs;
|
var printContextLogs = require('./helpers/browser').printContextLogs;
|
||||||
|
|
||||||
var compileStrategies = {
|
var compileStrategies = {
|
||||||
'default': function(appDir) {
|
default: function(appDir) {
|
||||||
var b = browserify({
|
var b = browserify({
|
||||||
basedir: appDir,
|
basedir: appDir,
|
||||||
debug: true,
|
debug: true,
|
||||||
|
@ -26,7 +26,7 @@ var compileStrategies = {
|
||||||
return b;
|
return b;
|
||||||
},
|
},
|
||||||
|
|
||||||
'coffee': function(appDir) {
|
coffee: function(appDir) {
|
||||||
var b = browserify({
|
var b = browserify({
|
||||||
basedir: appDir,
|
basedir: appDir,
|
||||||
extensions: ['.coffee'],
|
extensions: ['.coffee'],
|
||||||
|
@ -55,8 +55,10 @@ describe('browser support', function() {
|
||||||
// configured in fixtures/browser-app/boot/configure.js
|
// configured in fixtures/browser-app/boot/configure.js
|
||||||
expect(app.settings).to.have.property('custom-key', 'custom-value');
|
expect(app.settings).to.have.property('custom-key', 'custom-value');
|
||||||
expect(Object.keys(app.models)).to.include('Customer');
|
expect(Object.keys(app.models)).to.include('Customer');
|
||||||
expect(app.models.Customer.settings)
|
expect(app.models.Customer.settings).to.have.property(
|
||||||
.to.have.property('_customized', 'Customer');
|
'_customized',
|
||||||
|
'Customer'
|
||||||
|
);
|
||||||
|
|
||||||
// configured in fixtures/browser-app/component-config.json
|
// configured in fixtures/browser-app/component-config.json
|
||||||
// and fixtures/browser-app/components/dummy-component.js
|
// and fixtures/browser-app/components/dummy-component.js
|
||||||
|
@ -88,7 +90,7 @@ describe('browser support', function() {
|
||||||
|
|
||||||
it('supports coffee-script files', function(done) {
|
it('supports coffee-script files', function(done) {
|
||||||
// add coffee-script to require.extensions
|
// add coffee-script to require.extensions
|
||||||
require('coffee-script/register');
|
require('coffeescript/register');
|
||||||
|
|
||||||
var appDir = path.resolve(__dirname, './fixtures/coffee-app');
|
var appDir = path.resolve(__dirname, './fixtures/coffee-app');
|
||||||
|
|
||||||
|
@ -99,8 +101,10 @@ describe('browser support', function() {
|
||||||
// configured in fixtures/browser-app/boot/configure.coffee
|
// configured in fixtures/browser-app/boot/configure.coffee
|
||||||
expect(app.settings).to.have.property('custom-key', 'custom-value');
|
expect(app.settings).to.have.property('custom-key', 'custom-value');
|
||||||
expect(Object.keys(app.models)).to.include('Customer');
|
expect(Object.keys(app.models)).to.include('Customer');
|
||||||
expect(app.models.Customer.settings)
|
expect(app.models.Customer.settings).to.have.property(
|
||||||
.to.have.property('_customized', 'Customer');
|
'_customized',
|
||||||
|
'Customer'
|
||||||
|
);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -109,14 +113,13 @@ describe('browser support', function() {
|
||||||
|
|
||||||
function browserifyTestApp(options, strategy, next) {
|
function browserifyTestApp(options, strategy, next) {
|
||||||
// set default args
|
// set default args
|
||||||
if (((typeof strategy) === 'function') && !next) {
|
if (typeof strategy === 'function' && !next) {
|
||||||
next = strategy;
|
next = strategy;
|
||||||
strategy = undefined;
|
strategy = undefined;
|
||||||
}
|
}
|
||||||
if (!strategy)
|
if (!strategy) strategy = 'default';
|
||||||
strategy = 'default';
|
|
||||||
|
|
||||||
var appDir = typeof(options) === 'object' ? options.appRootDir : options;
|
var appDir = typeof options === 'object' ? options.appRootDir : options;
|
||||||
var b = compileStrategies[strategy](appDir);
|
var b = compileStrategies[strategy](appDir);
|
||||||
|
|
||||||
boot.compileToBrowserify(options, b, function(err) {
|
boot.compileToBrowserify(options, b, function(err) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1188,6 +1188,7 @@ describe('executor', function() {
|
||||||
it('should convert dynamic variable for datasource', function(done) {
|
it('should convert dynamic variable for datasource', function(done) {
|
||||||
var datasource = {
|
var datasource = {
|
||||||
mydb: {
|
mydb: {
|
||||||
|
connector: 'memory',
|
||||||
host: '${DYNAMIC_HOST}',
|
host: '${DYNAMIC_HOST}',
|
||||||
port: '${DYNAMIC_PORT}',
|
port: '${DYNAMIC_PORT}',
|
||||||
},
|
},
|
||||||
|
@ -1206,7 +1207,10 @@ describe('executor', function() {
|
||||||
|
|
||||||
it('should resolve dynamic config via app.get()', function(done) {
|
it('should resolve dynamic config via app.get()', function(done) {
|
||||||
var datasource = {
|
var datasource = {
|
||||||
mydb: {host: '${DYNAMIC_HOST}'},
|
mydb: {
|
||||||
|
connector: 'memory',
|
||||||
|
host: '${DYNAMIC_HOST}',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
var bootInstructions = {
|
var bootInstructions = {
|
||||||
application: {DYNAMIC_HOST: '127.0.0.4'},
|
application: {DYNAMIC_HOST: '127.0.0.4'},
|
||||||
|
@ -1223,7 +1227,10 @@ describe('executor', function() {
|
||||||
it('should take ENV precedence over config.json', function(done) {
|
it('should take ENV precedence over config.json', function(done) {
|
||||||
process.env.DYNAMIC_HOST = '127.0.0.2';
|
process.env.DYNAMIC_HOST = '127.0.0.2';
|
||||||
var datasource = {
|
var datasource = {
|
||||||
mydb: {host: '${DYNAMIC_HOST}'},
|
mydb: {
|
||||||
|
connector: 'memory',
|
||||||
|
host: '${DYNAMIC_HOST}',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
var bootInstructions = {
|
var bootInstructions = {
|
||||||
application: {DYNAMIC_HOST: '127.0.0.3'},
|
application: {DYNAMIC_HOST: '127.0.0.3'},
|
||||||
|
@ -1238,7 +1245,10 @@ describe('executor', function() {
|
||||||
|
|
||||||
it('empty dynamic conf should resolve as `undefined`', function(done) {
|
it('empty dynamic conf should resolve as `undefined`', function(done) {
|
||||||
var datasource = {
|
var datasource = {
|
||||||
mydb: {host: '${DYNAMIC_HOST}'},
|
mydb: {
|
||||||
|
connector: 'memory',
|
||||||
|
host: '${DYNAMIC_HOST}',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
var bootInstructions = {dataSources: datasource};
|
var bootInstructions = {dataSources: datasource};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue