diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cbb0e2..83eda44 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,14 +1,25 @@ -name : tests +name: Run Tests on Pull Request on: - pull_request + pull_request: + branches: + - main jobs: - build: runs-on: ubuntu-latest + steps: - - uses: action/checkout@v2 - - run : cd auth && yarn install && yarn run test:ci - - + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "16" # Replace this with the version of Node.js your project requires + + - name: Install Yarn dependencies in auth folder + run: cd auth && yarn install + + - name: Run tests in auth folder + run: cd auth && yarn test:ci diff --git a/auth/package.json b/auth/package.json index 86f141e..7a924fa 100644 --- a/auth/package.json +++ b/auth/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "ts-node-dev src/index.ts", "test": "jest --watchAll --no-cache", - "test:ci": "jest --testTimeout=30000" + "test:ci": "jest" }, "jest": { "preset": "ts-jest", diff --git a/auth/src/index.ts b/auth/src/index.ts index ab190e0..4f28689 100644 --- a/auth/src/index.ts +++ b/auth/src/index.ts @@ -5,6 +5,7 @@ import app from "./app"; //mongodb const start = async () => { try { + console.log("Starting up auth service..."); if (!process.env.JWT_SECRET || !process.env.MONGO_URI) { throw new HttpException(500, " env must be defined"); }