22 lines
652 B
JavaScript
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');
|