99from aws_lambda_builders .workflows .nodejs_npm .npm import SubprocessNpm
1010from aws_lambda_builders .workflows .nodejs_npm .utils import OSUtils
1111from aws_lambda_builders .workflows .nodejs_npm_esbuild .esbuild import EsbuildExecutionError
12- from aws_lambda_builders .workflows .nodejs_npm_esbuild .utils import EXPERIMENTAL_FLAG_ESBUILD
1312from parameterized import parameterized
1413
1514
@@ -39,20 +38,6 @@ def tearDown(self):
3938 shutil .rmtree (self .artifacts_dir )
4039 shutil .rmtree (self .scratch_dir )
4140
42- @parameterized .expand ([("nodejs12.x" ,), ("nodejs14.x" ,), ("nodejs16.x" ,)])
43- def test_doesnt_build_without_feature_flag (self , runtime ):
44- source_dir = os .path .join (self .TEST_DATA_FOLDER , "with-deps-esbuild" )
45-
46- with self .assertRaises (EsbuildExecutionError ) as context :
47- self .builder .build (
48- source_dir ,
49- self .artifacts_dir ,
50- self .scratch_dir ,
51- os .path .join (source_dir , "package.json" ),
52- runtime = runtime ,
53- )
54- self .assertEqual (str (context .exception ), "Esbuild Failed: Feature flag must be enabled to use this workflow" )
55-
5641 @parameterized .expand ([("nodejs12.x" ,), ("nodejs14.x" ,), ("nodejs16.x" ,)])
5742 def test_builds_javascript_project_with_dependencies (self , runtime ):
5843 source_dir = os .path .join (self .TEST_DATA_FOLDER , "with-deps-esbuild" )
@@ -66,8 +51,8 @@ def test_builds_javascript_project_with_dependencies(self, runtime):
6651 os .path .join (source_dir , "package.json" ),
6752 runtime = runtime ,
6853 options = options ,
54+ experimental_flags = [],
6955 executable_search_paths = [self .binpath ],
70- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
7156 )
7257
7358 expected_files = {"included.js" }
@@ -87,8 +72,8 @@ def test_builds_javascript_project_with_multiple_entrypoints(self, runtime):
8772 os .path .join (source_dir , "package.json" ),
8873 runtime = runtime ,
8974 options = options ,
75+ experimental_flags = [],
9076 executable_search_paths = [self .binpath ],
91- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
9277 )
9378
9479 expected_files = {"included.js" , "included2.js" }
@@ -108,8 +93,8 @@ def test_builds_typescript_projects(self, runtime):
10893 os .path .join (source_dir , "package.json" ),
10994 runtime = runtime ,
11095 options = options ,
96+ experimental_flags = [],
11197 executable_search_paths = [self .binpath ],
112- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
11398 )
11499
115100 expected_files = {"included.js" }
@@ -128,8 +113,8 @@ def test_builds_with_external_esbuild(self, runtime):
128113 os .path .join (source_dir , "package.json" ),
129114 runtime = runtime ,
130115 options = options ,
116+ experimental_flags = [],
131117 executable_search_paths = [self .binpath ],
132- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
133118 )
134119
135120 expected_files = {"included.js" }
@@ -147,8 +132,8 @@ def test_no_options_passed_to_esbuild(self, runtime):
147132 self .scratch_dir ,
148133 os .path .join (source_dir , "package.json" ),
149134 runtime = runtime ,
135+ experimental_flags = [],
150136 executable_search_paths = [self .binpath ],
151- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
152137 )
153138
154139 self .assertEqual (str (context .exception ), "NodejsNpmEsbuildBuilder:EsbuildBundle - entry_points not set ({})" )
@@ -166,8 +151,8 @@ def test_bundle_with_implicit_file_types(self, runtime):
166151 os .path .join (source_dir , "package.json" ),
167152 runtime = runtime ,
168153 options = options ,
154+ experimental_flags = [],
169155 executable_search_paths = [self .binpath ],
170- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
171156 )
172157
173158 expected_files = {"implicit.js" , "included.js" }
@@ -192,7 +177,7 @@ def test_bundles_project_without_dependencies(self, runtime):
192177 os .path .join (source_dir , "package.json" ),
193178 runtime = runtime ,
194179 options = options ,
195- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
180+ experimental_flags = [],
196181 executable_search_paths = [binpath ],
197182 )
198183
@@ -220,7 +205,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
220205 runtime = runtime ,
221206 dependencies_dir = self .dependencies_dir ,
222207 download_dependencies = False ,
223- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
208+ experimental_flags = [],
224209 executable_search_paths = [binpath ],
225210 )
226211
@@ -242,8 +227,8 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_
242227 options = options ,
243228 dependencies_dir = self .dependencies_dir ,
244229 download_dependencies = True ,
230+ experimental_flags = [],
245231 executable_search_paths = [self .binpath ],
246- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
247232 )
248233
249234 expected_files = {"included.js" }
@@ -273,8 +258,8 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w
273258 runtime = runtime ,
274259 dependencies_dir = None ,
275260 download_dependencies = False ,
261+ experimental_flags = [],
276262 executable_search_paths = [self .binpath ],
277- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
278263 )
279264
280265 self .assertEqual (
@@ -298,8 +283,8 @@ def test_builds_project_without_combine_dependencies(self, runtime):
298283 dependencies_dir = self .dependencies_dir ,
299284 download_dependencies = True ,
300285 combine_dependencies = False ,
286+ experimental_flags = [],
301287 executable_search_paths = [self .binpath ],
302- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
303288 )
304289
305290 expected_files = {"included.js" }
@@ -327,8 +312,8 @@ def test_builds_javascript_project_with_external(self, runtime):
327312 os .path .join (source_dir , "package.json" ),
328313 runtime = runtime ,
329314 options = options ,
315+ experimental_flags = [],
330316 executable_search_paths = [self .binpath ],
331- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
332317 )
333318
334319 expected_files = {"included.js" }
@@ -353,8 +338,8 @@ def test_builds_javascript_project_with_loader(self, runtime):
353338 os .path .join (source_dir , "package.json" ),
354339 runtime = runtime ,
355340 options = options ,
341+ experimental_flags = [],
356342 executable_search_paths = [self .binpath ],
357- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
358343 )
359344
360345 expected_files = {"included.js" }
@@ -394,8 +379,8 @@ def test_includes_sourcemap_if_requested(self, runtime):
394379 os .path .join (source_dir , "package.json" ),
395380 runtime = runtime ,
396381 options = options ,
382+ experimental_flags = [],
397383 executable_search_paths = [self .binpath ],
398- experimental_flags = [EXPERIMENTAL_FLAG_ESBUILD ],
399384 )
400385
401386 expected_files = {"included.js" , "included.js.map" }
0 commit comments