Comparing version 0.0.1 to 0.0.2
var bare = { | ||
router: require('./router')(), | ||
middleware: require('./middleware') | ||
}; | ||
@@ -4,0 +5,0 @@ |
{ | ||
"name": "bare", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "The opposite of a framework", | ||
@@ -11,3 +11,3 @@ "main": "app.js", | ||
"type": "git", | ||
"url": "git://github.com/dkolba/bare.git" | ||
"url": "git://github.com/accosine/bare.git" | ||
}, | ||
@@ -23,6 +23,10 @@ "keywords": [ | ||
], | ||
"author": "Duncan Kolba", | ||
"author": "accosine.com", | ||
"contributors": [ | ||
"Simon Bugert <simon.bugert@gmail.com>", | ||
"Duncan Kolba <duncankolba@gmail.com>" | ||
], | ||
"license": "BSD-2-Clause", | ||
"bugs": { | ||
"url": "https://github.com/dkolba/bare/issues" | ||
"url": "https://github.com/accosine/bare/issues" | ||
}, | ||
@@ -29,0 +33,0 @@ "dependencies": { |
@@ -9,8 +9,17 @@ var Lab = require('lab') | ||
describe('bare should exist and at least have a router', function () { | ||
it('it tests for object and functions', function (done) { | ||
describe('bare should exist', function () { | ||
it('tests for object and functions', function (done) { | ||
expect(bare).to.be.an('object'); | ||
done(); | ||
}); | ||
}); | ||
describe('bare should be able to route', function () { | ||
it('tests if routes get added to routing table', function (done) { | ||
bare.router.on('GET', '/', function() {}); | ||
expect(bare).to.be.an('object'); | ||
expect(bare.router).to.be.an('object'); | ||
expect(bare.router._routes.get).to.be.an('array'); | ||
@@ -24,3 +33,30 @@ expect(bare).to.have.property('router'); | ||
done(); | ||
}) | ||
}) | ||
}); | ||
}); | ||
describe('bare should be able to use middleware', function () { | ||
it('it tests if req and res can be modified via middleware', function (done) { | ||
var req = {} | ||
, res = {}; | ||
function modReqRes (req, res, cb) { | ||
req.abc = 'abc'; | ||
res.asdf = 'asdf'; | ||
cb(); | ||
} | ||
bare.middleware.use(modReqRes(req, res, function() {})); | ||
bare.middleware.handle(req, res, function(req, res) {}); | ||
expect(bare.middleware).to.be.an('object'); | ||
expect(bare.middleware).to.have.property('use'); | ||
expect(bare.middleware).to.have.property('handle'); | ||
expect(bare.middleware.use).to.be.a('function'); | ||
expect(bare.middleware.handle).to.be.a('function'); | ||
expect(req.abc).to.equal('abc'); | ||
expect(res.asdf).to.equal('asdf'); | ||
done(); | ||
}); | ||
}); | ||
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
8669
12
137
2