Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Fix allocation test
  • Loading branch information
mrousavy committed Mar 3, 2026
commit 5c6370a5e85aefe369ff762179232cc430ef446a
16 changes: 14 additions & 2 deletions example/src/getTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,22 @@ export function getTests(

const currentAllocations =
NitroModules.debug_getTotalAllocatedHybridObjects()
return baselineAllocations === currentAllocations
const result: {
baselineAllocations: number
currentAllocations: number
isEqual?: boolean
} = {
baselineAllocations: baselineAllocations,
currentAllocations: currentAllocations,
isEqual: baselineAllocations === currentAllocations,
}
if (baselineAllocations !== currentAllocations) {
delete result.isEqual
}
return result
})
.didNotThrow()
.equals(true)
.toContain('isEqual')
),
createTest('callWithOptional(undefined)', async () =>
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void HybridNitroModulesProxy::loadHybridMethods() {
prototype.registerHybridGetter("buildType", &HybridNitroModulesProxy::getBuildType);
prototype.registerHybridGetter("version", &HybridNitroModulesProxy::getVersion);

prototype.registerHybridGetter("debug_getTotalAllocatedHybridObjects", &HybridNitroModulesProxy::debug_getTotalAllocatedHybridObjects);
prototype.registerHybridMethod("debug_getTotalAllocatedHybridObjects", &HybridNitroModulesProxy::debug_getTotalAllocatedHybridObjects);
});
}

Expand Down
Loading