diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..6cc56aa --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +--- +kind: pipeline +name: tests:latest +clone: + disable: true +steps: +- name: checkout pr + image: alpine/git + commands: + - git clone $DRONE_REMOTE_URL . + - git checkout $DRONE_SOURCE_BRANCH + - mv .env.ci .env +- name: run tests + image: node:alpine + commands: + - yarn + - yarn test:ci +trigger: + event: + - pull_request \ No newline at end of file diff --git a/.env.ci b/.env.ci new file mode 100644 index 0000000..6103f14 --- /dev/null +++ b/.env.ci @@ -0,0 +1,8 @@ +APP_PORT=4010 +DB_TYPE=sqlite +DB_HOST=unused +DB_PORT=unused +DB_USER=unused +DB_PASSWORD=bla +DB_NAME=./test.sqlite +NODE_ENV=production \ No newline at end of file diff --git a/package.json b/package.json index b59be18..f0f8d45 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "jest": "^26.6.3", "nodemon": "^2.0.6", "sqlite3": "^5.0.0", + "start-server-and-test": "^1.11.6", "ts-jest": "^26.4.4", "ts-node": "^9.0.0", "typedoc": "^0.19.2", @@ -69,7 +70,8 @@ "build": "tsc", "docs": "typedoc --out docs src", "test": "jest", - "test:watch": "jest --watchAll" + "test:watch": "jest --watchAll", + "test:ci": "start-server-and-test dev http://localhost:4010/api/openapi.json test" }, "nodemonConfig": { "ignore": [