Add memory leak test-suite

This commit is contained in:
Thomas Nordquist
2019-04-25 13:50:15 +02:00
parent 8cd11cde3b
commit af2ff0149d
13 changed files with 700 additions and 36 deletions

View File

@@ -1,8 +1,20 @@
import * as React from 'react'
import ShowText from './ShowText'
import Mouse from './Mouse'
let heapdump: any
(window as any).demo = {}
function writeHeapdump(path?: string) {
if (!heapdump) {
heapdump = require('heapdump')
}
heapdump.writeSnapshot(path || `${Date.now()}.heapsnapshot`)
return path
}
(window as any).demo = {
writeHeapdump,
}
export default function render(props: any) {
return (