2018-07-24 01:18:37 +03:00
|
|
|
const tsTransformer = require('jest-preset-angular/preprocessor');
|
2018-08-15 17:26:24 +03:00
|
|
|
const babelTransformer = require('./babel-jest');
|
2018-07-24 01:18:37 +03:00
|
|
|
|
|
|
|
module.exports.process = function transform(src, path, config, transformOptions) {
|
|
|
|
const tsResult = tsTransformer.process(src, path, config, transformOptions);
|
|
|
|
const jsPath = path.replace('.ts', '.js');
|
2018-08-05 17:57:17 +02:00
|
|
|
const source = typeof tsResult === 'string' ? tsResult : tsResult.code;
|
2018-07-24 01:18:37 +03:00
|
|
|
|
2018-08-05 12:29:44 +03:00
|
|
|
return babelTransformer.process(source, jsPath, config, transformOptions);
|
2018-07-24 01:18:37 +03:00
|
|
|
};
|