@@ -28,27 +28,35 @@ import {
28
28
} from '@firebase/component' ;
29
29
import { VersionService } from '../src/version-service' ;
30
30
31
+ declare module "@firebase/component" {
32
+ interface NameServiceMapping {
33
+ 'vs1' : VersionService ;
34
+ 'vs2' : VersionService ;
35
+ 'test-shell' : Promise < void > ;
36
+ }
37
+ }
38
+
31
39
describe ( 'Platform Logger Service Unit Tests' , ( ) => {
32
40
it ( `logs core version` , ( ) => {
33
41
const container = new ComponentContainer ( 'testContainer' ) ;
34
42
container . addComponent (
35
43
new Component (
36
- 'comp1 ' ,
37
- ( ) => new VersionService ( 'comp1 ' , '1.2.3' ) ,
44
+ 'vs1 ' ,
45
+ ( ) => new VersionService ( 'vs1 ' , '1.2.3' ) ,
38
46
ComponentType . VERSION
39
47
)
40
48
) ;
41
49
container . addComponent (
42
50
new Component (
43
- 'comp2 ' ,
44
- ( ) => new VersionService ( 'comp2 ' , '3.02.01' ) ,
51
+ 'vs2 ' ,
52
+ ( ) => new VersionService ( 'vs2 ' , '3.02.01' ) ,
45
53
ComponentType . VERSION
46
54
)
47
55
) ;
48
56
const platformLoggerService = new PlatformLoggerService ( container ) ;
49
57
const platformInfoString = platformLoggerService . getPlatformInfoString ( ) ;
50
- expect ( platformInfoString ) . to . include ( 'comp1 /1.2.3' ) ;
51
- expect ( platformInfoString ) . to . include ( 'comp2 /3.02.01' ) ;
58
+ expect ( platformInfoString ) . to . include ( 'vs1 /1.2.3' ) ;
59
+ expect ( platformInfoString ) . to . include ( 'vs2 /3.02.01' ) ;
52
60
} ) ;
53
61
} ) ;
54
62
@@ -63,20 +71,19 @@ describe('Platform Logger Service Integration Tests', () => {
63
71
firebase . initializeApp ( { } ) ;
64
72
( firebase as _FirebaseNamespace ) . INTERNAL . registerComponent (
65
73
new Component (
66
- 'test' ,
74
+ 'test-shell ' ,
67
75
async ( container : ComponentContainer ) => {
68
76
const platformLoggerProvider = container . getProvider (
69
77
'platform-logger'
70
78
) ;
71
79
const platformLogger = ( await platformLoggerProvider . get ( ) ) as PlatformLoggerService ;
72
80
const platformInfoString = platformLogger . getPlatformInfoString ( ) ;
73
81
expect ( platformInfoString ) . to . include ( 'fire-core' ) ;
74
- return { } ;
75
82
} ,
76
83
ComponentType . PUBLIC
77
84
)
78
85
) ;
79
- ( firebase as any ) . test ( ) ;
86
+ ( firebase as any ) [ ' test-shell' ] ( ) ;
80
87
} ) ;
81
88
82
89
it ( `logs other components' versions` , ( ) => {
@@ -87,19 +94,18 @@ describe('Platform Logger Service Integration Tests', () => {
87
94
) ;
88
95
( firebase as _FirebaseNamespace ) . INTERNAL . registerComponent (
89
96
new Component (
90
- 'test' ,
97
+ 'test-shell ' ,
91
98
async ( container : ComponentContainer ) => {
92
99
const platformLoggerProvider = container . getProvider (
93
100
'platform-logger'
94
101
) ;
95
102
const platformLogger = ( await platformLoggerProvider . get ( ) ) as PlatformLoggerService ;
96
103
const platformInfoString = platformLogger . getPlatformInfoString ( ) ;
97
104
expect ( platformInfoString ) . to . include ( 'fire-analytics/1.2.3' ) ;
98
- return { } ;
99
105
} ,
100
106
ComponentType . PUBLIC
101
107
)
102
108
) ;
103
- ( firebase as any ) . test ( ) ;
109
+ ( firebase as any ) [ ' test-shell' ] ( ) ;
104
110
} ) ;
105
111
} ) ;
0 commit comments