Skip to content

Commit

Permalink
Merge pull request #154 from RiyaRaj28/GHA-automated-testing
Browse files Browse the repository at this point in the history
GHA automated testing
  • Loading branch information
techsavvyash authored Jul 6, 2024
2 parents f8221bb + f2ccf59 commit f75e48f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "test"

on:
pull_request:
branches:
- main
- dev

push:
branches:
- '*'

jobs:
test-package:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/[email protected]

- name: Use Node.js
uses: actions/setup-node@v4

- name: Install Dependencies for packages/common
run: yarn install --frozen-lockfile
working-directory: packages/common

- name: Unit tests for packages/common
run: yarn run test
working-directory: packages/common/test/

test-sample:
runs-on: ubuntu-latest
strategy:
matrix:
dir:
- '02-monitoring'
- '03-response-formatting'
- '04-logging'
- '05-temporal-package'
- '06-file-upload'

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4

- name: Install Dependencies for ${{ matrix.dir }}
run: yarn install
working-directory: sample/${{ matrix.dir }}

- name: Run Unit Tests
run: yarn run test
working-directory: sample/${{ matrix.dir }}
2 changes: 1 addition & 1 deletion sample/06-file-upload/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World from sample/07-file-upload!';
return 'Hello World from file upload.';
}
}
2 changes: 1 addition & 1 deletion sample/06-file-upload/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ describe('AppController (e2e)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect('Hello World!');
.expect('Hello World from file upload.');
});
});

0 comments on commit f75e48f

Please sign in to comment.