| 
									
										
										
										
											2017-01-18 17:08:00 +08:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const path = require("path"); | 
					
						
							| 
									
										
										
										
											2019-06-11 19:09:42 +08:00
										 |  |  | const fs = require("graceful-fs"); | 
					
						
							| 
									
										
										
										
											2017-01-18 17:08:00 +08:00
										 |  |  | const vm = require("vm"); | 
					
						
							| 
									
										
										
										
											2018-05-17 23:29:07 +08:00
										 |  |  | const rimraf = require("rimraf"); | 
					
						
							| 
									
										
										
										
											2017-01-18 17:08:00 +08:00
										 |  |  | const checkArrayExpectation = require("./checkArrayExpectation"); | 
					
						
							| 
									
										
										
										
											2018-08-02 19:05:48 +08:00
										 |  |  | const createLazyTestEnv = require("./helpers/createLazyTestEnv"); | 
					
						
							| 
									
										
										
										
											2019-12-18 00:18:52 +08:00
										 |  |  | const deprecationTracking = require("./helpers/deprecationTracking"); | 
					
						
							| 
									
										
										
										
											2018-06-04 23:49:55 +08:00
										 |  |  | const FakeDocument = require("./helpers/FakeDocument"); | 
					
						
							| 
									
										
										
										
											2014-06-18 04:34:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-09 21:26:35 +08:00
										 |  |  | const webpack = require(".."); | 
					
						
							| 
									
										
										
										
											2018-04-15 03:46:33 +08:00
										 |  |  | const prepareOptions = require("./helpers/prepareOptions"); | 
					
						
							| 
									
										
										
										
											2014-06-18 04:34:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 17:08:00 +08:00
										 |  |  | describe("ConfigTestCases", () => { | 
					
						
							|  |  |  | 	const casesPath = path.join(__dirname, "configCases"); | 
					
						
							|  |  |  | 	let categories = fs.readdirSync(casesPath); | 
					
						
							| 
									
										
										
										
											2016-12-08 16:39:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-09 03:37:12 +08:00
										 |  |  | 	jest.setTimeout(20000); | 
					
						
							| 
									
										
										
										
											2018-05-18 22:34:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 	categories = categories.map(cat => { | 
					
						
							| 
									
										
										
										
											2014-06-18 04:34:30 +08:00
										 |  |  | 		return { | 
					
						
							|  |  |  | 			name: cat, | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 			tests: fs | 
					
						
							|  |  |  | 				.readdirSync(path.join(casesPath, cat)) | 
					
						
							|  |  |  | 				.filter(folder => { | 
					
						
							|  |  |  | 					return folder.indexOf("_") < 0; | 
					
						
							|  |  |  | 				}) | 
					
						
							|  |  |  | 				.sort() | 
					
						
							|  |  |  | 				.filter(testName => { | 
					
						
							|  |  |  | 					const testDirectory = path.join(casesPath, cat, testName); | 
					
						
							|  |  |  | 					const filterPath = path.join(testDirectory, "test.filter.js"); | 
					
						
							|  |  |  | 					if (fs.existsSync(filterPath) && !require(filterPath)()) { | 
					
						
							| 
									
										
										
										
											2019-07-23 17:25:33 +08:00
										 |  |  | 						describe.skip(testName, () => { | 
					
						
							|  |  |  | 							it("filtered", () => {}); | 
					
						
							|  |  |  | 						}); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 						return false; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 					return true; | 
					
						
							|  |  |  | 				}) | 
					
						
							| 
									
										
										
										
											2016-12-23 14:10:06 +08:00
										 |  |  | 		}; | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 	categories.forEach(category => { | 
					
						
							| 
									
										
										
										
											2017-01-18 17:08:00 +08:00
										 |  |  | 		describe(category.name, () => { | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 			category.tests.forEach(testName => { | 
					
						
							| 
									
										
										
										
											2020-03-29 06:10:15 +08:00
										 |  |  | 				describe(testName, function () { | 
					
						
							| 
									
										
										
										
											2018-02-25 08:16:11 +08:00
										 |  |  | 					const testDirectory = path.join(casesPath, category.name, testName); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 					const outputDirectory = path.join( | 
					
						
							|  |  |  | 						__dirname, | 
					
						
							|  |  |  | 						"js", | 
					
						
							|  |  |  | 						"config", | 
					
						
							|  |  |  | 						category.name, | 
					
						
							|  |  |  | 						testName | 
					
						
							|  |  |  | 					); | 
					
						
							| 
									
										
										
										
											2018-03-06 05:48:18 +08:00
										 |  |  | 					it( | 
					
						
							|  |  |  | 						testName + " should compile", | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 						() => | 
					
						
							|  |  |  | 							new Promise((resolve, reject) => { | 
					
						
							|  |  |  | 								const done = err => { | 
					
						
							|  |  |  | 									if (err) return reject(err); | 
					
						
							|  |  |  | 									resolve(); | 
					
						
							| 
									
										
										
										
											2018-01-27 05:26:41 +08:00
										 |  |  | 								}; | 
					
						
							| 
									
										
										
										
											2018-05-17 23:29:07 +08:00
										 |  |  | 								rimraf.sync(outputDirectory); | 
					
						
							| 
									
										
										
										
											2020-01-13 23:29:12 +08:00
										 |  |  | 								fs.mkdirSync(outputDirectory, { recursive: true }); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 								const options = prepareOptions( | 
					
						
							|  |  |  | 									require(path.join(testDirectory, "webpack.config.js")), | 
					
						
							|  |  |  | 									{ testPath: outputDirectory } | 
					
						
							|  |  |  | 								); | 
					
						
							|  |  |  | 								const optionsArr = [].concat(options); | 
					
						
							|  |  |  | 								optionsArr.forEach((options, idx) => { | 
					
						
							|  |  |  | 									if (!options.context) options.context = testDirectory; | 
					
						
							|  |  |  | 									if (!options.mode) options.mode = "production"; | 
					
						
							|  |  |  | 									if (!options.optimization) options.optimization = {}; | 
					
						
							|  |  |  | 									if (options.optimization.minimize === undefined) | 
					
						
							|  |  |  | 										options.optimization.minimize = false; | 
					
						
							|  |  |  | 									if (!options.entry) options.entry = "./index.js"; | 
					
						
							|  |  |  | 									if (!options.target) options.target = "async-node"; | 
					
						
							|  |  |  | 									if (!options.output) options.output = {}; | 
					
						
							|  |  |  | 									if (!options.output.path) | 
					
						
							|  |  |  | 										options.output.path = outputDirectory; | 
					
						
							|  |  |  | 									if (typeof options.output.pathinfo === "undefined") | 
					
						
							|  |  |  | 										options.output.pathinfo = true; | 
					
						
							|  |  |  | 									if (!options.output.filename) | 
					
						
							|  |  |  | 										options.output.filename = "bundle" + idx + ".js"; | 
					
						
							|  |  |  | 								}); | 
					
						
							|  |  |  | 								let testConfig = { | 
					
						
							| 
									
										
										
										
											2020-03-29 06:10:15 +08:00
										 |  |  | 									findBundle: function (i, options) { | 
					
						
							| 
									
										
										
										
											2018-09-06 09:41:39 +08:00
										 |  |  | 										const ext = path.extname(options.output.filename); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 										if ( | 
					
						
							|  |  |  | 											fs.existsSync( | 
					
						
							| 
									
										
										
										
											2018-09-06 09:41:39 +08:00
										 |  |  | 												path.join(options.output.path, "bundle" + i + ext) | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 											) | 
					
						
							|  |  |  | 										) { | 
					
						
							| 
									
										
										
										
											2018-09-06 09:41:39 +08:00
										 |  |  | 											return "./bundle" + i + ext; | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 										} | 
					
						
							|  |  |  | 									}, | 
					
						
							|  |  |  | 									timeout: 30000 | 
					
						
							|  |  |  | 								}; | 
					
						
							|  |  |  | 								try { | 
					
						
							|  |  |  | 									// try to load a test file
 | 
					
						
							|  |  |  | 									testConfig = Object.assign( | 
					
						
							|  |  |  | 										testConfig, | 
					
						
							|  |  |  | 										require(path.join(testDirectory, "test.config.js")) | 
					
						
							|  |  |  | 									); | 
					
						
							| 
									
										
										
										
											2018-03-06 05:48:18 +08:00
										 |  |  | 								} catch (e) { | 
					
						
							|  |  |  | 									// ignored
 | 
					
						
							|  |  |  | 								} | 
					
						
							| 
									
										
										
										
											2018-08-02 19:05:48 +08:00
										 |  |  | 								if (testConfig.timeout) setDefaultTimeout(testConfig.timeout); | 
					
						
							| 
									
										
										
										
											2015-08-09 18:42:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-18 00:18:52 +08:00
										 |  |  | 								const deprecationTracker = deprecationTracking.start(); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 								webpack(options, (err, stats) => { | 
					
						
							|  |  |  | 									if (err) { | 
					
						
							|  |  |  | 										const fakeStats = { | 
					
						
							| 
									
										
										
										
											2018-12-19 01:29:12 +08:00
										 |  |  | 											errors: [ | 
					
						
							|  |  |  | 												{ | 
					
						
							|  |  |  | 													message: err.message, | 
					
						
							|  |  |  | 													stack: err.stack | 
					
						
							|  |  |  | 												} | 
					
						
							|  |  |  | 											] | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 										}; | 
					
						
							|  |  |  | 										if ( | 
					
						
							|  |  |  | 											checkArrayExpectation( | 
					
						
							|  |  |  | 												testDirectory, | 
					
						
							|  |  |  | 												fakeStats, | 
					
						
							|  |  |  | 												"error", | 
					
						
							|  |  |  | 												"Error", | 
					
						
							|  |  |  | 												done | 
					
						
							|  |  |  | 											) | 
					
						
							|  |  |  | 										) | 
					
						
							|  |  |  | 											return; | 
					
						
							|  |  |  | 										// Wait for uncaught errors to occur
 | 
					
						
							|  |  |  | 										return setTimeout(done, 200); | 
					
						
							| 
									
										
										
										
											2018-01-27 05:26:41 +08:00
										 |  |  | 									} | 
					
						
							| 
									
										
										
										
											2018-12-19 01:29:12 +08:00
										 |  |  | 									const statOptions = { | 
					
						
							|  |  |  | 										preset: "verbose", | 
					
						
							|  |  |  | 										colors: false | 
					
						
							|  |  |  | 									}; | 
					
						
							| 
									
										
										
										
											2020-01-13 23:29:12 +08:00
										 |  |  | 									fs.mkdirSync(outputDirectory, { recursive: true }); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 									fs.writeFileSync( | 
					
						
							|  |  |  | 										path.join(outputDirectory, "stats.txt"), | 
					
						
							|  |  |  | 										stats.toString(statOptions), | 
					
						
							|  |  |  | 										"utf-8" | 
					
						
							|  |  |  | 									); | 
					
						
							|  |  |  | 									const jsonStats = stats.toJson({ | 
					
						
							|  |  |  | 										errorDetails: true | 
					
						
							|  |  |  | 									}); | 
					
						
							| 
									
										
										
										
											2018-12-19 01:29:12 +08:00
										 |  |  | 									fs.writeFileSync( | 
					
						
							|  |  |  | 										path.join(outputDirectory, "stats.json"), | 
					
						
							|  |  |  | 										JSON.stringify(jsonStats, null, 2), | 
					
						
							|  |  |  | 										"utf-8" | 
					
						
							|  |  |  | 									); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 									if ( | 
					
						
							|  |  |  | 										checkArrayExpectation( | 
					
						
							|  |  |  | 											testDirectory, | 
					
						
							|  |  |  | 											jsonStats, | 
					
						
							|  |  |  | 											"error", | 
					
						
							|  |  |  | 											"Error", | 
					
						
							|  |  |  | 											done | 
					
						
							|  |  |  | 										) | 
					
						
							|  |  |  | 									) | 
					
						
							|  |  |  | 										return; | 
					
						
							|  |  |  | 									if ( | 
					
						
							|  |  |  | 										checkArrayExpectation( | 
					
						
							|  |  |  | 											testDirectory, | 
					
						
							|  |  |  | 											jsonStats, | 
					
						
							|  |  |  | 											"warning", | 
					
						
							|  |  |  | 											"Warning", | 
					
						
							|  |  |  | 											done | 
					
						
							|  |  |  | 										) | 
					
						
							|  |  |  | 									) | 
					
						
							|  |  |  | 										return; | 
					
						
							| 
									
										
										
										
											2019-12-18 00:18:52 +08:00
										 |  |  | 									const deprecations = deprecationTracker(); | 
					
						
							|  |  |  | 									if ( | 
					
						
							|  |  |  | 										checkArrayExpectation( | 
					
						
							|  |  |  | 											testDirectory, | 
					
						
							|  |  |  | 											{ deprecations }, | 
					
						
							|  |  |  | 											"deprecation", | 
					
						
							|  |  |  | 											"Deprecation", | 
					
						
							|  |  |  | 											done | 
					
						
							|  |  |  | 										) | 
					
						
							|  |  |  | 									) | 
					
						
							|  |  |  | 										return; | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 									const globalContext = { | 
					
						
							|  |  |  | 										console: console, | 
					
						
							| 
									
										
										
										
											2018-04-19 01:54:24 +08:00
										 |  |  | 										expect: expect, | 
					
						
							|  |  |  | 										setTimeout: setTimeout, | 
					
						
							| 
									
										
										
										
											2018-06-04 23:49:55 +08:00
										 |  |  | 										clearTimeout: clearTimeout, | 
					
						
							| 
									
										
										
										
											2018-06-28 17:03:08 +08:00
										 |  |  | 										document: new FakeDocument(), | 
					
						
							|  |  |  | 										location: { | 
					
						
							|  |  |  | 											href: "https://test.cases/path/index.html", | 
					
						
							|  |  |  | 											origin: "https://test.cases", | 
					
						
							|  |  |  | 											toString() { | 
					
						
							|  |  |  | 												return "https://test.cases/path/index.html"; | 
					
						
							|  |  |  | 											} | 
					
						
							|  |  |  | 										} | 
					
						
							| 
									
										
										
										
											2018-01-27 05:26:41 +08:00
										 |  |  | 									}; | 
					
						
							| 
									
										
										
										
											2016-06-16 05:25:40 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-17 07:43:45 +08:00
										 |  |  | 									const requireCache = Object.create(null); | 
					
						
							| 
									
										
										
										
											2018-11-29 22:45:08 +08:00
										 |  |  | 									function _require(currentDirectory, options, module) { | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 										if (Array.isArray(module) || /^\.\.?\//.test(module)) { | 
					
						
							|  |  |  | 											let content; | 
					
						
							|  |  |  | 											let p; | 
					
						
							|  |  |  | 											if (Array.isArray(module)) { | 
					
						
							| 
									
										
										
										
											2020-01-16 22:17:34 +08:00
										 |  |  | 												p = path.join(currentDirectory, ".array-require.js"); | 
					
						
							|  |  |  | 												content = `module.exports = (${module | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 													.map(arg => { | 
					
						
							| 
									
										
										
										
											2020-01-16 22:17:34 +08:00
										 |  |  | 														return `require(${JSON.stringify(`./${arg}`)})`; | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 													}) | 
					
						
							| 
									
										
										
										
											2020-01-16 22:17:34 +08:00
										 |  |  | 													.join(", ")});`;
 | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 											} else { | 
					
						
							|  |  |  | 												p = path.join(currentDirectory, module); | 
					
						
							|  |  |  | 												content = fs.readFileSync(p, "utf-8"); | 
					
						
							|  |  |  | 											} | 
					
						
							| 
									
										
										
										
											2020-04-17 07:43:45 +08:00
										 |  |  | 											if (p in requireCache) { | 
					
						
							|  |  |  | 												return requireCache[p].exports; | 
					
						
							|  |  |  | 											} | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 											const m = { | 
					
						
							|  |  |  | 												exports: {} | 
					
						
							|  |  |  | 											}; | 
					
						
							| 
									
										
										
										
											2020-04-17 07:43:45 +08:00
										 |  |  | 											requireCache[p] = m; | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 											let runInNewContext = false; | 
					
						
							|  |  |  | 											const moduleScope = { | 
					
						
							| 
									
										
										
										
											2019-05-10 03:34:28 +08:00
										 |  |  | 												require: _require.bind(null, path.dirname(p), options), | 
					
						
							| 
									
										
										
										
											2019-06-21 15:15:49 +08:00
										 |  |  | 												importScripts: _require.bind( | 
					
						
							|  |  |  | 													null, | 
					
						
							|  |  |  | 													path.dirname(p), | 
					
						
							|  |  |  | 													options | 
					
						
							|  |  |  | 												), | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 												module: m, | 
					
						
							|  |  |  | 												exports: m.exports, | 
					
						
							|  |  |  | 												__dirname: path.dirname(p), | 
					
						
							|  |  |  | 												__filename: p, | 
					
						
							|  |  |  | 												it: _it, | 
					
						
							|  |  |  | 												beforeEach: _beforeEach, | 
					
						
							|  |  |  | 												afterEach: _afterEach, | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 												expect, | 
					
						
							| 
									
										
										
										
											2018-05-07 21:26:04 +08:00
										 |  |  | 												jest, | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 												_globalAssign: { expect }, | 
					
						
							| 
									
										
										
										
											2019-05-22 19:07:10 +08:00
										 |  |  | 												__STATS__: jsonStats, | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 												nsObj: m => { | 
					
						
							|  |  |  | 													Object.defineProperty(m, Symbol.toStringTag, { | 
					
						
							|  |  |  | 														value: "Module" | 
					
						
							|  |  |  | 													}); | 
					
						
							|  |  |  | 													return m; | 
					
						
							|  |  |  | 												} | 
					
						
							|  |  |  | 											}; | 
					
						
							|  |  |  | 											if ( | 
					
						
							|  |  |  | 												options.target === "web" || | 
					
						
							|  |  |  | 												options.target === "webworker" | 
					
						
							|  |  |  | 											) { | 
					
						
							|  |  |  | 												moduleScope.window = globalContext; | 
					
						
							| 
									
										
										
										
											2019-05-10 03:34:28 +08:00
										 |  |  | 												moduleScope.self = globalContext; | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 												runInNewContext = true; | 
					
						
							|  |  |  | 											} | 
					
						
							|  |  |  | 											if (testConfig.moduleScope) { | 
					
						
							|  |  |  | 												testConfig.moduleScope(moduleScope); | 
					
						
							|  |  |  | 											} | 
					
						
							|  |  |  | 											const args = Object.keys(moduleScope).join(", "); | 
					
						
							|  |  |  | 											if (!runInNewContext) | 
					
						
							|  |  |  | 												content = `Object.assign(global, _globalAssign); ${content}`; | 
					
						
							|  |  |  | 											const code = `(function({${args}}) {${content}\n})`; | 
					
						
							|  |  |  | 											const fn = runInNewContext | 
					
						
							|  |  |  | 												? vm.runInNewContext(code, globalContext, p) | 
					
						
							|  |  |  | 												: vm.runInThisContext(code, p); | 
					
						
							|  |  |  | 											fn.call(m.exports, moduleScope); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 											return m.exports; | 
					
						
							|  |  |  | 										} else if ( | 
					
						
							|  |  |  | 											testConfig.modules && | 
					
						
							|  |  |  | 											module in testConfig.modules | 
					
						
							|  |  |  | 										) { | 
					
						
							|  |  |  | 											return testConfig.modules[module]; | 
					
						
							|  |  |  | 										} else return require(module); | 
					
						
							|  |  |  | 									} | 
					
						
							|  |  |  | 									let filesCount = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 									if (testConfig.noTests) return process.nextTick(done); | 
					
						
							| 
									
										
										
										
											2019-04-10 19:48:47 +08:00
										 |  |  | 									if (testConfig.beforeExecute) testConfig.beforeExecute(); | 
					
						
							| 
									
										
										
										
											2018-12-29 19:48:59 +08:00
										 |  |  | 									const results = []; | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 									for (let i = 0; i < optionsArr.length; i++) { | 
					
						
							|  |  |  | 										const bundlePath = testConfig.findBundle(i, optionsArr[i]); | 
					
						
							|  |  |  | 										if (bundlePath) { | 
					
						
							|  |  |  | 											filesCount++; | 
					
						
							| 
									
										
										
										
											2019-02-19 15:58:46 +08:00
										 |  |  | 											results.push( | 
					
						
							|  |  |  | 												_require(outputDirectory, optionsArr[i], bundlePath) | 
					
						
							|  |  |  | 											); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 										} | 
					
						
							|  |  |  | 									} | 
					
						
							|  |  |  | 									// give a free pass to compilation that generated an error
 | 
					
						
							|  |  |  | 									if ( | 
					
						
							|  |  |  | 										!jsonStats.errors.length && | 
					
						
							|  |  |  | 										filesCount !== optionsArr.length | 
					
						
							|  |  |  | 									) | 
					
						
							|  |  |  | 										return done( | 
					
						
							|  |  |  | 											new Error( | 
					
						
							|  |  |  | 												"Should have found at least one bundle file per webpack config" | 
					
						
							|  |  |  | 											) | 
					
						
							|  |  |  | 										); | 
					
						
							| 
									
										
										
										
											2019-02-19 15:58:46 +08:00
										 |  |  | 									Promise.all(results) | 
					
						
							|  |  |  | 										.then(() => { | 
					
						
							| 
									
										
										
										
											2019-05-10 03:34:28 +08:00
										 |  |  | 											if (testConfig.afterExecute) testConfig.afterExecute(); | 
					
						
							|  |  |  | 											if (getNumberOfTests() < filesCount) { | 
					
						
							| 
									
										
										
										
											2019-02-19 15:58:46 +08:00
										 |  |  | 												return done( | 
					
						
							|  |  |  | 													new Error("No tests exported by test case") | 
					
						
							|  |  |  | 												); | 
					
						
							| 
									
										
										
										
											2019-05-10 03:34:28 +08:00
										 |  |  | 											} | 
					
						
							| 
									
										
										
										
											2019-02-19 15:58:46 +08:00
										 |  |  | 											done(); | 
					
						
							|  |  |  | 										}) | 
					
						
							|  |  |  | 										.catch(done); | 
					
						
							| 
									
										
										
										
											2018-02-25 18:46:17 +08:00
										 |  |  | 								}); | 
					
						
							|  |  |  | 							}) | 
					
						
							|  |  |  | 					); | 
					
						
							| 
									
										
										
										
											2018-08-02 19:05:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 					const { | 
					
						
							|  |  |  | 						it: _it, | 
					
						
							|  |  |  | 						beforeEach: _beforeEach, | 
					
						
							|  |  |  | 						afterEach: _afterEach, | 
					
						
							|  |  |  | 						setDefaultTimeout, | 
					
						
							|  |  |  | 						getNumberOfTests | 
					
						
							|  |  |  | 					} = createLazyTestEnv(jasmine.getEnv(), 10000); | 
					
						
							| 
									
										
										
										
											2014-06-18 04:34:30 +08:00
										 |  |  | 				}); | 
					
						
							|  |  |  | 			}); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2014-08-22 19:51:24 +08:00
										 |  |  | }); |