1234567891011121314151617181920212223242526 |
- import * as exported from "./ConnectionQualityEvents";
-
- // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
-
- describe( "/service/connectivity/ConnectionQualityEvents members", () => {
- const {
- LOCAL_STATS_UPDATED = 'cq.local_stats_updated',
- REMOTE_STATS_UPDATED,
- ConnectionQualityEvents,
- ...others
- } = exported as any; // TODO: remove cast after typescript conversion
-
- it( "known members", () => {
- expect( LOCAL_STATS_UPDATED ).toBe( 'cq.local_stats_updated' );
- expect( REMOTE_STATS_UPDATED ).toBe( 'cq.remote_stats_updated' );
- if ( ConnectionQualityEvents ) {
- expect( ConnectionQualityEvents.LOCAL_STATS_UPDATED ).toBe( 'cq.local_stats_updated' );
- expect( ConnectionQualityEvents.REMOTE_STATS_UPDATED ).toBe( 'cq.remote_stats_updated' );
- }
- } );
-
- it( "unknown members", () => {
- const keys = Object.keys( others );
- expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
- } );
- } );
|