-
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 #26 from game-node-app/dev
Cache for Statistics Controller
- Loading branch information
Showing
13 changed files
with
97 additions
and
33 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { FollowService } from './follow.service'; | ||
import { Test, TestingModule } from "@nestjs/testing"; | ||
import { FollowService } from "./follow.service"; | ||
|
||
describe('FollowService', () => { | ||
let service: FollowService; | ||
describe("FollowService", () => { | ||
let service: FollowService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [FollowService], | ||
}).compile(); | ||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [FollowService], | ||
}).compile(); | ||
|
||
service = module.get<FollowService>(FollowService); | ||
}); | ||
service = module.get<FollowService>(FollowService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
it("should be defined", () => { | ||
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
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,18 +1,36 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { HealthService } from './health.service'; | ||
import { Test, TestingModule } from "@nestjs/testing"; | ||
import { HealthService } from "./health.service"; | ||
import { HealthCheckService, TypeOrmHealthIndicator } from "@nestjs/terminus"; | ||
import { RedisHealthIndicator } from "@liaoliaots/nestjs-redis-health"; | ||
|
||
describe('HealthService', () => { | ||
let service: HealthService; | ||
describe("HealthService", () => { | ||
let service: HealthService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [HealthService], | ||
}).compile(); | ||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [ | ||
HealthService, | ||
{ | ||
provide: HealthCheckService, | ||
useValue: { | ||
check: jest.fn(), | ||
}, | ||
}, | ||
{ | ||
provide: RedisHealthIndicator, | ||
useValue: {}, | ||
}, | ||
{ | ||
provide: TypeOrmHealthIndicator, | ||
useValue: {}, | ||
}, | ||
], | ||
}).compile(); | ||
|
||
service = module.get<HealthService>(HealthService); | ||
}); | ||
service = module.get<HealthService>(HealthService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
it("should be defined", () => { | ||
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const dataSourceMock = { | ||
getRepository: jest.fn(() => { | ||
console.warn( | ||
"getRepository of dataSourceMock is being called and not being mocked. This is probably going to result in errors.", | ||
); | ||
}), | ||
}; |