UNPKG

heap-metrics

Version:

Dump heap metrics after test to be tracked over all commits for the life of the branch.

24 lines (18 loc) 542 B
var heap_metrics = require( './../build/Release/heap_metrics.node' ); var assert = require('assert'); function consume_heap() { var garbage = []; for (var i=0; i<100000; i++) { garbage.push("this is a long string to consume heap memory... lets make it a little longer... and longer still... why stop now"); } } describe('DumpHeapMetrics', function(){ it('should return true', function(){ for(var i=0;i<400;i++){ consume_heap(); } assert(heap_metrics.DumpHeapMetrics()); }); })