@@ -20,22 +20,33 @@ export default function () {
2020 throw new Error ( 'Expected to have missing dependency error in output.' ) ;
2121 }
2222 } )
23+ // Warning should show.
2324 . then ( ( ) => npm ( 'install' , `typescript@${ unsupportedTsVersion } ` , '--no-save' ) )
2425 . then ( ( ) => ng ( 'build' ) )
2526 . then ( ( output ) => {
2627 if ( ! output . stdout . match ( 'Using this version can result in undefined behaviour' ) ) {
2728 throw new Error ( 'Expected to have typescript version mismatch warning in output.' ) ;
2829 }
2930 } )
31+ // Warning should be disabled with global flag.
3032 . then ( ( ) => ng ( 'set' , '--global' , 'warnings.typescriptMismatch=false' ) )
3133 . then ( ( ) => ng ( 'build' ) )
3234 . then ( ( output ) => {
3335 if ( output . stdout . match ( 'Using this version can result in undefined behaviour' ) ) {
3436 throw new Error ( 'Expected to not have typescript version mismatch warning in output.' ) ;
3537 }
3638 } )
39+ . then ( ( ) => ng ( 'set' , '--global' , 'warnings.typescriptMismatch=true' ) )
40+ // Warning should be disabled with local flag.
41+ . then ( ( ) => ng ( 'set' , 'warnings.typescriptMismatch=false' ) )
42+ . then ( ( ) => ng ( 'build' ) )
43+ . then ( ( output ) => {
44+ if ( output . stdout . match ( 'Using this version can result in undefined behaviour' ) ) {
45+ throw new Error ( 'Expected to not have typescript version mismatch warning in output.' ) ;
46+ }
47+ } )
48+ . then ( ( ) => ng ( 'set' , 'warnings.typescriptMismatch=true' ) )
3749 // Cleanup
38- . then ( ( ) => npm ( 'install' ) )
39- . then ( ( ) => ng ( 'set' , '--global' , 'warnings.typescriptMismatch=true' ) ) ;
50+ . then ( ( ) => npm ( 'install' ) ) ;
4051}
4152
0 commit comments