File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI/CD Pipeline
2+
3+ on :
4+ push :
5+ branches : ['main']
6+ pull_request :
7+ branches : ['main']
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Repository checkout
15+ uses : actions/checkout@v4
16+
17+ - name : Install Node
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : ' 22.21.0'
21+
22+ - name : Install dependencies
23+ run : npm ci
24+
25+ - name : Generate Prisma
26+ run : npm run prisma generate
27+
28+ - name : Build
29+ run : npm run build
30+
31+ - name : Run Tests
32+ run : npm run test
33+
34+ - name : Run Lint
35+ run : npm run lint
Original file line number Diff line number Diff line change 7272 "transform" : {
7373 "^.+\\ .(t|j)s$" : " ts-jest"
7474 },
75+ "moduleNameMapper" : {
76+ "^(\\ .{1,2}/.*)\\ .js$" : " $1"
77+ },
7578 "collectCoverageFrom" : [
7679 " **/*.(t|j)s"
7780 ],
Original file line number Diff line number Diff line change 11import { Test , TestingModule } from '@nestjs/testing' ;
22import { ProductsController } from './product.controller' ;
33import { ProductService } from './product.service' ;
4+ import { PrismaService } from '../prisma/prisma.service' ;
45
56describe ( 'ProductsController' , ( ) => {
67 let controller : ProductsController ;
78
89 beforeEach ( async ( ) => {
910 const module : TestingModule = await Test . createTestingModule ( {
1011 controllers : [ ProductsController ] ,
11- providers : [ ProductService ] ,
12+ providers : [ ProductService , PrismaService ] ,
1213 } ) . compile ( ) ;
1314
1415 controller = module . get < ProductsController > ( ProductsController ) ;
Original file line number Diff line number Diff line change 11import { Test , TestingModule } from '@nestjs/testing' ;
22import { ProductService } from './product.service' ;
3+ import { PrismaService } from '../prisma/prisma.service' ;
34
45describe ( 'ProductsService' , ( ) => {
56 let service : ProductService ;
67
78 beforeEach ( async ( ) => {
89 const module : TestingModule = await Test . createTestingModule ( {
9- providers : [ ProductService ] ,
10+ providers : [ ProductService , PrismaService ] ,
1011 } ) . compile ( ) ;
1112
1213 service = module . get < ProductService > ( ProductService ) ;
You can’t perform that action at this time.
0 commit comments