| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 /* eslint-env node */ |
| 19 |
| 18 "use strict"; | 20 "use strict"; |
| 19 | 21 |
| 20 let childProcess = require("child_process"); | 22 const childProcess = require("child_process"); |
| 21 let fs = require("fs"); | 23 const fs = require("fs"); |
| 22 let nodeunit = require("nodeunit"); | 24 const nodeunit = require("nodeunit"); |
| 23 let path = require("path"); | 25 const path = require("path"); |
| 24 let phantomjs = require("phantomjs2"); | 26 const phantomjs = require("phantomjs2"); |
| 25 let process = require("process"); | 27 const process = require("process"); |
| 26 let url = require("url"); | 28 const url = require("url"); |
| 27 | 29 |
| 28 let unitFiles = []; | 30 let unitFiles = []; |
| 29 let browserFiles = []; | 31 let browserFiles = []; |
| 30 function addTestPaths(testPaths, recurse) | 32 function addTestPaths(testPaths, recurse) |
| 31 { | 33 { |
| 32 for (let testPath of testPaths) | 34 for (let testPath of testPaths) |
| 33 { | 35 { |
| 34 let stat = fs.statSync(testPath); | 36 let stat = fs.statSync(testPath); |
| 35 if (stat.isDirectory()) | 37 if (stat.isDirectory()) |
| 36 { | 38 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 protocol: "file", | 78 protocol: "file", |
| 77 slashes: "true", | 79 slashes: "true", |
| 78 pathname: path.resolve(process.cwd, file).split(path.sep).join("/") | 80 pathname: path.resolve(process.cwd, file).split(path.sep).join("/") |
| 79 }); | 81 }); |
| 80 }); | 82 }); |
| 81 let args = [path.join(__dirname, "browsertests.js")].concat(urls); | 83 let args = [path.join(__dirname, "browsertests.js")].concat(urls); |
| 82 childProcess.execFileSync(phantomjs.path, args, {stdio: "inherit"}); | 84 childProcess.execFileSync(phantomjs.path, args, {stdio: "inherit"}); |
| 83 } | 85 } |
| 84 if (unitFiles.length) | 86 if (unitFiles.length) |
| 85 nodeunit.reporters.default.run(unitFiles); | 87 nodeunit.reporters.default.run(unitFiles); |
| OLD | NEW |