@@ -5,6 +5,7 @@ const fs = require('fs');
5
5
const os = require ( 'os' ) ;
6
6
const path = require ( 'path' ) ;
7
7
const util = require ( 'util' ) ;
8
+ const cpus = os . cpus ( ) ;
8
9
9
10
function findReports ( pid , dir ) {
10
11
// Default filenames are of the form
@@ -98,6 +99,7 @@ function _validateContent(report) {
98
99
assert . strictEqual ( typeof header . osVersion , 'string' ) ;
99
100
assert . strictEqual ( typeof header . osMachine , 'string' ) ;
100
101
assert ( Array . isArray ( header . cpus ) ) ;
102
+ assert . strictEqual ( header . cpus . length , cpus . length ) ;
101
103
header . cpus . forEach ( ( cpu ) => {
102
104
assert . strictEqual ( typeof cpu . model , 'string' ) ;
103
105
assert . strictEqual ( typeof cpu . speed , 'number' ) ;
@@ -106,6 +108,9 @@ function _validateContent(report) {
106
108
assert . strictEqual ( typeof cpu . sys , 'number' ) ;
107
109
assert . strictEqual ( typeof cpu . idle , 'number' ) ;
108
110
assert . strictEqual ( typeof cpu . irq , 'number' ) ;
111
+ assert ( cpus . some ( ( c ) => {
112
+ return c . model === cpu . model && c . speed === cpu . speed ;
113
+ } ) ) ;
109
114
} ) ;
110
115
assert . strictEqual ( header . host , os . hostname ( ) ) ;
111
116
0 commit comments