mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
refactor(tokens): MCP and API tokens through McpTokensRepository
This commit is contained in:
@@ -87,6 +87,7 @@ import { PublicStatsController } from '../../src/nest/atlas/public-stats.control
|
||||
import { AtlasService } from '../../src/nest/atlas/atlas.service';
|
||||
import { TrekExceptionFilter } from '../../src/nest/common/trek-exception.filter';
|
||||
import { TestUnitOfWorkModule } from '../helpers/test-uow';
|
||||
import { createTestMikroOrmModule } from '../helpers/test-orm';
|
||||
|
||||
/** Mints a token the way TokenService does, so the guard's hash lookup is real. */
|
||||
function seedToken(userId: number, raw: string, kind: 'api' | 'mcp' = 'api'): string {
|
||||
@@ -152,7 +153,7 @@ describe('Public API v1 e2e (real guard + real SQL)', () => {
|
||||
|
||||
async function build() {
|
||||
const moduleRef = await Test.createTestingModule({
|
||||
imports: [await TestUnitOfWorkModule.forRoot(db), DatabaseModule, RateLimitModule, TokensModule, PublicApiModule],
|
||||
imports: [await TestUnitOfWorkModule.forRoot(db), await createTestMikroOrmModule(db), DatabaseModule, RateLimitModule, TokensModule, PublicApiModule],
|
||||
// `/api/v1/stats` lives in atlas/ because its figures do, but it is guarded
|
||||
// and scoped by this directory's code — so it is mounted here with the real
|
||||
// guard and a stubbed AtlasService. Importing AtlasModule instead would pull
|
||||
|
||||
Reference in New Issue
Block a user