@@ -5,10 +5,6 @@ import { deterministicTraceIdFromInstanceId, instrumentWorkflowWithSentry } from
5
5
6
6
const NODE_MAJOR_VERSION = parseInt ( process . versions . node . split ( '.' ) [ 0 ] ! ) ;
7
7
8
- if ( NODE_MAJOR_VERSION < 20 ) {
9
- process . exit ( 0 ) ; // Skip tests for Node.js versions below 20
10
- }
11
-
12
8
const mockStep : WorkflowStep = {
13
9
do : vi
14
10
. fn ( )
@@ -81,7 +77,11 @@ describe('workflows', () => {
81
77
expect ( await deterministicTraceIdFromInstanceId ( INSTANCE_ID ) ) . toMatch ( UUID_WITHOUT_HYPHENS_REGEX ) ;
82
78
} ) ;
83
79
84
- test ( 'Calls expected functions' , async ( ) => {
80
+ test ( 'Calls expected functions' , async ctx => {
81
+ if ( NODE_MAJOR_VERSION < 20 ) {
82
+ ctx . skip ( ) ;
83
+ return ;
84
+ }
85
85
class BasicTestWorkflow {
86
86
constructor ( _ctx : ExecutionContext , _env : unknown ) { }
87
87
@@ -146,7 +146,11 @@ describe('workflows', () => {
146
146
] ) ;
147
147
} ) ;
148
148
149
- test ( 'Calls expected functions with non-uuid instance id' , async ( ) => {
149
+ test ( 'Calls expected functions with non-uuid instance id' , async ctx => {
150
+ if ( NODE_MAJOR_VERSION < 20 ) {
151
+ ctx . skip ( ) ;
152
+ return ;
153
+ }
150
154
class BasicTestWorkflow {
151
155
constructor ( _ctx : ExecutionContext , _env : unknown ) { }
152
156
@@ -228,7 +232,12 @@ describe('workflows', () => {
228
232
}
229
233
}
230
234
231
- test ( 'Captures step errors' , async ( ) => {
235
+ test ( 'Captures step errors' , async ctx => {
236
+ if ( NODE_MAJOR_VERSION < 20 ) {
237
+ ctx . skip ( ) ;
238
+ return ;
239
+ }
240
+
232
241
const TestWorkflowInstrumented = instrumentWorkflowWithSentry ( getSentryOptions , ErrorTestWorkflow as any ) ;
233
242
const workflow = new TestWorkflowInstrumented ( mockContext , { } ) as ErrorTestWorkflow ;
234
243
const event = { payload : { } , timestamp : new Date ( ) , instanceId : INSTANCE_ID } ;
@@ -367,7 +376,12 @@ describe('workflows', () => {
367
376
] ) ;
368
377
} ) ;
369
378
370
- test ( 'Sampled random via instanceId' , async ( ) => {
379
+ test ( 'Sampled random via instanceId' , async ctx => {
380
+ if ( NODE_MAJOR_VERSION < 20 ) {
381
+ ctx . skip ( ) ;
382
+ return ;
383
+ }
384
+
371
385
const TestWorkflowInstrumented = instrumentWorkflowWithSentry (
372
386
// Override the tracesSampleRate to 0.4 to be below the sampleRand
373
387
// calculated from the instanceId
0 commit comments