advanced-games-library
Version:
Advanced Gaming Library for React Native - Four Complete Games with iOS Compatibility Fixes
70 lines (52 loc) ⢠2.28 kB
JavaScript
/**
* Minimal Validation - Tests the minimal version without external dependencies
*/
console.log('š Minimal Package Validation...\n');
try {
console.log('1ļøā£ Testing minimal index.js...');
// Test that minimal index can be loaded
const gameLibrary = require('./index-minimal.js');
console.log('ā
index-minimal.js loaded successfully');
// Check main exports exist
const exportKeys = Object.keys(gameLibrary);
console.log('š¦ Found', exportKeys.length, 'exports');
// Test core exports
const requiredExports = ['GamesLibrary', 'GameUtils', 'GameEngine'];
const missingExports = requiredExports.filter(key => !gameLibrary[key]);
if (missingExports.length > 0) {
throw new Error('Missing required exports: ' + missingExports.join(', '));
}
console.log('ā
All required exports found:', requiredExports.join(', '));
// Test that we can call basic functions
const id = gameLibrary.GameUtils.generateId();
const score = gameLibrary.GameUtils.formatScore(12345);
const time = gameLibrary.GameUtils.formatTime(125);
console.log('ā
GameUtils functions work:');
console.log(' - generateId():', id);
console.log(' - formatScore(12345):', score);
console.log(' - formatTime(125):', time);
// Test async functions
console.log('2ļøā£ Testing async functions...');
gameLibrary.GamesLibrary.initialize({}).then(function(result) {
console.log('ā
GamesLibrary.initialize() works:', result.success);
// Test GameEngine
return gameLibrary.GameEngine.initialize({});
}).then(function(result) {
console.log('ā
GameEngine.initialize() works:', result.success);
console.log('\nš MINIMAL VALIDATION SUCCESSFUL! š');
console.log('š¦ Minimal package works without any dependencies');
console.log('š Ready for NPM publishing!');
}).catch(function(error) {
console.error('ā Async function test failed:', error.message);
process.exit(1);
});
} catch (error) {
console.error('\nā MINIMAL VALIDATION FAILED!');
console.error('Error:', error.message);
if (error.stack) {
console.error('\nStack trace:');
console.error(error.stack.split('\n').slice(0, 3).join('\n'));
}
process.exit(1);
}