1234567891011121314151617181920212223242526272829 |
- import * as exported from "./JingleSessionState";
-
- // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
-
- describe( "/modules/xmpp/JingleSessionState members", () => {
- const {
- PENDING,
- ACTIVE,
- ENDED,
- JingleSessionState,
- ...others
- } = exported as any; // TODO: remove cast after typescript conversion
-
- it( "known members", () => {
- expect( PENDING ).toBe( 'pending' );
- expect( ACTIVE ).toBe( 'active' );
- expect( ENDED ).toBe( 'ended' );
- if ( JingleSessionState ) {
- expect( JingleSessionState.PENDING ).toBe( 'pending' );
- expect( JingleSessionState.ACTIVE ).toBe( 'active' );
- expect( JingleSessionState.ENDED ).toBe( 'ended' );
- }
- } );
-
- it( "unknown members", () => {
- const keys = Object.keys( others );
- expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
- } );
- } );
|