| 
									
										
										
										
											2018-09-11 18:11:32 -07:00
										 |  |  | load("//tools:defaults.bzl", "jasmine_node_test", "nodejs_binary", "ts_library") | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | exports_files(["package.json"]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # The tests in this package must run in separate targets, since they change | 
					
						
							|  |  |  | # working directory and therefore have mutable global state that causes test | 
					
						
							|  |  |  | # isolation failures. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ts_library( | 
					
						
							|  |  |  |     name = "core_spec_lib", | 
					
						
							|  |  |  |     testonly = True, | 
					
						
							|  |  |  |     srcs = ["core_package.spec.ts"], | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     deps = [ | 
					
						
							|  |  |  |         "//packages:types", | 
					
						
							| 
									
										
										
										
											2018-11-27 14:43:47 -08:00
										 |  |  |         "//packages/private/testing", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//@types/shelljs", | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | jasmine_node_test( | 
					
						
							|  |  |  |     name = "core_package", | 
					
						
							|  |  |  |     srcs = [":core_spec_lib"], | 
					
						
							|  |  |  |     data = [ | 
					
						
							|  |  |  |         "//packages/core:npm_package", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//@types/shelljs", | 
					
						
							|  |  |  |         "@npm//shelljs", | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2020-05-06 18:39:42 +02:00
										 |  |  |     # The "ng_package" rule currently does not properly handle flat module | 
					
						
							|  |  |  |     # bundles which the common package tests rely on. We temporarily disable | 
					
						
							|  |  |  |     # this test until we fix `ng_package` for Ivy. Tracked with: FW-2144. | 
					
						
							|  |  |  |     tags = ["fixme-ivy-aot"], | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ts_library( | 
					
						
							|  |  |  |     name = "common_spec_lib", | 
					
						
							|  |  |  |     testonly = True, | 
					
						
							|  |  |  |     srcs = ["common_package.spec.ts"], | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     deps = [ | 
					
						
							|  |  |  |         "//packages:types", | 
					
						
							| 
									
										
										
										
											2018-12-25 23:16:56 +01:00
										 |  |  |         "//packages/private/testing", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//@types/shelljs", | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | jasmine_node_test( | 
					
						
							|  |  |  |     name = "common_package", | 
					
						
							|  |  |  |     srcs = [":common_spec_lib"], | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     data = [ | 
					
						
							|  |  |  |         "//packages/common:npm_package", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//shelljs", | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2020-05-06 18:39:42 +02:00
										 |  |  |     # The "ng_package" rule currently does not properly handle flat module | 
					
						
							|  |  |  |     # bundles which the common package tests rely on. We temporarily disable | 
					
						
							|  |  |  |     # this test until we fix `ng_package` for Ivy. Tracked with: FW-2144. | 
					
						
							|  |  |  |     tags = ["fixme-ivy-aot"], | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2018-02-28 06:51:40 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ts_library( | 
					
						
							|  |  |  |     name = "example_spec_lib", | 
					
						
							| 
									
										
										
										
											2018-08-14 16:18:26 -07:00
										 |  |  |     testonly = True, | 
					
						
							| 
									
										
										
										
											2018-02-28 06:51:40 -08:00
										 |  |  |     srcs = ["example_package.spec.ts"], | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     deps = [ | 
					
						
							|  |  |  |         "//packages:types", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//@types/diff", | 
					
						
							| 
									
										
										
										
											2018-10-04 13:14:14 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-02-28 06:51:40 -08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | jasmine_node_test( | 
					
						
							|  |  |  |     name = "example_package", | 
					
						
							|  |  |  |     srcs = [":example_spec_lib"], | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |     data = [ | 
					
						
							|  |  |  |         "example_package.golden", | 
					
						
							| 
									
										
										
										
											2019-09-11 22:21:34 +02:00
										 |  |  |         "example_with_ts_library_package.golden", | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |         "//packages/bazel/test/ng_package/example:npm_package", | 
					
						
							| 
									
										
										
										
											2019-09-11 22:21:34 +02:00
										 |  |  |         "//packages/bazel/test/ng_package/example-with-ts-library:npm_package", | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-12-25 23:16:56 +01:00
										 |  |  |     # We don't want to run the example_package golden test with Ivy yet. Currently the golden | 
					
						
							|  |  |  |     # file is based on non-ivy output and therefore won't work for ngc and Ivy at the same time. | 
					
						
							|  |  |  |     # TODO: We should be able to have another golden for ivy-aot as well. | 
					
						
							|  |  |  |     tags = ["no-ivy-aot"], | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |     deps = ["@npm//diff"], | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | nodejs_binary( | 
					
						
							|  |  |  |     name = "example_package.accept", | 
					
						
							| 
									
										
										
										
											2018-08-14 16:18:26 -07:00
										 |  |  |     testonly = True, | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |     data = [ | 
					
						
							| 
									
										
										
										
											2018-12-25 23:16:56 +01:00
										 |  |  |         "example_package.golden", | 
					
						
							| 
									
										
										
										
											2019-09-11 22:21:34 +02:00
										 |  |  |         "example_with_ts_library_package.golden", | 
					
						
							| 
									
										
										
										
											2018-12-25 23:16:56 +01:00
										 |  |  |         ":example_spec_lib", | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |         "//packages/bazel/test/ng_package/example:npm_package", | 
					
						
							| 
									
										
										
										
											2019-09-11 22:21:34 +02:00
										 |  |  |         "//packages/bazel/test/ng_package/example-with-ts-library:npm_package", | 
					
						
							| 
									
										
										
										
											2019-02-20 09:54:42 -08:00
										 |  |  |         "@npm//diff", | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2019-06-07 13:38:06 -07:00
										 |  |  |     entry_point = ":example_package.spec.ts", | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |     templated_args = ["--accept"], | 
					
						
							| 
									
										
										
										
											2018-02-28 06:51:40 -08:00
										 |  |  | ) |