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.

ConnectionQualityEvents.spec.ts 1.0KB

123456789101112131415161718192021222324252627
  1. import * as exported from "./ConnectionQualityEvents";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/service/connectivity/ConnectionQualityEvents members", () => {
  4. const {
  5. LOCAL_STATS_UPDATED = 'cq.local_stats_updated',
  6. REMOTE_STATS_UPDATED,
  7. ConnectionQualityEvents,
  8. ...others
  9. } = exported;
  10. it( "known members", () => {
  11. expect( LOCAL_STATS_UPDATED ).toBe( 'cq.local_stats_updated' );
  12. expect( REMOTE_STATS_UPDATED ).toBe( 'cq.remote_stats_updated' );
  13. expect( ConnectionQualityEvents ).toBeDefined();
  14. expect( ConnectionQualityEvents.LOCAL_STATS_UPDATED ).toBe( 'cq.local_stats_updated' );
  15. expect( ConnectionQualityEvents.REMOTE_STATS_UPDATED ).toBe( 'cq.remote_stats_updated' );
  16. } );
  17. it( "unknown members", () => {
  18. const keys = Object.keys( others );
  19. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  20. } );
  21. } );