Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "guacamole", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "A friendly wrapper for the SauceLabs browser listing API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -443,2 +443,17 @@ var Q = require("q"); | ||
addNormalizedBrowsersFromFile: function (filePath) { | ||
var self = this; | ||
filePath = path.resolve(filePath); | ||
try { | ||
var data = JSON.parse(fs.readFileSync(filePath, "utf8")); | ||
if (_.isArray(data)) { | ||
data.forEach(function (normalizedBrowser) { | ||
browsers.push(normalizedBrowser); | ||
}); | ||
} | ||
} catch (e) { | ||
throw new Error("Could not read file for additional devices/browsers at : " + filePath); | ||
} | ||
}, | ||
// Return a promise that we'll build a list of supported browsers | ||
@@ -445,0 +460,0 @@ initialize: function () { |
@@ -44,2 +44,10 @@ var Browsers = require("../src/browsers"); | ||
it("Adds an additional unlisted device from a file", function () { | ||
Browsers.addNormalizedBrowsersFromFile(path.resolve("./test_support/device_additions.json")); | ||
var result = Browsers.get({ | ||
"id": "iphone6_device" | ||
}); | ||
expect(result).to.have.length(1); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
1116581
18
29794