UNPKG

1.57 kBTypeScriptView Raw
1import type { SyncTransformer, TransformedSource } from '@jest/transform';
2import type { CompilerInstance, TsJestTransformerOptions, TsJestTransformOptions } from '../types';
3import { ConfigSet } from './config/config-set';
4export declare class TsJestTransformer implements SyncTransformer<TsJestTransformerOptions> {
5 private readonly transformerOptions?;
6 private readonly _logger;
7 protected _compiler: CompilerInstance;
8 private _transformCfgStr;
9 private _depGraphs;
10 private _watchMode;
11 constructor(transformerOptions?: TsJestTransformerOptions | undefined);
12 private _configsFor;
13 protected _createConfigSet(config: TsJestTransformOptions['config'] | undefined): ConfigSet;
14 protected _createCompiler(configSet: ConfigSet, cacheFS: Map<string, string>): void;
15 /**
16 * @public
17 */
18 process(sourceText: string, sourcePath: string, transformOptions: TsJestTransformOptions): TransformedSource;
19 processAsync(sourceText: string, sourcePath: string, transformOptions: TsJestTransformOptions): Promise<TransformedSource>;
20 private processWithTs;
21 private runTsJestHook;
22 /**
23 * Jest uses this to cache the compiled version of a file
24 *
25 * @see https://github.com/facebook/jest/blob/v23.5.0/packages/jest-runtime/src/script_transformer.js#L61-L90
26 *
27 * @public
28 */
29 getCacheKey(fileContent: string, filePath: string, transformOptions: TsJestTransformOptions): string;
30 getCacheKeyAsync(sourceText: string, sourcePath: string, transformOptions: TsJestTransformOptions): Promise<string>;
31}