File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Testem appends progress to the title...
22// and there's no way to stop this at the moment
33
4- export function getPageTitle ( doc : Document ) {
4+ export function getPageTitle ( doc ? : Document ) : string {
55 // In Fastboot context we get 2 title elements if we don't remove one from app/index.html
66 // In real world applications, it is mandatory to remove <title> from app/index.html
77 // We are keeping both for sake for testing browser and fastboot scenarios
88 const element = [
99 ...( doc || window . document ) . querySelectorAll ( 'head title' ) ,
1010 ] . pop ( ) ;
1111
12- return (
13- element &&
14- element instanceof HTMLTitleElement &&
15- element . innerText . trim ( ) . replace ( / ^ \( \d + \/ \d + \) / , '' )
16- ) ;
12+ if ( element instanceof HTMLTitleElement ) {
13+ return element . innerText . trim ( ) . replace ( / ^ \( \d + \/ \d + \) / , '' ) ;
14+ }
15+
16+ return '' ;
1717}
You can’t perform that action at this time.
0 commit comments