You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CodecMimeType.spec.ts 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import * as exported from "./CodecMimeType";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/service/RTC/CodecMimeType members", () => {
  4. const {
  5. default: {
  6. AV1,
  7. H264,
  8. OPUS,
  9. ULPFEC,
  10. VP8,
  11. VP9,
  12. },
  13. CodecMimeType,
  14. ...others
  15. } = exported as any; // TODO: remove cast after typescript conversion
  16. it( "known members", () => {
  17. expect( AV1 ).toBe( 'av1' );
  18. expect( H264 ).toBe( 'h264' );
  19. expect( OPUS ).toBe( 'opus' );
  20. expect( ULPFEC ).toBe( 'ulpfec' );
  21. expect( VP8 ).toBe( 'vp8' );
  22. expect( VP9 ).toBe( 'vp9' );
  23. expect( CodecMimeType ).toBeDefined();
  24. expect( CodecMimeType.AV1 ).toBe( 'av1' );
  25. expect( CodecMimeType.H264 ).toBe( 'h264' );
  26. expect( CodecMimeType.OPUS ).toBe( 'opus' );
  27. expect( CodecMimeType.ULPFEC ).toBe( 'ulpfec' );
  28. expect( CodecMimeType.VP8 ).toBe( 'vp8' );
  29. expect( CodecMimeType.VP9 ).toBe( 'vp9' );
  30. } );
  31. it( "unknown members", () => {
  32. const keys = Object.keys( others );
  33. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  34. } );
  35. } );