generated from coulomb/repo-seed
feat: add refactored testdrive-jsui capability with consolidated architecture
Complete integration of refactored testdrive-jsui capability: ## Refactored Architecture - js/ - All JavaScript source (controls, components, core) - static/ - CSS, images, templates - src/testdrive_jsui/ - Python package - tests/ - Python tests ## Plugin Self-Declaration - get_plugin_source_dir() - plugin declares own location - get_asset_paths() - organized asset paths - No hardcoded discovery logic ## Merged Content - Baseline UI scaffold (tutorials, LICENSE, INTRODUCTION.md) - Refactored capability implementation - Comprehensive documentation Ready for standalone use or integration with markitect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
26
js/tests/jest.setup.js
Normal file
26
js/tests/jest.setup.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Jest Setup File for JavaScript UI Tests
|
||||
*
|
||||
* Sets up environment and global utilities for testing.
|
||||
* Jest with jsdom environment already provides DOM globals.
|
||||
*/
|
||||
|
||||
// Add TextEncoder/TextDecoder polyfills for Node.js compatibility
|
||||
const { TextEncoder, TextDecoder } = require('util');
|
||||
global.TextEncoder = TextEncoder;
|
||||
global.TextDecoder = TextDecoder;
|
||||
|
||||
// Mock console methods to reduce noise in tests
|
||||
const originalLog = console.log;
|
||||
console.log = (...args) => {
|
||||
// Only log if DEBUG_TESTS environment variable is set
|
||||
if (process.env.DEBUG_TESTS) {
|
||||
originalLog(...args);
|
||||
}
|
||||
};
|
||||
|
||||
// Setup DOM fixtures after page load
|
||||
beforeEach(() => {
|
||||
// Reset document body for each test
|
||||
document.body.innerHTML = '<div id="content"></div>';
|
||||
});
|
||||
Reference in New Issue
Block a user