FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sentry-javascript/scripts/node-unit-tests.ts at develop · mcous/sentry-javascript · GitHub
mcous
/
sentry-javascript
Public
forked from
getsentry/sentry-javascript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sentry-javascript
/
scripts
/
node-unit-tests.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
89 lines (77 loc) · 2.2 KB
Breadcrumbs
sentry-javascript
/
scripts
/
node-unit-tests.ts
Copy path
File metadata and controls
89 lines (77 loc) · 2.2 KB
Raw
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
80
81
82
83
84
85
86
87
88
89
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/solid'
,
'@sentry/svelte'
,
'@sentry/profiling-node'
,
'@sentry-internal/browser-utils'
,
'@sentry-internal/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/cloudflare'
,
'@sentry/solidstart'
,
'@sentry/sveltekit'
,
'@sentry/vercel-edge'
,
'@sentry/astro'
,
'@sentry/nuxt'
,
'@sentry/nestjs'
,
]
,
}
,
'16'
:
{
ignoredPackages
:
[
'@sentry/cloudflare'
,
'@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
(
)
;
Back
|
FazBrowse Home
|
New Git URL