forked from MindFlowInteractive/quest-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-puzzle-core.ts
More file actions
43 lines (34 loc) · 1.57 KB
/
test-puzzle-core.ts
File metadata and controls
43 lines (34 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env ts-node
/**
* Test script to verify core puzzle implementations work
* This tests the puzzle logic without NestJS dependencies
*/
// Mock the Logger for standalone testing
class MockLogger {
log(message: string) { console.log(`LOG: ${message}`); }
debug(message: string) { console.log(`DEBUG: ${message}`); }
error(message: string) { console.log(`ERROR: ${message}`); }
warn(message: string) { console.log(`WARN: ${message}`); }
}
// Mock uuid for testing
let uuidCounter = 1;
const mockUuid = () => `test-uuid-${uuidCounter++}`;
// Mock NestJS Injectable decorator
const Injectable = () => (target: any) => target;
// Set up mocks
(global as any).Logger = MockLogger;
(global as any).Injectable = Injectable;
(global as any).uuidv4 = mockUuid;
// Import our types
import { PuzzleType, DifficultyLevel, PuzzleStatus } from './src/game-engine/types/puzzle.types';
console.log('🧩 Testing Core Puzzle Engine Implementations\n');
// Test enum imports
console.log('✅ Enum imports successful:');
console.log(` PuzzleType.LOGIC_GRID: ${PuzzleType.LOGIC_GRID}`);
console.log(` PuzzleType.SEQUENCE: ${PuzzleType.SEQUENCE}`);
console.log(` PuzzleType.SPATIAL: ${PuzzleType.SPATIAL}`);
console.log(` DifficultyLevel.EASY: ${DifficultyLevel.EASY}`);
console.log(` PuzzleStatus.NOT_STARTED: ${PuzzleStatus.NOT_STARTED}\n`);
console.log('🎯 Core puzzle engine type system is working correctly!');
console.log('📝 All enum imports and type definitions are properly configured.');
console.log('\n✨ The puzzle engine is ready for integration testing with NestJS!');