| 
									
										
										
										
											2018-08-27 13:31:38 +03:00
										 |  |  | // We can't use `import...from` here, because of the following mess:
 | 
					
						
							|  |  |  | // - GitHub project `jasmine/jasmine` is `jasmine-core` on npm and its typings `@types/jasmine`.
 | 
					
						
							|  |  |  | // - GitHub project `jasmine/jasmine-npm` is `jasmine` on npm and has no typings.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Using `import...from 'jasmine'` here, would import from `@types/jasmine` (which refers to the
 | 
					
						
							|  |  |  | // `jasmine-core` module and the `jasmine` module).
 | 
					
						
							|  |  |  | import Jasmine = require('jasmine'); | 
					
						
							| 
									
										
										
										
											2018-08-27 14:56:56 +03:00
										 |  |  | import 'source-map-support/register'; | 
					
						
							| 
									
										
										
										
											2018-08-27 13:31:38 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | export const runTests = (specFiles: string[]) => { | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  |   const config = { | 
					
						
							|  |  |  |     random: true, | 
					
						
							|  |  |  |     spec_files: specFiles, | 
					
						
							|  |  |  |     stopSpecOnExpectationFailure: true, | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   process.on('unhandledRejection', (reason: any) => console.log('Unhandled rejection:', reason)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-27 13:31:38 +03:00
										 |  |  |   const runner = new Jasmine({}); | 
					
						
							| 
									
										
										
										
											2017-02-06 20:40:28 +02:00
										 |  |  |   runner.loadConfig(config); | 
					
						
							|  |  |  |   runner.onComplete((passed: boolean) => process.exit(passed ? 0 : 1)); | 
					
						
							|  |  |  |   runner.execute(); | 
					
						
							|  |  |  | }; |