Skip to content

Commit 4b7acba

Browse files
committed
Add support for min/max as in documentation at: https://github.com/marcelduran/webpagetest-api/wiki/Test-Specs
1 parent 120e137 commit 4b7acba

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/specs.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ function specsRunner(specs, reporter, callback, err, data) {
125125
path.pop();
126126
return;
127127
}
128-
if (typeof specs[key] === 'object') {
129-
traverse(specs[key], data[key]);
130-
} else if(typeof specs[key] === 'number' && Array.isArray(data[key])) {
131-
tests.push(buildTest(path.join('.'), specs[key], data[key].length, defaults));
128+
129+
var spec = specs[key];
130+
if (typeof spec === 'object' && !spec.min && !spec.max) {
131+
traverse(spec, data[key]);
132+
} else if(typeof spec === 'number' && Array.isArray(data[key])) {
133+
tests.push(buildTest(path.join('.'), spec, data[key].length, defaults));
132134
path.pop();
133135
} else {
134-
tests.push(buildTest(path.join('.'), specs[key], data[key], defaults));
136+
tests.push(buildTest(path.join('.'), spec, data[key], defaults));
135137
path.pop();
136138
}
137139
});

0 commit comments

Comments
 (0)