-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from UwUClub/AW-35-Tests-unitaires
Aw 35 tests unitaires
- Loading branch information
Showing
18 changed files
with
273 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: NestJS CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "api/**" | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "api/**" | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4.0.0 | ||
with: | ||
node-version: "21" | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --no-frozen-lockfile | ||
working-directory: ./api | ||
|
||
- name: Build | ||
run: pnpm run build | ||
working-directory: ./api | ||
|
||
- name: Run Tests | ||
run: pnpm test | ||
working-directory: ./api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Flutter APK Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "flutter_area/**" | ||
tags: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- "flutter_area/**" | ||
|
||
jobs: | ||
build-apk: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2.12.0 | ||
with: | ||
flutter-version: "3.16" | ||
|
||
- name: Install Dependencies | ||
run: flutter pub get | ||
working-directory: ./flutter_area | ||
|
||
- name: Build APK | ||
run: | | ||
flutter build apk --release | ||
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/maker.apk | ||
working-directory: ./flutter_area | ||
|
||
- name: Upload APK | ||
uses: actions/upload-artifact@v3.1.3 | ||
with: | ||
name: maker.apk | ||
path: ./flutter_area/build/app/outputs/flutter-apk/maker.apk | ||
|
||
- name: Publish Tagged Release | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
with: | ||
files: | | ||
./flutter_area/build/app/outputs/flutter-apk/maker.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ COPY . . | |
|
||
RUN pnpm run build | ||
|
||
RUN pnpm test | ||
|
||
CMD [ "pnpm", "start" ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { UsersController } from './users.controller'; | ||
import { UsersService } from './users.service'; | ||
import { UsersRepository } from './users.repository'; | ||
import { Model } from 'mongoose'; | ||
import { UsersMapper } from './users.mapper'; | ||
|
||
describe('UsersController', () => { | ||
let controller: UsersController; | ||
let service: UsersService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [UsersController], | ||
providers: [UsersService], | ||
providers: [ | ||
UsersService, | ||
UsersMapper, | ||
UsersRepository, | ||
{ | ||
provide: 'UserModel', | ||
useValue: Model, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
controller = module.get<UsersController>(UsersController); | ||
service = module.get<UsersService>(UsersService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.