// Return the project path based on 'projectDir'.
// withOsInPath - some tests have individual cases for specific os, if true, return the tests for that belong to the current running os.
// testdataPath - abs path to testdata dir.
// projectDirName - name of the project's directory.
Return the project path based on 'projectDir'.
withOsInPath - some tests have individual cases for specific os, if true, return the tests for that belong to the current running os.
testdataPath - abs path to testdata dir.
projectDirName - name of the project's directory.
// Return the project path based on ' projectDir ' . // withOsInPath - some tests have individual cases for specific os if true return the tests for that belong to the current running os . // testdataPath - abs path to testdata dir . // projectDirName - name of the project ' s directory .
func CreateNpmTest(t *testing.T, testdataPath, projectDirName string, withOsInPath bool, version *version.Version) (tmpProjectPath string, cleanup func()) {
	var npmVersionDir string
	switch {
	case version.AtLeast("8.0.0"):
		npmVersionDir = "npmv8"
	case version.AtLeast("7.0.0"):
		npmVersionDir = "npmv7"
	case version.AtLeast("6.0.0"):
		npmVersionDir = "npmv6"
	}
	if withOsInPath {
		switch runtime.GOOS {
		case "windows":
			npmVersionDir = filepath.Join(npmVersionDir, "windows")
		case "linux":
			npmVersionDir = filepath.Join(npmVersionDir, "linux")
		default:
			npmVersionDir = filepath.Join(npmVersionDir, "macos")
		}
	}
	path := filepath.Join(testdataPath, "npm", projectDirName, npmVersionDir)
	return CreateTestProject(t, path)
}
func CreateNpmTest ( t * testing . T , testdataPath , projectDirName string , withOsInPath bool , version * version . Version ) ( tmpProjectPath string , cleanup func ( ) ) { var npmVersionDir string switch { case version . AtLeast ( " " ) : npmVersionDir = " " case version . AtLeast ( " " ) : npmVersionDir = " " case version . AtLeast ( " " ) : npmVersionDir = " " } if withOsInPath { switch runtime . GOOS { case " " : npmVersionDir = filepath . Join ( npmVersionDir , " " ) case " " : npmVersionDir = filepath . Join ( npmVersionDir , " " ) default : npmVersionDir = filepath . Join ( npmVersionDir , " " ) } } path := filepath . Join ( testdataPath , " " , projectDirName , npmVersionDir ) return CreateTestProject ( t , path ) }
Return the project path based on 'projectDir'.
Return the project path based on ' projectDir ' .
//MacOs