-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript-checker): support prerelease TypeScript versions (#4738)
- Loading branch information
1 parent
9535075
commit 40ace6e
Showing
2 changed files
with
9 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ const LOW_EMIT_OPTIONS_FOR_PROJECT_REFERENCES: Readonly<Partial<ts.CompilerOptio | |
}); | ||
|
||
export function guardTSVersion(version = ts.version): void { | ||
if (!semver.satisfies(version, '>=3.6')) { | ||
if (!semver.satisfies(version, '>=3.6', { includePrerelease: true })) { | ||
throw new Error(`@stryker-mutator/typescript-checker only supports [email protected] or higher. Found typescript@${version}`); | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -200,12 +200,20 @@ describe('typescript-helpers', () => { | |
'@stryker-mutator/typescript-checker only supports [email protected] or higher. Found [email protected]', | ||
); | ||
}); | ||
it('should throw if [email protected]', () => { | ||
expect(guardTSVersion.bind(undefined, '3.5.0-beta')).throws( | ||
'@stryker-mutator/typescript-checker only supports [email protected] or higher. Found [email protected]', | ||
); | ||
}); | ||
it('should not throw if [email protected]', () => { | ||
expect(guardTSVersion.bind(undefined, '3.6.0')).not.throws(); | ||
}); | ||
it('should not throw if [email protected]', () => { | ||
expect(guardTSVersion.bind(undefined, '4.0.0')).not.throws(); | ||
}); | ||
it('should not throw if [email protected]', () => { | ||
expect(guardTSVersion.bind(undefined, '5.4.0-beta')).not.throws(); | ||
}); | ||
}); | ||
|
||
describe(getSourceMappingURL.name, () => { | ||
|