Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
79 lines (67 loc) · 1.99 KB

File metadata and controls

79 lines (67 loc) · 1.99 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import * as childProcess from 'child_process';
type NodeVersion = '14' | '16' | '18' | '20' | '21';
interface VersionConfig {
ignoredPackages: Array<`@${'sentry' | 'sentry-internal'}/${string}`>;
}
const CURRENT_NODE_VERSION = process.version.replace('v', '').split('.')[0] as NodeVersion;
const DEFAULT_SKIP_TESTS_PACKAGES = [
'@sentry-internal/eslint-plugin-sdk',
'@sentry/ember',
'@sentry/browser',
'@sentry/vue',
'@sentry/react',
'@sentry/angular',
'@sentry/svelte',
'@sentry/profiling-node',
'@sentry/replay',
'@sentry-internal/replay-canvas',
'@sentry-internal/replay-worker',
'@sentry-internal/feedback',
'@sentry/wasm',
'@sentry/bun',
'@sentry/deno',
];
const SKIP_TEST_PACKAGES: Record<NodeVersion, VersionConfig> = {
'14': {
ignoredPackages: ['@sentry/sveltekit', '@sentry/vercel-edge', '@sentry/astro'],
},
'16': {
ignoredPackages: ['@sentry/vercel-edge', '@sentry/astro'],
},
'18': {
ignoredPackages: [],
},
'20': {
ignoredPackages: [],
},
'21': {
ignoredPackages: [],
},
};
/**
* Run the given shell command, piping the shell process's `stdin`, `stdout`, and `stderr` to that of the current
* process. Returns contents of `stdout`.
*/
function run(cmd: string, options?: childProcess.ExecSyncOptions): void {
childProcess.execSync(cmd, { stdio: 'inherit', ...options });
}
/**
* Run tests, ignoring the given packages
*/
function runWithIgnores(skipPackages: string[] = []): void {
const ignoreFlags = skipPackages.map(dep => `--ignore="${dep}"`).join(' ');
run(`yarn test ${ignoreFlags}`);
}
/**
* Run the tests, accounting for compatibility problems in older versions of Node.
*/
function runTests(): void {
const ignores = new Set<string>();
DEFAULT_SKIP_TESTS_PACKAGES.forEach(pkg => ignores.add(pkg));
const versionConfig = SKIP_TEST_PACKAGES[CURRENT_NODE_VERSION];
if (versionConfig) {
versionConfig.ignoredPackages.forEach(dep => ignores.add(dep));
}
runWithIgnores(Array.from(ignores));
}
runTests();
Morty Proxy This is a proxified and sanitized view of the page, visit original site.