File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
packages/auth/src/core/auth Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @firebase/auth " : patch
3+ ---
4+
5+ Calls to ` connectAuthEmulator ` with the ` disableWarnings ` flag set to true will no longer cause a ` console.info ` warning to be printed
Original file line number Diff line number Diff line change @@ -130,16 +130,12 @@ describe('core/auth/emulator', () => {
130130 ) ;
131131 } ) ;
132132
133- it ( 'logs out the warning but has no banner if disableBanner true ' , ( ) => {
133+ it ( 'skips console info and has no banner if warnings disabled ' , ( ) => {
134134 sinon . stub ( console , 'info' ) ;
135135 connectAuthEmulator ( auth , 'http://localhost:2020' , {
136136 disableWarnings : true
137137 } ) ;
138- expect ( console . info ) . to . have . been . calledWith (
139- 'WARNING: You are using the Auth Emulator,' +
140- ' which is intended for local testing only. Do not use with' +
141- ' production credentials.'
142- ) ;
138+ expect ( console . info ) . not . to . have . been . called ;
143139 if ( typeof document !== 'undefined' ) {
144140 expect ( document . querySelector ( '.firebase-emulator-warning' ) ) . to . be . null ;
145141 }
Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ export function connectAuthEmulator(
7575 options : Object . freeze ( { disableWarnings } )
7676 } ) ;
7777
78- emitEmulatorWarning ( disableWarnings ) ;
78+ if ( ! disableWarnings ) {
79+ emitEmulatorWarning ( ) ;
80+ }
7981}
8082
8183function extractProtocol ( url : string ) : string {
@@ -114,7 +116,7 @@ function parsePort(portStr: string): number | null {
114116 return port ;
115117}
116118
117- function emitEmulatorWarning ( disableBanner : boolean ) : void {
119+ function emitEmulatorWarning ( ) : void {
118120 function attachBanner ( ) : void {
119121 const el = document . createElement ( 'p' ) ;
120122 const sty = el . style ;
@@ -143,8 +145,7 @@ function emitEmulatorWarning(disableBanner: boolean): void {
143145 }
144146 if (
145147 typeof window !== 'undefined' &&
146- typeof document !== 'undefined' &&
147- ! disableBanner
148+ typeof document !== 'undefined'
148149 ) {
149150 if ( document . readyState === 'loading' ) {
150151 window . addEventListener ( 'DOMContentLoaded' , attachBanner ) ;
You can’t perform that action at this time.
0 commit comments