mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Add tests for "nvm use default on source" behavior.
				
					
				
			This commit is contained in:
		| @@ -0,0 +1,17 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | die () { echo $@ ; exit 1; } | ||||||
|  |  | ||||||
|  | echo '0.10.1' > ../../../alias/default || die 'creation of default alias failed' | ||||||
|  |  | ||||||
|  | . ../../../nvm.sh || die 'sourcing returned nonzero exit code' | ||||||
|  |  | ||||||
|  | NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.1)" | ||||||
|  | [ "_$NVM_LS_CURRENT" = '_v0.10.1' ] || die "'nvm ls current' did not return '-> v0.10.1', got '$NVM_LS_CURRENT'" | ||||||
|  |  | ||||||
|  | # NVM_LS_CURRENT_COLORED="$(nvm ls current | sed -n l)" | ||||||
|  |  | ||||||
|  | NVM_ALIAS_DEFAULT="$(nvm alias default)" | ||||||
|  | [ "_$NVM_ALIAS_DEFAULT" = "_default -> 0.10.1 (-> v0.10.1)" ] \ | ||||||
|  |   || die "'nvm alias default did not return 'default -> 0.10.1 (-> v0.10.1)', got '$NVM_ALIAS_DEFAULT'" | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								test/installation/sourcing/setup_dir
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										8
									
								
								test/installation/sourcing/setup_dir
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | mkdir -p ../../../alias | ||||||
|  |  | ||||||
|  | . ../../../nvm.sh | ||||||
|  | nvm install 0.10.1 | ||||||
|  | nvm unload || echo >&2 'nvm unload failed' | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								test/installation/sourcing/teardown_dir
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								test/installation/sourcing/teardown_dir
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | rm -rf ../../../alias | ||||||
|  | rm -rf ../../../v0.10.1 | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user