- Update Jest config with module name mapping for uuid and node-fetch - Add Babel transform for mixed JS/TS support - Configure transformIgnorePatterns for ES modules - Add comprehensive test mocks for uuid and node-fetch - Setup import.meta environment variables for Jest compatibility - Increase test timeout to 30 seconds for integration tests
32 lines
631 B
JavaScript
32 lines
631 B
JavaScript
module.exports = {
|
|
presets: [
|
|
['@babel/preset-env', {
|
|
targets: {
|
|
node: 'current'
|
|
}
|
|
}],
|
|
'@babel/preset-typescript'
|
|
],
|
|
plugins: [
|
|
// Transform import.meta for Jest compatibility
|
|
function() {
|
|
return {
|
|
visitor: {
|
|
MetaProperty(path) {
|
|
if (path.node.meta.name === 'import' && path.node.property.name === 'meta') {
|
|
path.replaceWithSourceString('({ env: process.env })');
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
],
|
|
env: {
|
|
test: {
|
|
plugins: [
|
|
// Additional test-specific plugins can go here
|
|
]
|
|
}
|
|
}
|
|
};
|