@qiniu/miku-delivery-mp-ks
Version:
Kuaishou Mini Program SDK for Miku Delivery
15 lines (14 loc) • 545 B
JavaScript
import Headers from './headers';
describe('Headers', () => {
it('should work well', () => {
const headers = new Headers({
'Content-Type': 'application/json',
'x-req-id': '123'
});
expect(headers.get('content-type')).toBe('application/json');
expect(headers.get('X-Req-ID')).toBe('123');
expect(headers.has('x-req-ID')).toBe(true);
expect(headers.has('Content-Length')).toBe(false);
expect([...headers.keys()]).toEqual(['content-type', 'x-req-id']);
});
});