nyc-bookstores/node_modules/router/tests/1-get.js

16 lines
329 B
JavaScript
Raw Normal View History

2013-05-27 20:45:59 +00:00
var assert = require('assert');
var route = require('../index')();
var res = {end:function() {}};
var count = 0;
route.get('/', function(req, res) {
assert.equal(req.method, 'GET');
assert.equal(req.url, '/');
count++;
});
route({method:'GET', url:'/'},res);
route({method:'NOT_GET', url:'/'},res);
assert.equal(count, 1);