-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node): Add app.free_memory info to events (#12150)
Adds support for https://nodejs.org/api/process.html#processavailablememory introduced with Node 22 App Context: https://develop.sentry.dev/sdk/event-payloads/contexts/#app-context ref #11455
- Loading branch information
1 parent
f3c8a86
commit 4420844
Showing
4 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { parseSemver } from '@sentry/utils'; | ||
|
||
const NODE_VERSION = parseSemver(process.versions.node).major; | ||
|
||
/** | ||
* Returns`describe` or `describe.skip` depending on allowed major versions of Node. | ||
* | ||
* @param {{ min?: number; max?: number }} allowedVersion | ||
* @return {*} {jest.Describe} | ||
*/ | ||
export const conditionalTest = (allowedVersion: { min?: number; max?: number }): jest.It => { | ||
if (!NODE_VERSION) { | ||
return it.skip; | ||
} | ||
|
||
return NODE_VERSION < (allowedVersion.min || -Infinity) || NODE_VERSION > (allowedVersion.max || Infinity) | ||
? test.skip | ||
: test; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters