| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 memoryFS.unlinkSync("/" + bundleFilename); | 112 memoryFS.unlinkSync("/" + bundleFilename); |
| 113 resolve(bundle); | 113 resolve(bundle); |
| 114 } | 114 } |
| 115 }); | 115 }); |
| 116 }); | 116 }); |
| 117 } | 117 } |
| 118 | 118 |
| 119 function runBrowserTests(processes) | 119 function runBrowserTests(processes) |
| 120 { | 120 { |
| 121 if (!browserFiles.length) | 121 if (!browserFiles.length) |
| 122 return; | 122 return Promise.resolve(); |
| 123 | 123 |
| 124 let nodeunitPath = path.join(__dirname, "node_modules", "nodeunit", | 124 let nodeunitPath = path.join(__dirname, "node_modules", "nodeunit", |
| 125 "examples", "browser", "nodeunit.js"); | 125 "examples", "browser", "nodeunit.js"); |
| 126 let bundleFilename = "bundle.js"; | 126 let bundleFilename = "bundle.js"; |
| 127 | 127 |
| 128 return webpackInMemory(bundleFilename, { | 128 return webpackInMemory(bundleFilename, { |
| 129 entry: path.join(__dirname, "test", "browser", "_bootstrap.js"), | 129 entry: path.join(__dirname, "test", "browser", "_bootstrap.js"), |
| 130 module: { | 130 module: { |
| 131 rules: [{ | 131 rules: [{ |
| 132 resource: nodeunitPath, | 132 resource: nodeunitPath, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 runBrowserTests(runnerProcesses).then(() => | 179 runBrowserTests(runnerProcesses).then(() => |
| 180 { | 180 { |
| 181 if (unitFiles.length) | 181 if (unitFiles.length) |
| 182 nodeunit.reporters.default.run(unitFiles); | 182 nodeunit.reporters.default.run(unitFiles); |
| 183 }).catch(error => | 183 }).catch(error => |
| 184 { | 184 { |
| 185 console.error(error); | 185 console.error(error); |
| 186 process.exit(1); | 186 process.exit(1); |
| 187 }); | 187 }); |
| OLD | NEW |