Skip to content

Commit 4c2db12

Browse files
committed
clean up types
1 parent 29744f8 commit 4c2db12

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

scripts/node-unit-tests.ts

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import * as childProcess from 'child_process';
22
import * as fs from 'fs';
33

4-
const CURRENT_NODE_VERSION = process.version.replace('v', '').split('.')[0];
4+
type NodeVersion = '8' | '10' | '12' | '14' | '16';
55

6-
type NodeVersions = '8' | '10' | '12' | '14' | '16';
6+
interface VersionConfig {
7+
ignoredPackages: Array<`@${'sentry' | 'sentry-internal'}/${string}`>;
8+
legacyDeps: Array<`${string}@${string}`>;
9+
shouldES6Utils: boolean;
10+
}
11+
12+
const CURRENT_NODE_VERSION = process.version.replace('v', '').split('.')[0] as NodeVersion;
713

814
const DEFAULT_SKIP_TESTS_PACKAGES = [
915
'@sentry-internal/eslint-plugin-sdk',
@@ -18,14 +24,7 @@ const DEFAULT_SKIP_TESTS_PACKAGES = [
1824
'@sentry/bun',
1925
];
2026

21-
const SKIP_TEST_PACKAGES: Record<
22-
NodeVersions,
23-
{
24-
ignoredPackages: Array<`@${'sentry' | 'sentry-internal'}/${string}`>;
25-
legacyDeps: Array<`${string}@${string}`>;
26-
shouldES6Utils: boolean;
27-
}
28-
> = {
27+
const SKIP_TEST_PACKAGES: Record<NodeVersion, VersionConfig> = {
2928
'8': {
3029
ignoredPackages: [
3130
'@sentry/gatsby',
@@ -159,14 +158,12 @@ function runTests(): void {
159158
skipNodeV8Tests();
160159
}
161160

162-
const versionConfig = SKIP_TEST_PACKAGES[CURRENT_NODE_VERSION as NodeVersions];
161+
const versionConfig = SKIP_TEST_PACKAGES[CURRENT_NODE_VERSION];
163162
if (versionConfig) {
164163
versionConfig.ignoredPackages.forEach(dep => ignores.add(dep));
165-
166164
if (versionConfig.legacyDeps.length > 0) {
167165
installLegacyDeps(versionConfig.legacyDeps);
168166
}
169-
170167
if (versionConfig.shouldES6Utils) {
171168
es6ifyTestTSConfig('utils');
172169
}

0 commit comments

Comments
 (0)