Skip to main content
Glama

Timezone MCP Server

by sam-artuso
app.e2e.spec.tsβ€’2.07 kB
import { describe, it, expect, beforeAll, afterAll } from 'vitest' import { Test, TestingModule } from '@nestjs/testing' import { INestApplication } from '@nestjs/common' import { ConfigService } from '@nestjs/config' import { createMockConfigService, setupTestEnvironment } from './test-config.helper' import { AppController } from '../src/app/app.controller' import { AppService } from '../src/app/app.service' describe('AppController (e2e)', () => { let app: INestApplication beforeAll(async () => { try { // Set up environment variables BEFORE importing AppModule // This ensures McpAuthModule.forRoot() and TimezoneModule.forRoot() have correct env vars setupTestEnvironment() // Dynamic import to ensure setupTestEnvironment() runs first // (top-level imports are hoisted and run before module-level code) // Only AppModule needs dynamic import as it triggers forRoot() calls const { AppModule } = await import('../src/app/app.module') const moduleFixture: TestingModule = await Test.createTestingModule({ imports: [AppModule], }) .overrideProvider(ConfigService) .useValue(createMockConfigService()) .compile() app = moduleFixture.createNestApplication() await app.init() } catch (error) { console.error('Failed to initialize app in tests:', error) throw error } }) afterAll(async () => { if (app) { await app.close() } }) it('should be defined', () => { expect(app).toBeDefined() }) it('should have AppController', () => { const appController = app.get(AppController) expect(appController).toBeDefined() }) it('should have AppService', () => { const appService = app.get(AppService) expect(appService).toBeDefined() }) it('AppService.getHealth should return health status', () => { const appService = app.get(AppService) const result = appService.getHealth() expect(result).toHaveProperty('status', 'ok') expect(result).toHaveProperty('timestamp') }) })

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sam-artuso/demo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server