feat: configure Jest testing infrastructure
- 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
This commit is contained in:
31
babel.config.cjs
Normal file
31
babel.config.cjs
Normal file
@@ -0,0 +1,31 @@
|
||||
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
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user