Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvrajsab committed Sep 13, 2023
1 parent c2acfb8 commit e16aa8d
Show file tree
Hide file tree
Showing 35 changed files with 932 additions and 818 deletions.
12 changes: 6 additions & 6 deletions apps/admin-e2e/src/integration/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { getGreeting } from '../support/app.po';
import { getGreeting } from "../support/app.po";

describe('admin', () => {
beforeEach(() => cy.visit('/'));
describe("admin", () => {
beforeEach(() => cy.visit("/"));

it('should display welcome message', () => {
it("should display welcome message", () => {
// Custom command example, see `../support/commands.ts` file
cy.login('[email protected]', 'myPassword');
cy.login("[email protected]", "myPassword");

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome admin');
getGreeting().contains("Welcome admin");
});
});
2 changes: 1 addition & 1 deletion apps/admin-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const getGreeting = () => cy.get('h1');
export const getGreeting = () => cy.get("h1");
4 changes: 2 additions & 2 deletions apps/admin-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ declare namespace Cypress {
}
//
// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
Cypress.Commands.add("login", (email, password) => {
console.log("Custom command example: Login", email, password);
});
//
// -- This is a child command --
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-e2e/src/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
import "./commands";
12 changes: 6 additions & 6 deletions apps/admin/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
export default {
displayName: 'admin',
preset: '../../jest.preset.js',
displayName: "admin",
preset: "../../jest.preset.js",
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
"^.+\\.[tj]sx?$": "babel-jest",
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/admin',
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
coverageDirectory: "../../coverage/apps/admin",
};
4 changes: 2 additions & 2 deletions apps/admin/src/app/components/Dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import DashboardComponent from './Dashboard';
import DashboardComponent from "./Dashboard";

export default DashboardComponent;
export default DashboardComponent;
4 changes: 2 additions & 2 deletions apps/admin/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
*
* See: https://github.com/zloirock/core-js#babel
*/
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import "core-js/stable";
import "regenerator-runtime/runtime";
2 changes: 1 addition & 1 deletion apps/admin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"moduleResolution": "node"
},
"files": [],
"include": [],
Expand Down
18 changes: 9 additions & 9 deletions apps/api/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* eslint-disable */
export default {
displayName: 'api',
preset: '../../jest.preset.js',
displayName: "api",
preset: "../../jest.preset.js",
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
},
},
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^.+\\.[tj]s$': 'ts-jest',
"^.+\\.[tj]s$": "ts-jest",
},
moduleFileExtensions: ['ts', 'js', 'html'],
moduleFileExtensions: ["ts", "js", "html"],
transformIgnorePatterns: [
'[/\\\\]node_modules(?![\\/\\\\](monaco-editor|weak-lru-cache|ordered-binary))[/\\\\].+\\.js$',
"[/\\\\]node_modules(?![\\/\\\\](monaco-editor|weak-lru-cache|ordered-binary))[/\\\\].+\\.js$",
],
coverageDirectory: '../../coverage/apps/api',
coverageDirectory: "../../coverage/apps/api",
};
83 changes: 41 additions & 42 deletions apps/api/src/app/app.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Test, TestingModule } from '@nestjs/testing';
import { createMock } from '@golevelup/ts-jest';
import { Test, TestingModule } from "@nestjs/testing";
import { createMock } from "@golevelup/ts-jest";

import { AppController } from './app.controller';
import { AppService } from './app.service';
import { RedisService } from 'nestjs-redis';
import { PrismaService } from './prisma.service';
import { RouterService } from './router/router.service';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TerminusModule } from '@nestjs/terminus';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { TelemetryService } from './telemetry/telemetry.service';
import { PosthogModule } from 'nestjs-posthog';
import { RedisModule } from '@liaoliaots/nestjs-redis';
import { HttpModule } from '@nestjs/axios';
import { RedisHealthModule } from '@liaoliaots/nestjs-redis/health';
import { PrismaHealthIndicator } from './prisma/prisma.health';
import { RedisUtils } from './utils/redis.utils';
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { RedisService } from "nestjs-redis";
import { PrismaService } from "./prisma.service";
import { RouterService } from "./router/router.service";
import { ConfigModule, ConfigService } from "@nestjs/config";
import { TerminusModule } from "@nestjs/terminus";
import { ClientsModule, Transport } from "@nestjs/microservices";
import { TelemetryService } from "./telemetry/telemetry.service";
import { PosthogModule } from "nestjs-posthog";
import { RedisModule } from "@liaoliaots/nestjs-redis";
import { HttpModule } from "@nestjs/axios";
import { RedisHealthModule } from "@liaoliaots/nestjs-redis/health";
import { PrismaHealthIndicator } from "./prisma/prisma.health";
import { RedisUtils } from "./utils/redis.utils";

describe('AppController', () => {
describe("AppController", () => {
let controller: AppController;
let service: AppService;
let mockRedisSet;
Expand All @@ -36,45 +36,45 @@ describe('AppController', () => {
TerminusModule,
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['.env.local', '.env'],
envFilePath: [".env.local", ".env"],
}),
RedisModule.forRootAsync({
useFactory: (config: ConfigService) => {
return {
readyLog: true,
config: {
namespace: config.get('REDIS_NAME'),
url: config.get('REDIS_URI'),
}
namespace: config.get("REDIS_NAME"),
url: config.get("REDIS_URI"),
},
};
},
inject: [ConfigService],
}),
ClientsModule.registerAsync([
{
name: 'CLICK_SERVICE',
name: "CLICK_SERVICE",
imports: [ConfigModule],
useFactory: async (config: ConfigService) => ({
transport: Transport.RMQ,
options: {
urls: [config.get<string>('RMQ_URL')],
queue: config.get<string>('RMQ_QUEUE'),
queueOptions: {
durable: config.get<boolean>('RMQ_QUEUE_DURABLE'),
},
transport: Transport.RMQ,
options: {
urls: [config.get<string>("RMQ_URL")],
queue: config.get<string>("RMQ_QUEUE"),
queueOptions: {
durable: config.get<boolean>("RMQ_QUEUE_DURABLE"),
},
},
}),
inject: [ConfigService],
},
]),
PosthogModule.forRootAsync({
useFactory: (config: ConfigService) => {
return {
apiKey: config.get<string>('POSTHOG_API_KEY'),
apiKey: config.get<string>("POSTHOG_API_KEY"),
options: {
host: config.get<string>('POSTHOG_API_HOST'),
flushAt: config.get<number>('POSTHOG_BATCH_SIZE'),
flushInterval: config.get<number>('POSTHOG_FLUSH_INTERVAL'),
host: config.get<string>("POSTHOG_API_HOST"),
flushAt: config.get<number>("POSTHOG_BATCH_SIZE"),
flushInterval: config.get<number>("POSTHOG_FLUSH_INTERVAL"),
},
mock: false,
};
Expand All @@ -88,25 +88,24 @@ describe('AppController', () => {
providers: [
AppService,
ConfigService,
{ provide: RedisService, useValue: mockRedisService },
{ provide: RedisService, useValue: mockRedisService },
PrismaService,
RouterService,
TelemetryService,
PrismaHealthIndicator,
RedisUtils
],
RedisUtils,
],
})
.overrideProvider(RedisService)
.useValue(mockRedisService)
.compile();
.overrideProvider(RedisService)
.useValue(mockRedisService)
.compile();

controller = module.get<AppController>(AppController);
service = module.get<AppService>(AppService);
});

it('should be defined', () => {
it("should be defined", () => {
expect(controller).toBeDefined();
expect(service).toBeDefined();
});

});
Loading

0 comments on commit e16aa8d

Please sign in to comment.