- Closes #2556 - Closes #2450 **Key intended features:** - go2rtc compatible - 100% test coverage to significantly improve ability to test, maintain and work around browser weirdnesses (e.g. Safari). - Written from the ground up in the style of the rest of the project. **To use:** - Change `live_provider` from `go2rtc` to `go2rtc-experimental`.
16 lines
543 B
TypeScript
16 lines
543 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { arrayBufferToBase64 } from '../../../../../../src/components-lib/live/providers/go2rtc-experimental/utils/base64';
|
|
|
|
// @vitest-environment jsdom
|
|
describe('arrayBufferToBase64', () => {
|
|
it('should base64-encode the bytes', () => {
|
|
const bytes = new TextEncoder().encode('Hi');
|
|
expect(arrayBufferToBase64(bytes.buffer)).toBe('SGk=');
|
|
});
|
|
|
|
it('should encode an empty buffer as an empty string', () => {
|
|
expect(arrayBufferToBase64(new ArrayBuffer(0))).toBe('');
|
|
});
|
|
});
|