Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoboeing committed Jan 30, 2024
1 parent 2ba7877 commit b211e6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/@core/health/health.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import environments from '../environments';
import { HealthController } from './health.controller';

describe('HealthController', () => {
jest.useFakeTimers();

let controller: HealthController;

const spyMicroserviceHealth = createMock<MicroserviceHealthIndicator>({
Expand Down
32 changes: 16 additions & 16 deletions test-report.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
<file path="/home/tiagoboeing/code/personal/nestjs-graphql-schemafirst-docker-k8s/src/shared/utils/ms/ms.util.spec.ts">
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Hours" duration="4"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Days" duration="13"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Hours" duration="3"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Days" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Weeks" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Years" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Hours" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() String inputs Years" duration="0"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Hours" duration="0"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Days" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Weeks" duration="0"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Years" duration="1"/>
<testCase name="Util &quot;ms&quot; millisecondsToSeconds() Number inputs Years" duration="0"/>
</file>
<file path="/home/tiagoboeing/code/personal/nestjs-graphql-schemafirst-docker-k8s/src/app.controller.spec.ts">
<testCase name="AppController root should return &quot;Hello World!&quot;" duration="19"/>
Expand All @@ -18,23 +18,23 @@
<testCase name="HealthController check() should ping Redis" duration="5"/>
</file>
<file path="/home/tiagoboeing/code/personal/nestjs-graphql-schemafirst-docker-k8s/src/infra/redis-cache/redis-cache.service.spec.ts">
<testCase name="RedisCacheService should be defined" duration="13"/>
<testCase name="RedisCacheService getKeyWithPrefix() When using .env file should correct key prefix from .env" duration="5"/>
<testCase name="RedisCacheService getKeyWithPrefix() When using fallback value should use fallback prefix" duration="3"/>
<testCase name="RedisCacheService should be defined" duration="17"/>
<testCase name="RedisCacheService getKeyWithPrefix() When using .env file should correct key prefix from .env" duration="3"/>
<testCase name="RedisCacheService getKeyWithPrefix() When using fallback value should use fallback prefix" duration="4"/>
<testCase name="RedisCacheService get() should call Cache Manager with correct params" duration="3"/>
<testCase name="RedisCacheService get() should correct return value" duration="3"/>
<testCase name="RedisCacheService get() should correct return value" duration="5"/>
<testCase name="RedisCacheService get() should not return value if not exists" duration="2"/>
<testCase name="RedisCacheService set() should set value to cache" duration="3"/>
<testCase name="RedisCacheService set() should set value to cache" duration="2"/>
<testCase name="RedisCacheService set() should set value to cache with TTL" duration="2"/>
<testCase name="RedisCacheService del() should correct call Cache Manager" duration="2"/>
<testCase name="RedisCacheService wrap() should correct call Cache Manager" duration="2"/>
<testCase name="RedisCacheService wrap() should correct call Cache Manager with ttl" duration="2"/>
<testCase name="RedisCacheService reset() should correct call Cache Manager" duration="2"/>
<testCase name="RedisCacheService del() should correct call Cache Manager" duration="3"/>
<testCase name="RedisCacheService wrap() should correct call Cache Manager" duration="4"/>
<testCase name="RedisCacheService wrap() should correct call Cache Manager with ttl" duration="8"/>
<testCase name="RedisCacheService reset() should correct call Cache Manager" duration="3"/>
</file>
<file path="/home/tiagoboeing/code/personal/nestjs-graphql-schemafirst-docker-k8s/src/notifications/notifications.service.spec.ts">
<testCase name="NotificationsService should be defined" duration="19"/>
<testCase name="NotificationsService should be defined" duration="39"/>
</file>
<file path="/home/tiagoboeing/code/personal/nestjs-graphql-schemafirst-docker-k8s/src/notifications/notifications.resolver.spec.ts">
<testCase name="NotificationsResolver should be defined" duration="12"/>
<testCase name="NotificationsResolver should be defined" duration="13"/>
</file>
</testExecutions>

0 comments on commit b211e6c

Please sign in to comment.