// A project built differently for each operating system.
A project built differently for each operating system.
// A project built differently for each operating system .
func TestDependenciesTreeDiffrentBetweenOss(t *testing.T) {
	npmVersion, _, err := GetNpmVersionAndExecPath(logger)
	assert.NoError(t, err)
	path, err := filepath.Abs(filepath.Join("..", "testdata"))
	assert.NoError(t, err)
	projectPath, cleanup := testdatautils.CreateNpmTest(t, path, "project4", true, npmVersion)
	defer cleanup()
	cacachePath := filepath.Join(projectPath, "tmpcache")
	npmArgs := []string{"--cache=" + cacachePath}
	_, _, err = RunNpmCmd("npm", projectPath, Ci, npmArgs, logger)
	assert.NoError(t, err)
	dependencies, err := CalculateDependenciesList("npm", projectPath, "bundle-dependencies", npmArgs, logger)
	assert.NoError(t, err)
	var excpected []entities.Dependency
	assert.NoError(t, utils.Unmarshal(filepath.Join(projectPath, "excpected_dependencies_list.json"), &excpected))
	assert.True(t, entities.IsEqualDependencySlices(excpected, dependencies))
}
func TestDependenciesTreeDiffrentBetweenOss ( t * testing . T ) { npmVersion , _ , err := GetNpmVersionAndExecPath ( logger ) assert . NoError ( t , err ) path , err := filepath . Abs ( filepath . Join ( " " , " " ) ) assert . NoError ( t , err ) projectPath , cleanup := testdatautils . CreateNpmTest ( t , path , " " , true , npmVersion ) defer cleanup ( ) cacachePath := filepath . Join ( projectPath , " " ) npmArgs := [ ] string { " " + cacachePath } _ , _ , err = RunNpmCmd ( " " , projectPath , Ci , npmArgs , logger ) assert . NoError ( t , err ) dependencies , err := CalculateDependenciesList ( " " , projectPath , " " , npmArgs , logger ) assert . NoError ( t , err ) var excpected [ ] entities . Dependency assert . NoError ( t , utils . Unmarshal ( filepath . Join ( projectPath , " " ) , & excpected ) ) assert . True ( t , entities . IsEqualDependencySlices ( excpected , dependencies ) ) }
A project built differently for each operating system.
A project built differently for each operating system .
// Install all of the project's dependencies. // Calculate dependencies. // Verify results.