Skip to content

Commit

Permalink
test: add some tests for identity service
Browse files Browse the repository at this point in the history
  • Loading branch information
meysamhadeli committed Dec 10, 2023
1 parent 74728cd commit df8f0d2
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
npm run build
working-directory: ./src/identity

- name: test identity
run: npm test
working-directory: ./src/identity

- name: build flight
run: |
npm install
Expand All @@ -51,8 +55,4 @@ jobs:
npm run build
working-directory: ./src/booking

# - name: test identity
# run: npm test
# working-directory: ./src/identity


3 changes: 2 additions & 1 deletion src/booking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build": "nest build",
"dev": "tsc -p tsconfig.json && nodemon src/main.ts --watch",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest"
},
"dependencies": {
"@nestjs/common": "^10.2.10",
Expand Down
2 changes: 1 addition & 1 deletion src/building-blocks/configs/configs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/building-blocks/configs/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
password: envVars.RABBITMQ_PASSWORD,
exchange: envVars.RABBITMQ_EXCHANGE,
},
postgres: {
postgres: {
host: envVars.POSTGRES_HOST,
port: envVars.POSTGRES_PORT,
username: envVars.POSTGRES_USERNAME,
Expand Down
7 changes: 7 additions & 0 deletions src/building-blocks/rabbitmq/rabbitmq-connection.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { OnModuleInit } from '@nestjs/common';
import * as amqp from 'amqplib';
export interface RabbitmqOptions {
host: string;
port: number;
username: string;
password: string;
exchange: string;
}
export interface IRabbitMQConnection {
getChannel(): Promise<amqp.Channel>;
closeChanel(): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/building-blocks/rabbitmq/rabbitmq-connection.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/building-blocks/rabbitmq/rabbitmq-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import * as amqp from 'amqplib';
import configs from '../configs/configs';
import asyncRetry from 'async-retry';

export interface RabbitmqOptions {
host: string,
port: number,
username: string,
password: string,
exchange: string;
}

export interface IRabbitMQConnection {
getChannel(): Promise<amqp.Channel>;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'reflect-metadata';
import { StartedTestContainer } from 'testcontainers';
import { DataSourceOptions } from "typeorm";
export interface PostgresContainerOptions {
imageName: string;
type: string;
Expand All @@ -11,7 +12,7 @@ export interface PostgresContainerOptions {
synchronize: boolean;
}
export declare class PostgresContainer {
start(): Promise<StartedTestContainer>;
start(): Promise<[StartedTestContainer, DataSourceOptions]>;
private getContainerStarted;
private getDefaultPostgresTestContainers;
}
14 changes: 12 additions & 2 deletions src/building-blocks/test/container/postgres/postgres-container.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df8f0d2

Please sign in to comment.