-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ def tearDown(self): | |
shutil.rmtree(self.scratch_dir) | ||
shutil.rmtree(self.dependencies_dir) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_without_dependencies(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps") | ||
|
||
|
@@ -51,7 +51,7 @@ def test_builds_project_without_dependencies(self, runtime): | |
output_files = set(os.listdir(self.artifacts_dir)) | ||
self.assertEqual(expected_files, output_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_without_manifest(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-manifest") | ||
|
||
|
@@ -69,7 +69,7 @@ def test_builds_project_without_manifest(self, runtime): | |
mock_warning.assert_called_once_with("package.json file not found. Continuing the build without dependencies.") | ||
self.assertEqual(expected_files, output_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_and_excludes_hidden_aws_sam(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files") | ||
|
||
|
@@ -85,7 +85,7 @@ def test_builds_project_and_excludes_hidden_aws_sam(self, runtime): | |
output_files = set(os.listdir(self.artifacts_dir)) | ||
self.assertEqual(expected_files, output_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_with_remote_dependencies(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") | ||
|
||
|
@@ -105,7 +105,7 @@ def test_builds_project_with_remote_dependencies(self, runtime): | |
output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules"))) | ||
self.assertEqual(expected_modules, output_modules) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_with_npmrc(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npmrc") | ||
|
||
|
@@ -131,12 +131,15 @@ def test_builds_project_with_npmrc(self, runtime): | |
("nodejs12.x", "package-lock"), | ||
("nodejs14.x", "package-lock"), | ||
("nodejs16.x", "package-lock"), | ||
("nodejs18.x", "package-lock"), | ||
("nodejs12.x", "shrinkwrap"), | ||
("nodejs14.x", "shrinkwrap"), | ||
("nodejs16.x", "shrinkwrap"), | ||
("nodejs18.x", "shrinkwrap"), | ||
("nodejs12.x", "package-lock-and-shrinkwrap"), | ||
("nodejs14.x", "package-lock-and-shrinkwrap"), | ||
("nodejs16.x", "package-lock-and-shrinkwrap"), | ||
("nodejs18.x", "package-lock-and-shrinkwrap"), | ||
] | ||
) | ||
def test_builds_project_with_lockfile(self, runtime, dir_name): | ||
|
@@ -163,7 +166,7 @@ def test_builds_project_with_lockfile(self, runtime, dir_name): | |
|
||
self.assertEqual(expected_files, output_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_fails_if_npm_cannot_resolve_dependencies(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps") | ||
|
||
|
@@ -178,7 +181,7 @@ def test_fails_if_npm_cannot_resolve_dependencies(self, runtime): | |
|
||
self.assertIn("No matching version found for [email protected]", str(ctx.exception)) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") | ||
|
||
|
@@ -196,7 +199,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w | |
output_files = set(os.listdir(self.artifacts_dir)) | ||
self.assertEqual(expected_files, output_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") | ||
|
||
|
@@ -226,7 +229,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_ | |
output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) | ||
self.assertNotIn(expected_dependencies_files, output_dependencies_files) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir( | ||
self, runtime | ||
): | ||
|
@@ -252,7 +255,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w | |
"artifacts directory. " | ||
) | ||
|
||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) | ||
@parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) | ||
def test_builds_project_without_combine_dependencies(self, runtime): | ||
source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters