Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dhmlau committed Jul 26, 2018
1 parent c4ab39c commit d598c37
Show file tree
Hide file tree
Showing 7 changed files with 1,260 additions and 876 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock=false
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,7 +1,7 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- "7"
- "8"
- "10"

7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -16,14 +16,15 @@
"url": "https://github.com/strongloop/loopback-boot"
},
"engines": {
"node": ">=4.0.0"
"node": ">=6"
},
"main": "index.js",
"browser": "browser.js",
"scripts": {
"test": "mocha",
"posttest": "npm run lint",
"lint": "eslint ."
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"license": "MIT",
"dependencies": {
Expand All @@ -39,7 +40,7 @@
"devDependencies": {
"browserify": "^4.2.3",
"chai": "^3.5.0",
"coffee-script": "^1.10.0",
"coffeescript": "^2.3.1",
"coffeeify": "^2.0.1",
"dirty-chai": "^1.2.2",
"eslint": "^3.19.0",
Expand Down
51 changes: 29 additions & 22 deletions test/bootstrapper.test.js
Expand Up @@ -68,40 +68,47 @@ describe('Bootstrapper', function() {
expect(instructions.application, 'application').to.be.an('object');
expect(instructions.tracker, 'instruction: tracker').to.eql('compile');
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',
'fooLoaded',
'promiseLoaded',
'thenableLoaded',
'barStarted',
'barFinished',
'barSyncExecuted',
'promiseStarted',
'promiseFinished',
'thenableStarted',
'thenableFinished',
]);
done();
});
});

it('searches boot file extensions specified in options.scriptExtensions',
function(done) {
var options = {
app: app,
appRootDir: path.join(__dirname, './fixtures/simple-app'),
scriptExtensions: ['.customjs', '.customjs2'],
};

var bootstrapper = new Bootstrapper(options);

var context = {
app: app,
};

bootstrapper.run(context, function(err) {
if (err) return done(err);
expect(process.bootFlags, 'process: bootFlags').to.eql([
'customjs',
'customjs2',
]);
done();
function(done) {
var options = {
app: app,
appRootDir: path.join(__dirname, './fixtures/simple-app'),
scriptExtensions: ['.customjs', '.customjs2'],
};

var bootstrapper = new Bootstrapper(options);

var context = {
app: app,
};

bootstrapper.run(context, function(err) {
if (err) return done(err);
expect(process.bootFlags, 'process: bootFlags').to.eql([
'customjs',
'customjs2',
]);
done();
});
});
});

afterEach(function() {
delete process.bootFlags;
Expand Down
25 changes: 14 additions & 11 deletions test/browser.test.js
Expand Up @@ -17,7 +17,7 @@ var createBrowserLikeContext = require('./helpers/browser').createContext;
var printContextLogs = require('./helpers/browser').printContextLogs;

var compileStrategies = {
'default': function(appDir) {
default: function(appDir) {
var b = browserify({
basedir: appDir,
debug: true,
Expand All @@ -26,7 +26,7 @@ var compileStrategies = {
return b;
},

'coffee': function(appDir) {
coffee: function(appDir) {
var b = browserify({
basedir: appDir,
extensions: ['.coffee'],
Expand Down Expand Up @@ -55,8 +55,10 @@ describe('browser support', function() {
// configured in fixtures/browser-app/boot/configure.js
expect(app.settings).to.have.property('custom-key', 'custom-value');
expect(Object.keys(app.models)).to.include('Customer');
expect(app.models.Customer.settings)
.to.have.property('_customized', 'Customer');
expect(app.models.Customer.settings).to.have.property(
'_customized',
'Customer'
);

// configured in fixtures/browser-app/component-config.json
// and fixtures/browser-app/components/dummy-component.js
Expand Down Expand Up @@ -88,7 +90,7 @@ describe('browser support', function() {

it('supports coffee-script files', function(done) {
// add coffee-script to require.extensions
require('coffee-script/register');
require('coffeescript/register');

var appDir = path.resolve(__dirname, './fixtures/coffee-app');

Expand All @@ -99,8 +101,10 @@ describe('browser support', function() {
// configured in fixtures/browser-app/boot/configure.coffee
expect(app.settings).to.have.property('custom-key', 'custom-value');
expect(Object.keys(app.models)).to.include('Customer');
expect(app.models.Customer.settings)
.to.have.property('_customized', 'Customer');
expect(app.models.Customer.settings).to.have.property(
'_customized',
'Customer'
);
done();
});
});
Expand All @@ -109,14 +113,13 @@ describe('browser support', function() {

function browserifyTestApp(options, strategy, next) {
// set default args
if (((typeof strategy) === 'function') && !next) {
if (typeof strategy === 'function' && !next) {
next = strategy;
strategy = undefined;
}
if (!strategy)
strategy = 'default';
if (!strategy) strategy = 'default';

var appDir = typeof(options) === 'object' ? options.appRootDir : options;
var appDir = typeof options === 'object' ? options.appRootDir : options;
var b = compileStrategies[strategy](appDir);

boot.compileToBrowserify(options, b, function(err) {
Expand Down

0 comments on commit d598c37

Please sign in to comment.