You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
854 B

var http = require('http');
var assert = require('assert');
var methods = require('..');
describe('methods', function() {
if (http.METHODS) {
it('is a lowercased http.METHODS', function() {
var lowercased = http.METHODS.map(function(method) {
return method.toLowerCase();
});
assert.deepEqual(lowercased, methods);
});
} else {
it('contains GET, POST, PUT, and DELETE', function() {
assert.notEqual(methods.indexOf('get'), -1);
assert.notEqual(methods.indexOf('post'), -1);
assert.notEqual(methods.indexOf('put'), -1);
assert.notEqual(methods.indexOf('delete'), -1);
});
it('is all lowercase', function() {
for (var i = 0; i < methods.length; i ++) {
assert(methods[i], methods[i].toLowerCase(), methods[i] + " isn't all lowercase");
}
});
}
});