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

@@ -30,16 +30,21 @@ function temperature(base = 18, sineCoefficient = 2, offset = 0) {
return String(Math.round(temp * 100) / 100)
}
export function stop() {
export function stopUpdates() {
for (const interval of intervals) {
clearInterval(interval)
}
intervals = []
}
export function stop() {
stopUpdates()
try {
client && client.end()
} catch {}
}
const intervals: any = []
let intervals: any = []
function generateData(client: mqtt.MqttClient) {
client.publish('livingroom/lamp/state', 'on', { retain: true, qos: 0 })