Archived
1
0
Fork 0
This repository has been archived on 2019-02-05. You can view files and clone it, but cannot push or open issues or pull requests.
Pong/node_modules/methods/test/methods.js
2017-01-20 23:42:49 +01:00

33 lines
854 B
JavaScript

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");
}
});
}
});