diff --git a/services/chat/.dockerignore b/services/chat/.dockerignore index 386f26df30..ba1c3442de 100644 --- a/services/chat/.dockerignore +++ b/services/chat/.dockerignore @@ -5,5 +5,3 @@ gitrev .npm .nvmrc nodemon.json -app.js -**/js/* diff --git a/services/chat/Dockerfile b/services/chat/Dockerfile index 5103947c33..d3c288c077 100644 --- a/services/chat/Dockerfile +++ b/services/chat/Dockerfile @@ -10,7 +10,6 @@ RUN npm install --quiet COPY . /app -RUN npm run compile:all FROM node:6.14.1 diff --git a/services/chat/Makefile b/services/chat/Makefile index 157e37fcee..c34349f494 100644 --- a/services/chat/Makefile +++ b/services/chat/Makefile @@ -17,12 +17,10 @@ DOCKER_COMPOSE := BUILD_NUMBER=$(BUILD_NUMBER) \ clean: docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) - rm -f app.js - rm -rf app/js - rm -rf test/unit/js - rm -rf test/acceptance/js +lint: + $(DOCKER_COMPOSE) run --rm test_unit npm run lint -test: test_unit test_acceptance +test: lint test_unit test_acceptance test_unit: @[ ! -d test/unit ] && echo "chat has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit diff --git a/services/chat/buildscript.txt b/services/chat/buildscript.txt index f8b82d2917..71262d2881 100644 --- a/services/chat/buildscript.txt +++ b/services/chat/buildscript.txt @@ -2,7 +2,7 @@ chat --node-version=6.14.1 --acceptance-creds=None ---language=coffeescript +--language=es --dependencies=mongo,redis --docker-repos=gcr.io/overleaf-ops --kube=false diff --git a/services/chat/nodemon.json b/services/chat/nodemon.json index 98db38d71b..5826281b84 100644 --- a/services/chat/nodemon.json +++ b/services/chat/nodemon.json @@ -10,10 +10,9 @@ }, "watch": [ - "app/coffee/", - "app.coffee", + "app/js/", + "app.js", "config/" ], - "ext": "coffee" - + "ext": "js" } diff --git a/services/chat/package.json b/services/chat/package.json index b760190ea4..e7a05a5c11 100644 --- a/services/chat/package.json +++ b/services/chat/package.json @@ -8,16 +8,17 @@ }, "scripts": { "compile:app": "([ -e app/coffee ] && coffee -m $COFFEE_OPTIONS -o app/js -c app/coffee || echo 'No CoffeeScript folder to compile') && ( [ -e app.coffee ] && coffee -m $COFFEE_OPTIONS -c app.coffee || echo 'No CoffeeScript app to compile')", - "start": "npm run compile:app && node $NODE_APP_OPTIONS app.js", - "test:acceptance": "npm run compile:app && npm run compile:acceptance_tests && npm run test:acceptance:_run -- --grep=$MOCHA_GREP", - "test:unit": "npm run compile:app && npm run compile:unit_tests && npm run test:unit:_run -- --grep=$MOCHA_GREP", + "start": "node $NODE_APP_OPTIONS app.js", + "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", + "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "compile:unit_tests": "[ ! -e test/unit/coffee ] && echo 'No unit tests to compile' || coffee -o test/unit/js -c test/unit/coffee", "compile:acceptance_tests": "[ ! -e test/acceptance/coffee ] && echo 'No acceptance tests to compile' || coffee -o test/acceptance/js -c test/acceptance/coffee", "compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests && npm run compile:smoke_tests", "nodemon": "nodemon --config nodemon.json", - "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 30000 --exit $@ test/acceptance/js", - "test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js", - "compile:smoke_tests": "[ ! -e test/smoke/coffee ] && echo 'No smoke tests to compile' || coffee -o test/smoke/js -c test/smoke/coffee" + "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", + "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", + "compile:smoke_tests": "[ ! -e test/smoke/coffee ] && echo 'No smoke tests to compile' || coffee -o test/smoke/js -c test/smoke/coffee", + "lint": "node_modules/.bin/eslint ." }, "dependencies": { "async": "0.2.9",