|
@@ -1,38 +0,0 @@
|
1
|
|
-import * as exported from "./StreamEventTypes";
|
2
|
|
-
|
3
|
|
-// this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
|
4
|
|
-
|
5
|
|
-describe( "/service/RTC/StreamEventTypes members", () => {
|
6
|
|
- const {
|
7
|
|
- EVENT_TYPE_LOCAL_CREATED,
|
8
|
|
- EVENT_TYPE_LOCAL_CHANGED,
|
9
|
|
- EVENT_TYPE_LOCAL_ENDED,
|
10
|
|
- EVENT_TYPE_REMOTE_CREATED,
|
11
|
|
- EVENT_TYPE_REMOTE_ENDED,
|
12
|
|
- TRACK_MUTE_CHANGED,
|
13
|
|
- StreamEventTypes,
|
14
|
|
- ...others
|
15
|
|
- } = exported as any; // TODO: remove cast after typescript conversion
|
16
|
|
-
|
17
|
|
- it( "known members", () => {
|
18
|
|
- expect( EVENT_TYPE_LOCAL_CREATED ).toBe( 'stream.local_created' );
|
19
|
|
- expect( EVENT_TYPE_LOCAL_CHANGED ).toBe( 'stream.local_changed' );
|
20
|
|
- expect( EVENT_TYPE_LOCAL_ENDED ).toBe( 'stream.local_ended' );
|
21
|
|
- expect( EVENT_TYPE_REMOTE_CREATED ).toBe( 'stream.remote_created' );
|
22
|
|
- expect( EVENT_TYPE_REMOTE_ENDED ).toBe( 'stream.remote_ended' );
|
23
|
|
- expect( TRACK_MUTE_CHANGED ).toBe( 'rtc.track_mute_changed' );
|
24
|
|
- if ( StreamEventTypes ) {
|
25
|
|
- expect( StreamEventTypes.EVENT_TYPE_LOCAL_CREATED ).toBe( 'stream.local_created' );
|
26
|
|
- expect( StreamEventTypes.EVENT_TYPE_LOCAL_CHANGED ).toBe( 'stream.local_changed' );
|
27
|
|
- expect( StreamEventTypes.EVENT_TYPE_LOCAL_ENDED ).toBe( 'stream.local_ended' );
|
28
|
|
- expect( StreamEventTypes.EVENT_TYPE_REMOTE_CREATED ).toBe( 'stream.remote_created' );
|
29
|
|
- expect( StreamEventTypes.EVENT_TYPE_REMOTE_ENDED ).toBe( 'stream.remote_ended' );
|
30
|
|
- expect( StreamEventTypes.TRACK_MUTE_CHANGED ).toBe( 'rtc.track_mute_changed' );
|
31
|
|
- }
|
32
|
|
- } );
|
33
|
|
-
|
34
|
|
- it( "unknown members", () => {
|
35
|
|
- const keys = Object.keys( others );
|
36
|
|
- expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
|
37
|
|
- } );
|
38
|
|
-} );
|