Files
ToolsPCastApi-TS/test/unit/net/http/HttpMethod.test.ts

42 lines
1.2 KiB
TypeScript

import {describe, expect, it} from 'bun:test';
import {HttpMethod} from '../../../../src/net/http/HttpMethod';
describe('HttpMethod', () => {
describe('when accessing enum values', () => {
it('should return "GET" for GET method', () => {
expect(HttpMethod.GET).toBe('GET');
});
it('should return "POST" for POST method', () => {
expect(HttpMethod.POST).toBe('POST');
});
it('should return "PUT" for PUT method', () => {
expect(HttpMethod.PUT).toBe('PUT');
});
it('should return "PATCH" for PATCH method', () => {
expect(HttpMethod.PATCH).toBe('PATCH');
});
it('should return "DELETE" for DELETE method', () => {
expect(HttpMethod.DELETE).toBe('DELETE');
});
it('should return "OPTIONS" for OPTIONS method', () => {
expect(HttpMethod.OPTIONS).toBe('OPTIONS');
});
it('should return "HEAD" for HEAD method', () => {
expect(HttpMethod.HEAD).toBe('HEAD');
});
});
describe('when enumerating all methods', () => {
it('should contain exactly 7 HTTP methods', () => {
const methodCount = Object.keys(HttpMethod).length;
expect(methodCount).toBe(7);
});
});
});