Fix weather module DI (MeshService export + value import) and pass WEATHER_CRON through compose (#25)
CI / build + unit (push) Successful in 31s

This commit was merged in pull request #25.
This commit is contained in:
2026-09-25 10:01:38 +02:00
parent 261f7ed18c
commit 5e03546f40
6 changed files with 27 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
import { Test } from '@nestjs/testing';
import { describe, expect, it } from 'vitest';
import { MeshService } from '../mesh/mesh.service.js';
import { WeatherModule } from './weather.module.js';
import { WeatherService } from './weather.service.js';
describe('DI wiring (module graph)', () => {
// compile() instantiates providers but does not run lifecycle hooks, so no TCP connection is opened.
it('resolves WeatherService with MeshService provided by MeshModule', async () => {
process.env.MESH_DB_PATH = ':memory:'; // keep openMessageDb from touching the repo's ./data
const moduleRef = await Test.createTestingModule({
imports: [WeatherModule],
}).compile();
expect(moduleRef.get(WeatherService)).toBeInstanceOf(WeatherService);
expect(moduleRef.get(MeshService)).toBeInstanceOf(MeshService);
});
});