| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | set -u -e -o pipefail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # This script runs unit tests from angular/material2. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Save the dir for the root of the Angular repo. | 
					
						
							|  |  |  | angular_dir=$(pwd) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-18 19:25:19 +01:00
										 |  |  | # Switch into Material directory. | 
					
						
							|  |  |  | cd ${MATERIAL_REPO_TMP_DIR} | 
					
						
							| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Install this version of Angular into the freshly cloned repo. | 
					
						
							| 
									
										
										
										
											2019-03-18 19:25:19 +01:00
										 |  |  | rm -rf ./node_modules/@angular/* | 
					
						
							|  |  |  | cp -r ${angular_dir}/dist/packages-dist-ivy-aot/* ./node_modules/@angular/ | 
					
						
							| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-18 19:25:19 +01:00
										 |  |  | # The angular/material2 CI sets TEST_PLATFORM to either "local", "saucelabs", or "browserstack". | 
					
						
							|  |  |  | # For angular/angular, we only want to run the "local" tests. | 
					
						
							| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | export TEST_PLATFORM=local | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-05 10:48:18 -08:00
										 |  |  | # Append the test blocklist into angular/material2's karma-test-shim.js. | 
					
						
							| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | # This filters out known-failing tests because the goal is to prevent regressions. | 
					
						
							| 
									
										
										
										
											2019-03-18 19:25:19 +01:00
										 |  |  | cat ${angular_dir}/tools/material-ci/angular_material_test_blocklist.js >> ./test/karma-test-shim.js | 
					
						
							| 
									
										
										
										
											2019-01-14 17:47:39 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Now actually run the tests. | 
					
						
							|  |  |  | yarn gulp test:single-run |