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.

JitsiConnectionErrors.spec.ts 1.4KB

1234567891011121314151617181920212223242526272829303132333435
  1. import * as exported from "./JitsiConnectionErrors";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/JitsiConnectionErrors members", () => {
  4. const {
  5. CONNECTION_DROPPED_ERROR,
  6. NOT_LIVE_ERROR,
  7. OTHER_ERROR,
  8. PASSWORD_REQUIRED,
  9. SERVER_ERROR,
  10. JitsiConnectionErrors,
  11. ...others
  12. } = exported;
  13. it( "known members", () => {
  14. expect( CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  15. expect( OTHER_ERROR ).toBe( 'connection.otherError' );
  16. expect( PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  17. expect( SERVER_ERROR ).toBe( 'connection.serverError' );
  18. expect( JitsiConnectionErrors ).toBeDefined();
  19. expect( JitsiConnectionErrors.CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  20. expect( JitsiConnectionErrors.NOT_LIVE_ERROR ).toBe( 'connection.notLiveError' );
  21. expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
  22. expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  23. expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
  24. } );
  25. it( "unknown members", () => {
  26. const keys = Object.keys( others );
  27. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  28. } );
  29. } );