mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Testing bug - only the last definition of test case was checked
This commit is contained in:
parent
7234216e02
commit
676844156f
@ -14,7 +14,7 @@
|
|||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "Avant Browser",
|
"name" : "Avant ",
|
||||||
"version" : "undefined",
|
"version" : "undefined",
|
||||||
"major" : "undefined"
|
"major" : "undefined"
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; baidubrowser 1.x)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "baidubrowser",
|
"name" : "baidu",
|
||||||
"version" : "1.x",
|
"version" : "1.x",
|
||||||
"major" : "1"
|
"major" : "1"
|
||||||
}
|
}
|
||||||
@ -594,7 +594,7 @@
|
|||||||
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)",
|
"ua" : "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SlimBrowser)",
|
||||||
"expect" :
|
"expect" :
|
||||||
{
|
{
|
||||||
"name" : "SlimBrowser",
|
"name" : "Slim",
|
||||||
"version" : "undefined",
|
"version" : "undefined",
|
||||||
"major" : "undefined"
|
"major" : "undefined"
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,11 @@ for (var i in methods) {
|
|||||||
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']) {
|
for (var k in methods[i]['properties']) {
|
||||||
var m = methods[i]['properties'][k];
|
var m = methods[i]['properties'][k];
|
||||||
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
|
(function(result, expected) {
|
||||||
assert.equal(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
|
it('should return ' + methods[i]['label'] + ' ' + m + ': ' + expect[m], function () {
|
||||||
});
|
assert.equal(result, expected);
|
||||||
|
});
|
||||||
|
})(result[m], expect[m] != 'undefined' ? expect[m] : undefined);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user