oxjs/test/test-setup.js
Sanjay Bhangar d51d3f60f1 Complete core ES module migration with build system and tests
- Enhanced build system to generate ESM, UMD, and minified formats
- Fixed test extraction script to properly parse OxJS inline tests
- Added comprehensive test infrastructure with Vitest
- Successfully extracted 22 test files from inline documentation
- Verified builds work in browser and Node.js environments
- Maintained full backward compatibility with Ox.load() pattern
- Updated .gitignore to exclude build artifacts (dev/, min/, dist/, test/extracted/)

Generated with AI assistance
2026-02-09 17:58:48 +05:30

22 lines
652 B
JavaScript

/**
* Test setup for running extracted OxJS inline tests
*/
// Load OxJS ES modules
import Ox from '../src/ox/index.js';
// Helper function to evaluate test statements in context
global.evaluateInContext = async function(statement) {
try {
// This will need to be enhanced to handle async tests
// For now, we'll use eval which isn't ideal but matches the original test system
return eval(statement);
} catch (error) {
console.error('Error evaluating:', statement, error);
throw error;
}
};
// Make Ox available globally for tests
global.Ox = Ox;
console.log('Test environment setup complete');