Comparing version 0.0.15 to 0.0.16
@@ -29,2 +29,5 @@ 'use strict' | ||
} | ||
if (!pack.config) { | ||
pack.config = { } | ||
} | ||
@@ -35,4 +38,7 @@ this.app = app | ||
_.merge(pack.config, _.get(pack.config.env, process.env.NODE_ENV)) | ||
_.defaultsDeep(this.app.config, _.omit(pack.config, 'trailpack')) | ||
_.defaultsDeep(this.app.api, pack.api) | ||
this.app.emit(`trailpack:${this.name}:constructed`) | ||
} | ||
@@ -39,0 +45,0 @@ |
{ | ||
"name": "trailpack", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Trailpack Interface. Trailpacks extend the functionality of the Trails framework.", | ||
@@ -36,4 +36,6 @@ "main": "index.js", | ||
"eslint-config-trails": "*", | ||
"mocha": "^2.3.4" | ||
"mocha": "^2.3.4", | ||
"smokesignals": "0.0.8", | ||
"trails": "0.0.16" | ||
} | ||
} |
'use strict' | ||
const assert = require('assert') | ||
const TrailsApp = require('trails') | ||
const TestPack = require('./pack') | ||
const smokesignals = require('smokesignals') | ||
describe('Trailpack', () => { | ||
let pack | ||
before(() => { | ||
pack = new TestPack() | ||
global.app = new TrailsApp(require('./app')) | ||
return global.app.start().catch(global.app.stop) | ||
}) | ||
after(() => { | ||
return global.app.stop() | ||
}) | ||
describe('#constructor', () => { | ||
it('should construct without error', () => { | ||
const pack = new smokesignals.Trailpack(global.app) | ||
assert(pack) | ||
}) | ||
it('should emit "constructed" event', done => { | ||
global.app.after('trailpack:testpack:constructed').then(() => done() ) | ||
new TestPack(global.app) | ||
}) | ||
}) | ||
describe('#name', () => { | ||
it('should return module name', () => { | ||
assert.equal(pack.name, 'test') | ||
const pack = new TestPack(global.app) | ||
assert.equal(pack.name, 'testpack') | ||
}) | ||
@@ -24,2 +43,3 @@ }) | ||
// unload module! | ||
/* | ||
return pack.expunge(require.resolve('./pack')) | ||
@@ -29,4 +49,5 @@ .then(() => { | ||
}) | ||
*/ | ||
}) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16840
24
374
5
2