From 3b3e7cc14eda20ac6a8bbbcda08daf7826d7e2c0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 4 May 2017 13:43:45 -0700 Subject: [PATCH] Assert memory info for all returned processes --- spec/api-app-spec.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 7e2430ef3727..1bcc1a5c6223 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -538,10 +538,12 @@ describe('app module', function () { it('returns the process memory of all running electron processes', function () { const appMemoryInfo = app.getAppMemoryInfo() assert.ok(appMemoryInfo.length > 0, 'App memory info object is not > 0') - assert.ok(appMemoryInfo[0].memory.workingSetSize > 0, 'working set size is not > 0') - assert.ok(appMemoryInfo[0].memory.privateBytes > 0, 'private bytes is not > 0') - assert.ok(appMemoryInfo[0].memory.sharedBytes > 0, 'shared bytes is not > 0') - assert.ok(appMemoryInfo[0].pid > 0, 'pid is not > 0') + for (const {memory, pid} of appMemoryInfo) { + assert.ok(memory.workingSetSize > 0, 'working set size is not > 0') + assert.ok(memory.privateBytes > 0, 'private bytes is not > 0') + assert.ok(memory.sharedBytes > 0, 'shared bytes is not > 0') + assert.ok(pid > 0, 'pid is not > 0') + } }) }) })