diff --git a/jest.config.js b/jest.config.js index 7437f67981..f75403fbb4 100644 --- a/jest.config.js +++ b/jest.config.js @@ -129,6 +129,7 @@ module.exports = { roots: [''], moduleDirectories: ['node_modules', '.'], moduleNameMapper: { + '^aiox-core/(.*)$': '/.aiox-core/$1', '^@aiox-core/(.*)$': '/.aiox-core/$1', }, setupFilesAfterEnv: ['/tests/setup.js'], diff --git a/tests/config/jest-module-mapper.test.js b/tests/config/jest-module-mapper.test.js new file mode 100644 index 0000000000..21457dec45 --- /dev/null +++ b/tests/config/jest-module-mapper.test.js @@ -0,0 +1,10 @@ +'use strict'; + +describe('Jest moduleNameMapper', () => { + test('resolves package-style aiox-core imports to framework modules', () => { + const LayerProcessor = require('aiox-core/core/synapse/layers/layer-processor'); + + expect(typeof LayerProcessor).toBe('function'); + expect(LayerProcessor.name).toBe('LayerProcessor'); + }); +});