-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): verify Angular/TS version combos
- Loading branch information
1 parent
d1adc8c
commit ca344b1
Showing
6 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ng, npm } from '../../utils/process'; | ||
import { getGlobalVariable } from '../../utils/env'; | ||
|
||
|
||
export default function () { | ||
// typescript@2.5 is not part of the officially supported range in latest stable. | ||
// Update as needed. | ||
let unsupportedTsVersion = '2.5'; | ||
|
||
// Skip this in Appveyor tests. | ||
if (getGlobalVariable('argv').nightly) { | ||
unsupportedTsVersion = '2.3'; | ||
} | ||
|
||
return Promise.resolve() | ||
.then(() => npm('uninstall', 'typescript', '--no-save')) | ||
.then(() => ng('build')) | ||
.catch((err) => { | ||
if (!err.message.match('Versions of @angular/compiler-cli and typescript could not')) { | ||
throw new Error('Expected to have missing dependency error in output.'); | ||
} | ||
}) | ||
.then(() => npm('install', `typescript@${unsupportedTsVersion}`, '--no-save')) | ||
.then(() => ng('build')) | ||
.then((output) => { | ||
if (!output.stdout.match('Using this version can result in undefined behaviour')) { | ||
throw new Error('Expected to have typescript version mismatch warning in output.'); | ||
} | ||
}) | ||
.then(() => ng('set', '--global', 'warnings.typescriptMismatch=false')) | ||
.then(() => ng('build')) | ||
.then((output) => { | ||
if (output.stdout.match('Using this version can result in undefined behaviour')) { | ||
throw new Error('Expected to not have typescript version mismatch warning in output.'); | ||
} | ||
}) | ||
// Cleanup | ||
.then(() => npm('install')) | ||
.then(() => ng('set', '--global', 'warnings.typescriptMismatch=true')); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters