Skip to content

Commit affa500

Browse files
committed
Merge pull request #111 from patrickkettner/use-isArray
use isArray rather than toString
2 parents 1a5bf90 + 74dc47a commit affa500

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function launchBrowser(browser, path) {
177177

178178
function launchBrowsers(config, browser) {
179179
setTimeout(function () {
180-
if (Object.prototype.toString.call(config.test_path) === '[object Array]'){
180+
if (Array.isArray(config.test_path)){
181181
config.multipleTest = config.test_path.length > 1? true : false;
182182
launchBrowser(browser, config.test_path[0]);
183183
} else {
@@ -276,7 +276,7 @@ function runTests() {
276276
launchServer();
277277
tunnel = new Tunnel(config.key, serverPort, config.tunnelIdentifier, function () {
278278
statusPoller.start();
279-
var total_runs = config.browsers.length * (Object.prototype.toString.call(config.test_path) === '[object Array]' ? config.test_path.length : 1);
279+
var total_runs = config.browsers.length * (Array.isArray(config.test_path) ? config.test_path.length : 1);
280280
logger.info('Launching ' + config.browsers.length + ' worker(s) for ' + total_runs + ' run(s).');
281281
browsers.forEach(function(browser) {
282282
if (browser.browser_version === 'latest') {

lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var formatPath = function(path) {
7373

7474
config.tunnelIdentifier = process.env.TUNNEL_ID || process.env.TRAVIS_JOB_ID || process.env.TRAVIS_BUILD_ID;
7575

76-
if (Object.prototype.toString.call(config.test_path) === '[object Array]') {
76+
if (Array.isArray(config.test_path)) {
7777
config.test_path.forEach(function(path) {
7878
path = formatPath(path);
7979
});

0 commit comments

Comments
 (0)