How to use the ts-jest.process function in ts-jest

To help you get started, we’ve selected a few ts-jest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github urish / typewiz / packages / typewiz-jest / src / index.ts View on Github external
function process(
    src: string,
    filePath: Path,
    jestConfig: JestConfig,
    transformOptions: TransformOptions = { instrument: false },
) {
    src =
        `require('typewiz-node').register();` +
        instrument(src, filePath, {
            instrumentCallExpressions: true,
            instrumentImplicitThis: true,
            tsConfig: 'tsconfig.json', // TODO read it from jest config?
        });
    return originalProcess(src, filePath, jestConfig, transformOptions);
}
github elastic / kibana / src / dev / jest / ts_transform.ts View on Github external
process(
    src: string,
    filePath: jest.Path,
    jestConfig: jest.ProjectConfig,
    transformOptions: jest.TransformOptions
  ) {
    const extendedConfig = extendJestConfig(jestConfig, filePath);
    return TsJest.process(src, filePath, extendedConfig, transformOptions);
  },
github casual-simulation / aux / __mocks__ / formulaLibMock.js View on Github external
function process(...args) {
    return 'module.exports = ' + JSON.stringify(processTs(...args));
}
github thymikee / jest-preset-angular / preprocessor.js View on Github external
module.exports.process = (src, path, config, transformOptions) => {
  if (path.endsWith('.html')) {
    src = src.replace(ESCAPE_TEMPLATE_REGEX, '\\$1');
  }
  src = src
    .replace(TEMPLATE_URL_REGEX, 'template: require($1./$3$4)')
    .replace(STYLE_URLS_REGEX, 'styles: []');
  return process(src, path, config, transformOptions);
};