test: setup private npm registry w/sinopia

This commit is contained in:
Stephan Bönnemann 2015-02-04 15:18:22 +01:00
parent 019aeeabe1
commit c936e8be4b
7 changed files with 50 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules
*.log
.tmp

9
bin/post-test Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
cat .tmp/sinopia.pid | xargs kill
cat .tmp/registry | xargs npm config set registry
cp .tmp/.npmrc ~/.npmrc
rm -rf .tmp

15
bin/pre-test Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
mkdir -p .tmp/modules
./node_modules/.bin/sinopia ./tests/config.yml & echo $! >> .tmp/sinopia.pid
sleep 0.5
npm config get registry >> .tmp/registry
cp ~/.npmrc .tmp/.npmrc
cp tests/.npmrc ~/.npmrc
npm config set registry http://localhost:4873/

View File

@ -19,7 +19,8 @@
"semver": "^4.2.0"
},
"devDependencies": {
"standard": "^2.3.1"
"standard": "^2.3.1",
"sinopia": "^1.0.0"
},
"homepage": "https://github.com/boennemann/semantic-release",
"keywords": [
@ -38,8 +39,10 @@
"url": "https://github.com/boennemann/semantic-release.git"
},
"scripts": {
"prepublish": "./bin/semantic-release pre",
"postpublish": "./bin/semantic-release post",
"posttest": "./bin/post-test",
"prepublish": "./bin/semantic-release pre",
"pretest": "./bin/pre-test",
"test": "standard"
}
}

1
tests/.htpasswd Normal file
View File

@ -0,0 +1 @@
test:{SHA}C+7Hteo/D9vJXQ3UfzxbwnXaijM=

2
tests/.npmrc Normal file
View File

@ -0,0 +1,2 @@
_auth=dGVzdDpmb28=
email=test@example.com

17
tests/config.yml Normal file
View File

@ -0,0 +1,17 @@
storage: ../.tmp/.storage
auth:
htpasswd:
file: ./.htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
logs:
- {type: stdout, format: pretty, level: silent}
packages:
'*':
allow_access: all
allow_publish: all