Comparing version 27.0.1 to 27.0.2
@@ -54,3 +54,2 @@ "use strict"; | ||
var constants_1 = require("../constants"); | ||
var json_1 = require("../utils/json"); | ||
var logger_1 = require("../utils/logger"); | ||
@@ -111,2 +110,3 @@ var messages_1 = require("../utils/messages"); | ||
var allowSyntheticDefaultImports = this._initialCompilerOptions.allowSyntheticDefaultImports; | ||
var currentModuleKind = this._compilerOptions.module; | ||
if (options.supportsStaticESM && this.configSet.useESM) { | ||
@@ -129,3 +129,3 @@ moduleKind = | ||
this._logger.debug({ fileName: fileName }, 'getCompiledOutput(): compiling using language service'); | ||
this._updateMemoryCache(fileContent, fileName); | ||
this._updateMemoryCache(fileContent, fileName, currentModuleKind === moduleKind); | ||
var output = this._languageService.getEmitOutput(fileName); | ||
@@ -202,3 +202,3 @@ this._doTypeChecking(fileName, options.depGraphs, options.watchMode); | ||
var fileContent = (_d = (_b = (_a = _this._fileContentCache.get(normalizedFileName)) !== null && _a !== void 0 ? _a : _this._runtimeCacheFS.get(normalizedFileName)) !== null && _b !== void 0 ? _b : (_c = _this._cachedReadFile) === null || _c === void 0 ? void 0 : _c.call(_this, normalizedFileName)) !== null && _d !== void 0 ? _d : undefined; | ||
if (fileContent) { | ||
if (fileContent !== undefined) { | ||
_this._fileContentCache.set(normalizedFileName, fileContent); | ||
@@ -260,3 +260,4 @@ _this._fileVersionCache.set(normalizedFileName, 1); | ||
}; | ||
TsCompiler.prototype._updateMemoryCache = function (contents, fileName) { | ||
TsCompiler.prototype._updateMemoryCache = function (contents, fileName, isModuleKindTheSame) { | ||
if (isModuleKindTheSame === void 0) { isModuleKindTheSame = true; } | ||
this._logger.debug({ fileName: fileName }, 'updateMemoryCache: update memory cache for language service'); | ||
@@ -277,9 +278,6 @@ var shouldIncrementProjectVersion = false; | ||
} | ||
if (!this._parsedTsConfig.fileNames.includes(fileName)) { | ||
if (!this._parsedTsConfig.fileNames.includes(fileName) || !isModuleKindTheSame) { | ||
shouldIncrementProjectVersion = true; | ||
} | ||
} | ||
if (json_1.stringify(this._compilerOptions) !== json_1.stringify(this._initialCompilerOptions)) { | ||
shouldIncrementProjectVersion = true; | ||
} | ||
if (shouldIncrementProjectVersion) | ||
@@ -286,0 +284,0 @@ this._projectVersion++; |
@@ -210,5 +210,5 @@ "use strict"; | ||
} | ||
this._shouldGetDiagnosticsForFile = this._diagnostics.exclude.length | ||
this._shouldIgnoreDiagnosticsForFile = this._diagnostics.exclude.length | ||
? jest_util_1.globsToMatcher(this._diagnostics.exclude) | ||
: function () { return true; }; | ||
: function () { return false; }; | ||
this.logger.debug({ diagnostics: this._diagnostics }, 'normalized diagnostics config via ts-jest option'); | ||
@@ -401,4 +401,4 @@ var tsconfigOpt = options.tsconfig; | ||
return constants_1.JS_JSX_EXTENSIONS.includes(fileExtension) | ||
? this.parsedTsConfig.options.checkJs && this._shouldGetDiagnosticsForFile(filePath) | ||
: this._shouldGetDiagnosticsForFile(filePath); | ||
? this.parsedTsConfig.options.checkJs && !this._shouldIgnoreDiagnosticsForFile(filePath) | ||
: !this._shouldIgnoreDiagnosticsForFile(filePath); | ||
}; | ||
@@ -405,0 +405,0 @@ ConfigSet.prototype._createTsError = function (diagnostics) { |
{ | ||
"name": "ts-jest", | ||
"version": "27.0.1", | ||
"version": "27.0.2", | ||
"main": "dist/index.js", | ||
@@ -122,2 +122,3 @@ "types": "dist/index.d.ts", | ||
"fs-extra": "10.x", | ||
"glob": "^7.1.7", | ||
"glob-gitignore": "latest", | ||
@@ -124,0 +125,0 @@ "husky": "4.x", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234471
44
3019