1 | import type CJSImportProcessor from "../CJSImportProcessor";
|
2 | import type NameManager from "../NameManager";
|
3 | import type TokenProcessor from "../TokenProcessor";
|
4 | import type RootTransformer from "./RootTransformer";
|
5 | import Transformer from "./Transformer";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export default class JestHoistTransformer extends Transformer {
|
15 | readonly rootTransformer: RootTransformer;
|
16 | readonly tokens: TokenProcessor;
|
17 | readonly nameManager: NameManager;
|
18 | readonly importProcessor: CJSImportProcessor | null;
|
19 | private readonly hoistedFunctionNames;
|
20 | constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, importProcessor: CJSImportProcessor | null);
|
21 | process(): boolean;
|
22 | getHoistedCode(): string;
|
23 | /**
|
24 | * Extracts any methods calls on the jest-object that should be hoisted.
|
25 | *
|
26 | * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options,
|
27 | * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted.
|
28 | *
|
29 | * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does.
|
30 | */
|
31 | private extractHoistedCalls;
|
32 | }
|