chore: make test command cleanup after itself and fail early for style errors
This commit is contained in:
		
							parent
							
								
									6763a006d2
								
							
						
					
					
						commit
						d4f6ee0d6a
					
				| @ -1,9 +0,0 @@ | ||||
| #!/bin/sh | ||||
| 
 | ||||
| cat .tmp/sinopia.pid | xargs kill | ||||
| 
 | ||||
| cat .tmp/ghrs.pid | xargs kill | ||||
| 
 | ||||
| cp .tmp/.npmrc ~/.npmrc | ||||
| 
 | ||||
| rm -rf .tmp | ||||
| @ -1,7 +1,23 @@ | ||||
| #!/bin/sh | ||||
| #!/bin/bash | ||||
| 
 | ||||
| set -e | ||||
| 
 | ||||
| npm run test:style | ||||
| 
 | ||||
| function cleanup { | ||||
|   set +e | ||||
| 
 | ||||
|   cp .tmp/.npmrc ~/.npmrc | ||||
| 
 | ||||
|   cat .tmp/sinopia.pid | xargs kill | ||||
| 
 | ||||
|   cat .tmp/ghrs.pid | xargs kill | ||||
| 
 | ||||
|   rm -rf .tmp | ||||
| } | ||||
| 
 | ||||
| trap cleanup EXIT | ||||
| 
 | ||||
| [ -d ".tmp" ] && ./bin/post-test | ||||
| 
 | ||||
| mkdir -p .tmp/modules | ||||
| @ -16,3 +32,5 @@ sleep 0.5 | ||||
| cp ~/.npmrc .tmp/.npmrc | ||||
| 
 | ||||
| cp tests/.npmrc ~/.npmrc | ||||
| 
 | ||||
| npm run test:integration | ||||
| @ -55,9 +55,9 @@ | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "postpublish": "./bin/semantic-release.js post", | ||||
|     "posttest": "./bin/post-test", | ||||
|     "prepublish": "./bin/semantic-release.js pre", | ||||
|     "pretest": "./bin/pre-test", | ||||
|     "test": "standard && node tests | tap-spec" | ||||
|     "test:style": "standard", | ||||
|     "test:integration": "node tests | tap-spec", | ||||
|     "test": "./bin/test" | ||||
|   } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user