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.

constants.spec.ts 745B

1234567891011121314151617181920212223
  1. import * as exported from "./constants";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/service/statistics/constants members", () => {
  4. const {
  5. LOCAL_JID,
  6. Constants,
  7. ...others
  8. } = exported as any; // TODO: remove cast after typescript conversion
  9. it( "known members", () => {
  10. expect( LOCAL_JID ).toBe( 'local' );
  11. if ( Constants ) {
  12. expect( Constants.LOCAL_JID ).toBe( 'local' );
  13. }
  14. } );
  15. it( "unknown members", () => {
  16. const keys = Object.keys( others );
  17. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  18. } );
  19. } );