modified lib-jitsi-meet dev repo
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.

JitsiConnectionErrors.spec.ts 1.4KB

1234567891011121314151617181920212223242526272829303132
  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. OTHER_ERROR,
  7. PASSWORD_REQUIRED,
  8. SERVER_ERROR,
  9. JitsiConnectionErrors,
  10. ...others
  11. } = exported as any; // TODO: remove cast after typescript conversion
  12. it( "known members", () => {
  13. expect( CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  14. expect( OTHER_ERROR ).toBe( 'connection.otherError' );
  15. expect( PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  16. expect( SERVER_ERROR ).toBe( 'connection.serverError' );
  17. if ( JitsiConnectionErrors ) {
  18. expect( JitsiConnectionErrors.CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  19. expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
  20. expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  21. expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
  22. }
  23. } );
  24. it( "unknown members", () => {
  25. const keys = Object.keys( others );
  26. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  27. } );
  28. } );