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.

Resolutions.spec.ts 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import * as exported from "./Resolutions";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/service/RTC/Resolutions members", () => {
  4. const {
  5. '2160': R2160,
  6. '4k': R4k,
  7. '1080': R1080,
  8. fullhd,
  9. '720': R720,
  10. hd,
  11. '540': R540,
  12. qhd,
  13. '480': R480,
  14. vga,
  15. '360': R360,
  16. '240': R240,
  17. '180': R180,
  18. ...others
  19. } = exported as any;
  20. it( "known members", () => {
  21. expect( R2160 ).toEqual( { width: 3840, height: 2160 } );
  22. expect( R4k ).toEqual( { width: 3840, height: 2160 } );
  23. expect( R1080 ).toEqual( { width: 1920, height: 1080 } );
  24. expect( fullhd ).toEqual( { width: 1920, height: 1080 } );
  25. expect( R720 ).toEqual( { width: 1280, height: 720 } );
  26. expect( hd ).toEqual( { width: 1280, height: 720 } );
  27. expect( R540 ).toEqual( { width: 960, height: 540 } );
  28. expect( qhd ).toEqual( { width: 960, height: 540 } );
  29. expect( R480 ).toEqual( { width: 640, height: 480 } );
  30. expect( vga ).toEqual( { width: 640, height: 480 } );
  31. expect( R360 ).toEqual( { width: 640, height: 360 } );
  32. expect( R240 ).toEqual( { width: 320, height: 240 } );
  33. expect( R180 ).toEqual( { width: 320, height: 180 } );
  34. } );
  35. it( "unknown members", () => {
  36. const keys = Object.keys( others );
  37. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  38. } );
  39. } );