ts-jest 27.1.4 → 27.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
cb2019d45794942b3c8d9420b1587f678d6e2014
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
## [27.1.4](https://github.com/kulshekhar/ts-jest/compare/v27.1.3...v27.1.4) (2022-03-24)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **transformers** use `Array.sort` in hoisting transformer ([#3498](https://github.com/kulshekhar/ts-jest/pull/3498)) ([e400a6e](https://github.com/kulshekhar/ts-jest/commit/e400a6ec0e4706f606ae9b1e2897b0bb1cff6343)), fixes [#3476](https://github.com/kulshekhar/ts-jest/issues/3476)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [27.1.4](https://github.com/kulshekhar/ts-jest/compare/v27.1.3...v27.1.4) (2022-03-24)
|
|
11
|
+
|
|
12
|
+
|
|
4
13
|
### Bug Fixes
|
|
5
14
|
|
|
6
15
|
* **compiler:** revert [#3194](https://github.com/kulshekhar/ts-jest/issues/3194) ([#3362](https://github.com/kulshekhar/ts-jest/issues/3362)) ([2b7dffe](https://github.com/kulshekhar/ts-jest/commit/2b7dffeac940f779922c43cefba3f741a3911b49)), closes [#3272](https://github.com/kulshekhar/ts-jest/issues/3272)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type _ts from 'typescript';
|
|
2
2
|
import type { TsCompilerInstance } from '../types';
|
|
3
|
-
export declare const version =
|
|
3
|
+
export declare const version = 4;
|
|
4
4
|
export declare const name = "hoist-jest";
|
|
5
5
|
export declare function factory({ configSet }: TsCompilerInstance): (ctx: _ts.TransformationContext) => _ts.Transformer<_ts.SourceFile>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.factory = exports.name = exports.version = void 0;
|
|
4
4
|
var bs_logger_1 = require("bs-logger");
|
|
5
|
-
exports.version =
|
|
5
|
+
exports.version = 4;
|
|
6
6
|
exports.name = 'hoist-jest';
|
|
7
7
|
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock', 'deepUnmock'];
|
|
8
8
|
var JEST_GLOBALS_MODULE_NAME = '@jest/globals';
|
|
@@ -51,21 +51,12 @@ function factory(_a) {
|
|
|
51
51
|
if (statements.length <= 1) {
|
|
52
52
|
return statements;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
leftPart.push(currentStatement);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
isHoistableStatement(currentStatement) && !isHoistableStatement(pivot) && !isJestGlobalImport(pivot)
|
|
64
|
-
? leftPart.push(currentStatement)
|
|
65
|
-
: rightPart.push(currentStatement);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return sortStatements(leftPart).concat(pivot, sortStatements(rightPart));
|
|
54
|
+
return statements.sort(function (stmtA, stmtB) {
|
|
55
|
+
return isJestGlobalImport(stmtA) ||
|
|
56
|
+
(isHoistableStatement(stmtA) && !isHoistableStatement(stmtB) && !isJestGlobalImport(stmtB))
|
|
57
|
+
? -1
|
|
58
|
+
: 1;
|
|
59
|
+
});
|
|
69
60
|
};
|
|
70
61
|
var createVisitor = function (ctx, _) {
|
|
71
62
|
var visitor = function (node) {
|