Skip to content

Commit

Permalink
Merge pull request #58 from Jonas56/dev
Browse files Browse the repository at this point in the history
New version
  • Loading branch information
Jonas56 authored Dec 11, 2021
2 parents 1a538b6 + e325a86 commit d886fd6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOSTNAME: ${{ secrets.DB_HOSTNAME }}
SECRET: 0
# ****End to end Testing***** #
# - name: e2e tests
# uses: cypress-io/github-action@v2
Expand All @@ -39,19 +40,17 @@ jobs:
# start: npm run start-prod
# wait-on: http://localhost:5000
- name: Deploy
if: ${{ github.base_ref == 'main' }}
if: ${{ github.ref == 'main' }}
uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "law-firm-management-sys" # Must be unique in Heroku
heroku_email: "[email protected]"
# healthcheck: "law-firm-management-sys.herokuapp.com/version"
# checkString: "1.1.0"

- name: Bump version and push tag
if: ${{ github.base_ref == 'main' }}
if: ${{ github.ref == 'main' }}
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true

2 changes: 1 addition & 1 deletion server/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ api.use("/api/cases", middleware.userAuthentication, caseRouter);
api.use("/api/users", userRouter);
api.use("/api/login", loginRouter);
api.get("/health", (req, res) => {
res.send("v0.1.0");
res.status(200).send("v0.1.0");
});

module.exports = api;
6 changes: 6 additions & 0 deletions server/tests/cases/case_api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ beforeAll(async () => {
await Case.create({ ...helper.cases });
});

describe("Health check", () => {
test("should return 200 OK", async () => {
await request(app).get("/v1/health").expect(200);
});
});

describe("GET /v1/api/cases", () => {
test("should return all cases", async () => {
const logedInUser = await request(app)
Expand Down

0 comments on commit d886fd6

Please sign in to comment.