/
githubmirror
/
axios
Обзор
Документация
Войти
/
githubmirror
/
axios
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.x
tests/unit/helpers/HttpStatusCode.test.js
19 строк
828 B
Hashim Khan
feat(HttpStatusCode): add RFC 9110 aliases for 413 and 422 (#11082)
04 авг 2026, 21:47
Не верифицирован
04 авг 2026, 21:47
39955a6
Код
Авторство
О чём код?
import { describe, it, expect } from 'vitest'; import HttpStatusCode from '../../../lib/helpers/HttpStatusCode.js'; describe('helpers::HttpStatusCode', () => { it('should expose RFC 9110 status aliases while preserving legacy reverse lookups', () => { expect(HttpStatusCode.ContentTooLarge).toBe(413); expect(HttpStatusCode.PayloadTooLarge).toBe(413); expect(HttpStatusCode[413]).toBe('PayloadTooLarge'); expect(HttpStatusCode.UnprocessableContent).toBe(422); expect(HttpStatusCode.UnprocessableEntity).toBe(422); expect(HttpStatusCode[422]).toBe('UnprocessableEntity'); }); it('should expose Cloudflare status 520 in both directions', () => { expect(HttpStatusCode.WebServerReturnsAnUnknownError).toBe(520); expect(HttpStatusCode[520]).toBe('WebServerReturnsAnUnknownError'); }); });