Skip to content

Commit 246ea11

Browse files
committed
woops
1 parent 2cafb72 commit 246ea11

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/tracing/test/testutils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,17 @@ export function getSymbolObjectKeyByName(obj: Record<string | symbol, any>, desc
4242

4343
return matches[0] || undefined;
4444
}
45+
46+
export const testOnlyIfNodeVersionAtLeast = (minVersion: number): jest.It => {
47+
const currentNodeVersion = process.env.NODE_VERSION;
48+
49+
try {
50+
if (Number(currentNodeVersion?.split('.')[0]) < minVersion) {
51+
return it.skip;
52+
}
53+
} catch (oO) {
54+
// we can't tell, so err on the side of running the test
55+
}
56+
57+
return it;
58+
};

0 commit comments

Comments
 (0)