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
- 606cdd028ccae5bd2e9b9917b4e8ac7f4e76229a
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;
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 = 3;
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
- var pivot = statements[0];
55
- var leftPart = [];
56
- var rightPart = [];
57
- for (var i = 1; i < statements.length; i++) {
58
- var currentStatement = statements[i];
59
- if (isJestGlobalImport(currentStatement)) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-jest",
3
- "version": "27.1.4",
3
+ "version": "27.1.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {