2023-01-31 17:55:22 +03:00
|
|
|
/* eslint-disable */
|
|
|
|
import { readFileSync } from 'fs';
|
|
|
|
|
|
|
|
// Reading the SWC compilation config and remove the "exclude"
|
|
|
|
// for the test files to be compiled by SWC
|
|
|
|
const { exclude: _, ...swcJestConfig } = JSON.parse(
|
2023-03-01 17:08:48 +03:00
|
|
|
readFileSync(`${__dirname}/.swcrc`, 'utf-8')
|
2023-01-31 17:55:22 +03:00
|
|
|
);
|
2023-03-01 17:08:48 +03:00
|
|
|
|
|
|
|
// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
|
|
|
|
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
|
|
|
|
if (swcJestConfig.swcrc === undefined) {
|
|
|
|
swcJestConfig.swcrc = false;
|
|
|
|
}
|
|
|
|
|
2023-01-31 17:55:22 +03:00
|
|
|
export default {
|
|
|
|
displayName: 'nx-unplugin-dynamic-asset-loader',
|
|
|
|
preset: '../../../jest.preset.js',
|
2023-03-01 17:08:48 +03:00
|
|
|
globals: {},
|
2023-01-31 17:55:22 +03:00
|
|
|
transform: {
|
2023-03-01 17:08:48 +03:00
|
|
|
'^.+\\.[tj]s$': [
|
|
|
|
'ts-jest',
|
|
|
|
{
|
|
|
|
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
|
|
},
|
|
|
|
],
|
2023-01-31 17:55:22 +03:00
|
|
|
},
|
|
|
|
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
|
|
coverageDirectory: '../../../coverage/libs/nx/unplugin-dynamic-asset-loader',
|
|
|
|
};
|