Repository navigation
Conversation
| recoverRealTsVersion(); | ||
| }); | ||
|
|
||
| function dangerouslySetTsVersion(version: string) { (ts as any).version = version; } |
There was a problem hiding this comment.
Instead of changing the version of TypeScript, another approach is to just export a function from program.ts
export function checkTypeScriptVersion(version: string, options: CompilerOptions){
if (version < '2.4.2' || (version >= '2.7.0' && !options.disableTypeScriptVersionCheck)) {
throw new Error(
`The Angular Compiler requires TypeScript >=2.4.2 and <2.7 but ${version} was found instead.`);
}
}And then perform assertions on it.
#22699 is however talking just about adding tests and not modifying the source file. Hence dangerouslySetTsVersion in the test file.
Please let me know if I need to change this
|
In order not to waste a reviewer time, please note that this PR (as well as the associated issue) may be closed depending on the outcome of the ongoing PR #22705 (it does small refactoring of |
|
I am closing this PR as my changes in #22705 are merged in master now. They already add tests to TypeScript version check |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #22699
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
No tests for supported TypeScript versions/
disableTypeScriptVersionCheckangularCompilerOptions flagIssue Number: N/A
#22699
What is the new behavior?
new tests added
Does this PR introduce a breaking change?
Other information