michangarrito/apps/backend/node_modules/passport-jwt/test/auth_header-test.js
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

29 lines
824 B
JavaScript

var auth_hdr = require('../lib/auth_header')
describe('Parsing Auth Header field-value', function() {
it('Should handle single space separated values', function() {
var res = auth_hdr.parse("SCHEME VALUE");
expect(res).to.deep.equal({scheme: "SCHEME", value: "VALUE"});
});
it('Should handle CRLF separator', function() {
var res = auth_hdr.parse("SCHEME\nVALUE");
expect(res).to.deep.equal({scheme: "SCHEME", value: "VALUE"});
});
it('Should handle malformed authentication headers with no scheme', function() {
var res = auth_hdr.parse("malformed");
expect(res).to.not.be.ok;
});
it('Should return null when the auth header is not a string', function() {
var res = auth_hdr.parse({});
expect(res).to.be.null;
});
});