mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Make sure that we check for all requested properties.
Only ‘version’ was checked, because of plain for loop. Switch to forEach() and closure.
This commit is contained in:
parent
7234216e02
commit
7da36bad0b
@ -51,12 +51,12 @@ for (var i in methods) {
|
|||||||
describe('"' + methods[i]['list'][j].ua + '"', function () {
|
describe('"' + methods[i]['list'][j].ua + '"', function () {
|
||||||
var expect = methods[i]['list'][j].expect;
|
var expect = methods[i]['list'][j].expect;
|
||||||
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
|
var result = parser.setUA(methods[i]['list'][j].ua).getResult()[methods[i]['label']];
|
||||||
for (var k in methods[i]['properties']) {
|
|
||||||
var m = methods[i]['properties'][k];
|
methods[i]['properties'].forEach(function(m) {
|
||||||
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
|
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
|
||||||
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
|
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user