Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 299063@bnt-lap001 Assistant-Session: 53eb1e1c-c13a-4277-9ce2-3702960d93f7
26 lines
768 B
JavaScript
26 lines
768 B
JavaScript
/**
|
|
* 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>';
|
|
});
|