diff --git a/build/utils/npm_test.go b/build/utils/npm_test.go index e6c5a891..3e20689d 100644 --- a/build/utils/npm_test.go +++ b/build/utils/npm_test.go @@ -234,31 +234,6 @@ func TestDependencyWithNoIntegrity(t *testing.T) { assert.Greaterf(t, len(dependencies), 0, "Error: dependencies are not found!") } -/* -// This test case verifies that CalculateNpmDependenciesList correctly handles the exclusion of 'node_modules' -// and updates 'package-lock.json' as required, based on the 'IgnoreNodeModules' and 'OverwritePackageLock' parameters. -func TestDependencyPackageLockOnly(t *testing.T) { - npmVersion, _, err := GetNpmVersionAndExecPath(logger) - require.NoError(t, err) - if !npmVersion.AtLeast("7.0.0") { - t.Skip("Running on npm v7 and above only, skipping...") - } - path, cleanup := tests.CreateTestProject(t, filepath.Join("..", "testdata/npm/project6")) - defer cleanup() - assert.NoError(t, utils.MoveFile(filepath.Join(path, "package-lock_test.json"), filepath.Join(path, "package-lock.json"))) - // sleep so the package.json modified time will be bigger than the package-lock.json, this make sure it will recalculate lock file. - require.NoError(t, os.Chtimes(filepath.Join(path, "package.json"), time.Now(), time.Now().Add(time.Millisecond*20))) - - // Calculate dependencies. - dependencies, err := CalculateDependenciesMap("npm", path, "jfrogtest", - NpmTreeDepListParam{Args: []string{}, IgnoreNodeModules: true, OverwritePackageLock: true}, logger, false) - assert.NoError(t, err) - var expectedRes = getExpectedRespForTestDependencyPackageLockOnly() - assert.Equal(t, expectedRes, dependencies) -} - -*/ - func TestCalculateDependenciesMap(t *testing.T) { testCases := []struct { name string