Browse Source

feat(ts) convert service/statistics/constants to typescript

dev1
Gary Hunt 3 years ago
parent
commit
f542c03c07
No account linked to committer's email address

+ 0
- 5
service/statistics/constants.js View File

1
-const Constants = {
2
-    LOCAL_JID: 'local'
3
-};
4
-
5
-module.exports = Constants;

+ 1
- 5
service/statistics/constants.spec.ts View File

5
 describe( "/service/statistics/constants members", () => {
5
 describe( "/service/statistics/constants members", () => {
6
     const {
6
     const {
7
         LOCAL_JID,
7
         LOCAL_JID,
8
-        Constants,
9
         ...others
8
         ...others
10
-    } = exported as any; // TODO: remove cast after typescript conversion
9
+    } = exported;
11
 
10
 
12
     it( "known members", () => {
11
     it( "known members", () => {
13
         expect( LOCAL_JID ).toBe( 'local' );
12
         expect( LOCAL_JID ).toBe( 'local' );
14
-        if ( Constants ) {
15
-            expect( Constants.LOCAL_JID ).toBe( 'local' );
16
-        }
17
     } );
13
     } );
18
 
14
 
19
     it( "unknown members", () => {
15
     it( "unknown members", () => {

+ 1
- 0
service/statistics/constants.ts View File

1
+export const LOCAL_JID = 'local'

+ 1
- 1
types/auto/service/statistics/constants.d.ts View File

1
-export const LOCAL_JID: string;
1
+export declare const LOCAL_JID = "local";

Loading…
Cancel
Save