Make :run npm commands 'private'

This commit is contained in:
James Allen 2018-01-29 14:21:22 +00:00
parent bd581d069b
commit 02918189ca
3 changed files with 7 additions and 32 deletions

View file

@ -11,7 +11,7 @@ services:
volumes: volumes:
- .:/app - .:/app
working_dir: /app working_dir: /app
entrypoint: npm run test:unit:run entrypoint: npm run test:unit:_run
test_acceptance: test_acceptance:
image: node:4.2.1 image: node:4.2.1
@ -24,7 +24,7 @@ services:
depends_on: depends_on:
- redis - redis
- mongo - mongo
entrypoint: npm run test:acceptance:run entrypoint: npm run test:acceptance:_run
redis: redis:
image: redis image: redis

View file

@ -9,14 +9,14 @@
"scripts": { "scripts": {
"compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee", "compile:app": "coffee -o app/js -c app/coffee && coffee -c app.coffee",
"start": "npm run compile:app && node app.js", "start": "npm run compile:app && node app.js",
"test:acceptance:run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- $@",
"test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:run -- $@", "test:unit": "npm run compile:app && npm run compile:unit_tests && npm run test:unit:_run -- $@",
"test:unit:run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run compile:app && npm run compile:unit_tests && npm run test:unit:run -- $@",
"compile:unit_tests": "[ -e test/unit ] && coffee -o test/unit/js -c test/unit/coffee || echo 'No unit tests to compile'", "compile:unit_tests": "[ -e test/unit ] && coffee -o test/unit/js -c test/unit/coffee || echo 'No unit tests to compile'",
"compile:acceptance_tests": "[ -e test/acceptance ] && coffee -o test/acceptance/js -c test/acceptance/coffee || echo 'No acceptance tests to compile'", "compile:acceptance_tests": "[ -e test/acceptance ] && coffee -o test/acceptance/js -c test/acceptance/coffee || echo 'No acceptance tests to compile'",
"compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests", "compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests",
"nodemon": "nodemon --config nodemon.json" "nodemon": "nodemon --config nodemon.json",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js"
}, },
"dependencies": { "dependencies": {
"async": "0.2.9", "async": "0.2.9",

View file

@ -1,25 +0,0 @@
#! /usr/bin/env bash
# npm rebuild
sleep 60
echo ">> Starting server..."
grunt --no-color forever:app:start
echo ">> Server started"
sleep 5
echo ">> Running acceptance tests..."
grunt --no-color mochaTest:acceptance
_test_exit_code=$?
echo ">> Killing server"
grunt --no-color forever:app:stop
echo ">> Done"
exit $_test_exit_code