Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bare

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.app.js.un~

1

lib/bare.js
var bare = {
router: require('./router')(),
middleware: require('./middleware')
};

@@ -4,0 +5,0 @@

12

package.json
{
"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();
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc