Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ConnectionQualityEvents.spec.ts 1.1KB

1234567891011121314151617181920212223242526
  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 as any; // TODO: remove cast after typescript conversion
  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. if ( ConnectionQualityEvents ) {
  14. expect( ConnectionQualityEvents.LOCAL_STATS_UPDATED ).toBe( 'cq.local_stats_updated' );
  15. expect( ConnectionQualityEvents.REMOTE_STATS_UPDATED ).toBe( 'cq.remote_stats_updated' );
  16. }
  17. } );
  18. it( "unknown members", () => {
  19. const keys = Object.keys( others );
  20. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  21. } );
  22. } );