Socket
Socket
Sign inDemoInstall

ts-jest

Package Overview
Dependencies
Maintainers
3
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-jest - npm Package Compare versions

Comparing version 29.2.0 to 29.2.1

1

dist/legacy/compiler/ts-compiler.d.ts

@@ -24,2 +24,3 @@ import { Logger } from 'bs-logger';

getResolvedModules(fileContent: string, fileName: string, runtimeCacheFS: StringMap): string[];
private fixupCompilerOptionsForModuleKind;
getCompiledOutput(fileContent: string, fileName: string, options: TsJestCompileOptions): CompiledOutput;

@@ -26,0 +27,0 @@ protected _transpileOutput(fileContent: string, fileName: string): TranspileOutput;

38

dist/legacy/compiler/ts-compiler.js

@@ -115,25 +115,27 @@ "use strict";

};
TsCompiler.prototype.fixupCompilerOptionsForModuleKind = function (compilerOptions, isEsm) {
var _a, _b;
if (!isEsm) {
var moduleKind_1 = (_a = compilerOptions.module) !== null && _a !== void 0 ? _a : this._ts.ModuleKind.CommonJS;
var moduleKindValue = [
this._ts.ModuleKind.CommonJS,
this._ts.ModuleKind.Node16,
this._ts.ModuleKind.NodeNext,
].includes(moduleKind_1)
? moduleKind_1
: this._ts.ModuleKind.CommonJS;
return __assign(__assign({}, compilerOptions), { module: moduleKindValue });
}
var moduleKind = (_b = compilerOptions.module) !== null && _b !== void 0 ? _b : this._ts.ModuleKind.ESNext;
var esModuleInterop = [this._ts.ModuleKind.Node16, this._ts.ModuleKind.NodeNext].includes(moduleKind)
? true
: compilerOptions.esModuleInterop;
return __assign(__assign({}, compilerOptions), { module: moduleKind, esModuleInterop: esModuleInterop !== null && esModuleInterop !== void 0 ? esModuleInterop : false });
};
TsCompiler.prototype.getCompiledOutput = function (fileContent, fileName, options) {
var e_1, _a;
var moduleKind = this._initialCompilerOptions.module;
var esModuleInterop = this._initialCompilerOptions.esModuleInterop;
var allowSyntheticDefaultImports = this._initialCompilerOptions.allowSyntheticDefaultImports;
var currentModuleKind = this._compilerOptions.module;
var isEsmMode = this.configSet.useESM && options.supportsStaticESM;
if ((this.configSet.babelJestTransformer || (!this.configSet.babelJestTransformer && options.supportsStaticESM)) &&
this.configSet.useESM) {
moduleKind =
!moduleKind ||
(moduleKind &&
![this._ts.ModuleKind.ES2015, this._ts.ModuleKind.ES2020, this._ts.ModuleKind.ESNext].includes(moduleKind))
? this._ts.ModuleKind.ESNext
: moduleKind;
// Make sure `esModuleInterop` and `allowSyntheticDefaultImports` true to support import CJS into ESM
esModuleInterop = true;
allowSyntheticDefaultImports = true;
}
else {
moduleKind = this._ts.ModuleKind.CommonJS;
}
this._compilerOptions = __assign(__assign({}, this._compilerOptions), { allowSyntheticDefaultImports: allowSyntheticDefaultImports, esModuleInterop: esModuleInterop, module: moduleKind });
this._compilerOptions = this.fixupCompilerOptionsForModuleKind(this._initialCompilerOptions, isEsmMode);
if (this._languageService) {

@@ -140,0 +142,0 @@ this._logger.debug({ fileName: fileName }, 'getCompiledOutput(): compiling using language service');

@@ -438,7 +438,2 @@ "use strict";

});
// at least enable synthetic default imports (except if it's set in the input config)
/* istanbul ignore next (already covered in unit test) */
if (!('allowSyntheticDefaultImports' in finalOptions)) {
finalOptions.allowSyntheticDefaultImports = true;
}
}

@@ -445,0 +440,0 @@ // Make sure when allowJs is enabled, outDir is required to have when using allowJs: true

{
"name": "ts-jest",
"version": "29.2.0",
"version": "29.2.1",
"main": "dist/index.js",

@@ -55,2 +55,3 @@ "types": "dist/index.d.ts",

"bs-logger": "0.x",
"ejs": "^3.0.0",
"fast-json-stable-stringify": "2.x",

@@ -115,8 +116,7 @@ "jest-util": "^29.0.0",

"@types/yargs-parser": "21.0.3",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"babel-jest": "^29.7.0",
"conventional-changelog-cli": "^5.0.0",
"cross-spawn": "latest",
"ejs": "^3.1.10",
"esbuild": "~0.21.5",

@@ -127,3 +127,3 @@ "eslint": "^8.57.0",

"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jsdoc": "^48.5.2",
"eslint-plugin-jsdoc": "^48.6.0",
"eslint-plugin-prefer-arrow": "^1.2.3",

@@ -130,0 +130,0 @@ "eslint-plugin-prettier": "^4.2.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc