Skip to content

Commit 7d25313

Browse files
committed
chore: update deps & install and test typescript versions >=3.5
1 parent 2e010c7 commit 7d25313

File tree

3 files changed

+1109
-837
lines changed

3 files changed

+1109
-837
lines changed

build/testDts.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@
1919
*/
2020

2121
const { TypeScriptVersion } = require('@definitelytyped/typescript-versions');
22-
const {
23-
cleanTypeScriptInstalls,
24-
installAllTypeScriptVersions,
25-
typeScriptPath
26-
} = require('@definitelytyped/utils');
22+
const { typeScriptPath, install } = require('@definitelytyped/utils');
2723
const { runTsCompile } = require('./pre-publish');
2824
const globby = require('globby');
2925
const semver = require('semver');
3026

3127
const MIN_VERSION = '3.5.0';
3228

3329
async function installTs() {
34-
// await cleanTypeScriptInstalls();
35-
await installAllTypeScriptVersions();
30+
const tsVersions = getTypeScriptVersions();
31+
for (const version of tsVersions) {
32+
await install(version);
33+
}
3634
}
3735

3836
async function runTests() {
@@ -52,11 +50,8 @@ async function runTests() {
5250
};
5351
const testsList = await globby(__dirname + '/../test/types/*.ts');
5452

55-
for (let version of TypeScriptVersion.shipped) {
56-
if (semver.lt(version + '.0', MIN_VERSION)) {
57-
continue;
58-
}
59-
53+
const tsVersions = getTypeScriptVersions();
54+
for (const version of tsVersions) {
6055
console.log(`Testing ts version ${version}`);
6156
const ts = require(typeScriptPath(version));
6257
await runTsCompile(ts, compilerOptions, testsList);
@@ -65,11 +60,17 @@ async function runTests() {
6560
}
6661
}
6762

63+
function getTypeScriptVersions() {
64+
return TypeScriptVersion.unsupported
65+
.concat(TypeScriptVersion.shipped)
66+
.filter(version => semver.gte(version + '.0', MIN_VERSION));
67+
}
68+
6869
async function main() {
6970
await installTs();
7071
await runTests();
7172
}
7273

7374
module.exports = main;
7475

75-
main();
76+
main();

0 commit comments

Comments
 (0)