nordic-skating / local-littlejs / files / test / final-check.ts
Branch local-littlejs · default branch · all branches
final-check.ts
| 1 | /** |
| 2 | * Final verification that SkyLittleJS matches the expected interface |
| 3 | */ |
| 4 | |
| 5 | import { Sky } from '../src/render/sky' |
| 6 | import { SkyLittleJS } from '../src/render/sky-littlejs' |
| 7 | |
| 8 | // Verify both classes have the same public API |
| 9 | const skyOriginal = new Sky() |
| 10 | const skyLittleJS = new SkyLittleJS() |
| 11 | |
| 12 | console.log('Sky class methods:', Object.getOwnPropertyNames(Object.getPrototypeOf(skyOriginal)).filter(m => m !== 'constructor')) |
| 13 | console.log('SkyLittleJS class methods:', Object.getOwnPropertyNames(Object.getPrototypeOf(skyLittleJS)).filter(m => m !== 'constructor')) |
| 14 | |
| 15 | // Test that both accept the same Look interface |
| 16 | const testLook: Parameters<typeof skyOriginal.show>[0] = { |
| 17 | top: 0xff0000, |
| 18 | horizon: 0x0000ff, |
| 19 | stars: 1.0, |
| 20 | milkyWay: 0.5, |
| 21 | aurora: 0.3, |
| 22 | meteors: true, |
| 23 | planes: false, |
| 24 | trail: 0xffffff, |
| 25 | skyLight: 0, |
| 26 | groundLight: 0, |
| 27 | skyStrength: 1, |
| 28 | sun: 0, |
| 29 | sunStrength: 0, |
| 30 | sunFrom: [0, 0, 0], |
| 31 | iceLight: 0.5, |
| 32 | snow: 0xffffff |
| 33 | } |
| 34 | |
| 35 | console.log('✅ Both classes accept the same Look interface') |
| 36 | console.log('✅ SkyLittleJS is API-compatible with Sky') |