ts-jest 24.1.0 → 25.1.0
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 +1 -1
- package/CHANGELOG.md +74 -25
- package/README.md +5 -1
- package/dist/compiler.js +8 -6
- package/dist/config/config-set.d.ts +24 -24
- package/dist/config/config-set.js +6 -1
- package/dist/config/create-jest-preset.d.ts +3 -3
- package/dist/transformers/hoist-jest.js +1 -1
- package/dist/ts-jest-transformer.d.ts +6 -5
- package/dist/types.d.ts +5 -5
- package/dist/util/version-checkers.js +2 -2
- package/package.json +8 -4
package/.ts-jest-digest
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
af7bbf7e663ac60b3ae18315d724364130906791
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,61 @@
|
|
|
1
|
+
<a name="25.1.0"></a>
|
|
2
|
+
# [25.1.0](https://github.com/kulshekhar/ts-jest/compare/v25.0.0...v25.1.0) (2020-01-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* jest 25 type definitions ([ba82a9e](https://github.com/kulshekhar/ts-jest/commit/ba82a9e))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<a name="25.0.0"></a>
|
|
12
|
+
# [25.0.0](https://github.com/kulshekhar/ts-jest/compare/v24.3.0...v25.0.0) (2020-01-23)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Fix tests for version checks v2 ([154f1d6](https://github.com/kulshekhar/ts-jest/commit/154f1d6))
|
|
18
|
+
* Try to fix snapshots ([ea0ea50](https://github.com/kulshekhar/ts-jest/commit/ea0ea50))
|
|
19
|
+
* Try to fix snapshots v2 ([82445bb](https://github.com/kulshekhar/ts-jest/commit/82445bb))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* support Jest 25 ([ffc2cfe](https://github.com/kulshekhar/ts-jest/commit/ffc2cfe))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<a name="24.3.0"></a>
|
|
29
|
+
# [24.3.0](https://github.com/kulshekhar/ts-jest/compare/v24.2.0...v24.3.0) (2020-01-07)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **config:** support babel config file path as string ([#1332](https://github.com/kulshekhar/ts-jest/issues/1332)) ([78a53c2](https://github.com/kulshekhar/ts-jest/commit/78a53c2))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<a name="24.2.0"></a>
|
|
39
|
+
# [24.2.0](https://github.com/kulshekhar/ts-jest/compare/v24.1.0...v24.2.0) (2019-11-22)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **compiler:** pass filename to sha function instead of file extension ([ac1ac97](https://github.com/kulshekhar/ts-jest/commit/ac1ac97))
|
|
45
|
+
* **transformers:** hoist jest.enableAutomock and jest.disableAutomock ([ac50bc3](https://github.com/kulshekhar/ts-jest/commit/ac50bc3))
|
|
46
|
+
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
1
50
|
<a name="24.1.0"></a>
|
|
2
51
|
# [24.1.0](https://github.com/kulshekhar/ts-jest/compare/v24.0.2...v24.1.0) (2019-09-12)
|
|
3
52
|
|
|
4
53
|
|
|
5
54
|
### Bug Fixes
|
|
6
55
|
|
|
56
|
+
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
|
7
57
|
* [#825](https://github.com/kulshekhar/ts-jest/issues/825) handle symlinked modules (ala pnpm) correctly ([e190b23](https://github.com/kulshekhar/ts-jest/commit/e190b23))
|
|
8
58
|
* handle tsBuildInfoFile option ([f9583e9](https://github.com/kulshekhar/ts-jest/commit/f9583e9)), closes [#1095](https://github.com/kulshekhar/ts-jest/issues/1095)
|
|
9
|
-
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
|
10
59
|
* **types:** unforce esModuleInterop in tsconfig.json ([c2d39b6](https://github.com/kulshekhar/ts-jest/commit/c2d39b6))
|
|
11
60
|
|
|
12
61
|
|
|
@@ -218,23 +267,26 @@
|
|
|
218
267
|
|
|
219
268
|
### Bug Fixes
|
|
220
269
|
|
|
221
|
-
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
|
|
222
270
|
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
|
|
223
|
-
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
|
|
224
271
|
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
|
|
225
272
|
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
|
|
226
273
|
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
|
|
227
274
|
* babel-config + adds test ([12146c3](https://github.com/kulshekhar/ts-jest/commit/12146c3))
|
|
228
|
-
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
|
229
275
|
* fixes js style to be node < 10 compatible ([83d7517](https://github.com/kulshekhar/ts-jest/commit/83d7517))
|
|
230
276
|
* hoisting per level + memoize fix ([31847b0](https://github.com/kulshekhar/ts-jest/commit/31847b0))
|
|
277
|
+
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
|
|
278
|
+
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
|
|
231
279
|
* makes node6 happy ([f170285](https://github.com/kulshekhar/ts-jest/commit/f170285))
|
|
280
|
+
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
|
|
232
281
|
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
|
|
233
282
|
* normalizes bundle hash on any node version ([ce7afaf](https://github.com/kulshekhar/ts-jest/commit/ce7afaf))
|
|
283
|
+
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
|
|
234
284
|
* source maps ([89a30c9](https://github.com/kulshekhar/ts-jest/commit/89a30c9))
|
|
285
|
+
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
|
|
235
286
|
* updates templates ([f2e1da2](https://github.com/kulshekhar/ts-jest/commit/f2e1da2))
|
|
236
287
|
* uses cross-platform spawn + fix pkg versions ([ac1599c](https://github.com/kulshekhar/ts-jest/commit/ac1599c))
|
|
237
288
|
* we are not writing files, use normalized EOL ([47fff43](https://github.com/kulshekhar/ts-jest/commit/47fff43))
|
|
289
|
+
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
|
238
290
|
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
|
|
239
291
|
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
|
|
240
292
|
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
|
|
@@ -242,32 +294,33 @@
|
|
|
242
294
|
|
|
243
295
|
### Features
|
|
244
296
|
|
|
245
|
-
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
|
246
297
|
* **config:** adds a helper to build moduleNameMapper from paths ([7b8598e](https://github.com/kulshekhar/ts-jest/commit/7b8598e)), closes [#364](https://github.com/kulshekhar/ts-jest/issues/364)
|
|
247
298
|
* **logging:** improves log messages + tests ([5d03c4d](https://github.com/kulshekhar/ts-jest/commit/5d03c4d))
|
|
248
|
-
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
|
249
|
-
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
|
250
299
|
* adds logging + better hashing ([4322701](https://github.com/kulshekhar/ts-jest/commit/4322701))
|
|
251
|
-
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
|
252
300
|
* allow env var to add diagnostic codes to ignore ([777edf5](https://github.com/kulshekhar/ts-jest/commit/777edf5))
|
|
253
301
|
* cache key + tests ([bd55448](https://github.com/kulshekhar/ts-jest/commit/bd55448))
|
|
302
|
+
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
|
254
303
|
* directly writes to stdio so jest does not swallow ([6a7f01f](https://github.com/kulshekhar/ts-jest/commit/6a7f01f))
|
|
255
304
|
* handles stringifyContentPathRegex ([3fcb4bd](https://github.com/kulshekhar/ts-jest/commit/3fcb4bd))
|
|
256
305
|
* hoisting + tests + many other things ([6186e84](https://github.com/kulshekhar/ts-jest/commit/6186e84))
|
|
257
306
|
* io serializer + other test utils ([d03e0e7](https://github.com/kulshekhar/ts-jest/commit/d03e0e7))
|
|
307
|
+
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
|
258
308
|
* warn about unsupported versions ([1103071](https://github.com/kulshekhar/ts-jest/commit/1103071))
|
|
309
|
+
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
|
310
|
+
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
|
259
311
|
|
|
260
312
|
|
|
261
313
|
### Performance Improvements
|
|
262
314
|
|
|
263
|
-
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
|
|
264
315
|
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
|
|
316
|
+
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
|
317
|
+
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
|
318
|
+
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
|
|
265
319
|
* do not type check if fileName doesn't match ([cc45adc](https://github.com/kulshekhar/ts-jest/commit/cc45adc))
|
|
266
320
|
* faster tests ([37a0187](https://github.com/kulshekhar/ts-jest/commit/37a0187))
|
|
321
|
+
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
|
|
267
322
|
* more cleaning ([c48f7b8](https://github.com/kulshekhar/ts-jest/commit/c48f7b8))
|
|
268
323
|
* trying to improve travis-ci conf ([e4b4d95](https://github.com/kulshekhar/ts-jest/commit/e4b4d95))
|
|
269
|
-
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
|
270
|
-
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
|
271
324
|
|
|
272
325
|
|
|
273
326
|
|
|
@@ -277,30 +330,26 @@
|
|
|
277
330
|
|
|
278
331
|
### Bug Fixes
|
|
279
332
|
|
|
280
|
-
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
|
281
|
-
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
|
282
|
-
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
|
283
|
-
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
|
|
284
|
-
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
|
|
285
|
-
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
|
|
286
333
|
* allow (but deprecate) use of old preprocessor.js ([a65079f](https://github.com/kulshekhar/ts-jest/commit/a65079f))
|
|
287
334
|
* big refactor + fixes (mainly cache key + coverage) ([e46caae](https://github.com/kulshekhar/ts-jest/commit/e46caae))
|
|
288
335
|
* fixes coverage and tests ([09500c2](https://github.com/kulshekhar/ts-jest/commit/09500c2))
|
|
289
336
|
* gracefully load [@babel](https://github.com/babel)/core or babel-core ([98b2410](https://github.com/kulshekhar/ts-jest/commit/98b2410))
|
|
290
337
|
* hack for babel < 6 so that breakpoints do work ([90c74ef](https://github.com/kulshekhar/ts-jest/commit/90c74ef)), closes [#627](https://github.com/kulshekhar/ts-jest/issues/627)
|
|
291
|
-
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
|
|
292
|
-
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
|
|
293
|
-
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
|
|
294
338
|
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
|
|
295
339
|
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
|
|
296
|
-
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
|
|
297
340
|
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
|
|
341
|
+
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
|
342
|
+
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
|
343
|
+
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
|
344
|
+
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
|
|
345
|
+
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
|
|
346
|
+
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
|
|
347
|
+
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
|
|
298
348
|
|
|
299
349
|
|
|
300
350
|
### Performance Improvements
|
|
301
351
|
|
|
302
352
|
* do not hash cache key, jest does it underneath ([fbe4f1f](https://github.com/kulshekhar/ts-jest/commit/fbe4f1f))
|
|
303
|
-
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
|
|
304
353
|
|
|
305
354
|
|
|
306
355
|
|
|
@@ -316,9 +365,9 @@
|
|
|
316
365
|
### Bug Fixes
|
|
317
366
|
|
|
318
367
|
* **package:** update source-map-support to version 0.5.0 ([f0aab12](https://github.com/kulshekhar/ts-jest/commit/f0aab12))
|
|
319
|
-
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
|
320
368
|
* **package:** update yargs to version 10.0.3 ([5cdf969](https://github.com/kulshekhar/ts-jest/commit/5cdf969))
|
|
321
369
|
* **package:** update yargs to version 11.0.0 ([7e9ce40](https://github.com/kulshekhar/ts-jest/commit/7e9ce40))
|
|
370
|
+
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
|
322
371
|
* **package:** update yargs to version 9.0.1 ([#326](https://github.com/kulshekhar/ts-jest/issues/326)) ([8bf9924](https://github.com/kulshekhar/ts-jest/commit/8bf9924))
|
|
323
372
|
|
|
324
373
|
|
|
@@ -374,10 +423,10 @@
|
|
|
374
423
|
|
|
375
424
|
### Bug Fixes
|
|
376
425
|
|
|
377
|
-
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
|
|
378
|
-
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
|
|
379
426
|
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
|
|
380
427
|
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
|
|
428
|
+
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
|
|
429
|
+
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
|
|
381
430
|
|
|
382
431
|
|
|
383
432
|
### Features
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ It supports all features of TypeScript including type-checking. [Read more about
|
|
|
13
13
|
|
|
14
14
|
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
|
|
15
15
|
|
|
16
|
-
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://
|
|
16
|
+
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://join.slack.com/t/ts-jest/shared_invite/enQtNDE1ODQ0OTEzMTczLWI5NTQ4ZmEzOTYxYzM2NjhiZDM2ZTI3MGYyYjA2Y2E1YTMxMjUyYTcxNTlmNjAyZTc2Nzk4YTRmZmRhYmZmYTg)
|
|
17
17
|
|
|
18
18
|
<!--
|
|
19
19
|
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
|
|
@@ -57,6 +57,10 @@ We **DO NOT** use [SemVer](http://semver.org/) for versioning. Though you can th
|
|
|
57
57
|
|
|
58
58
|
See also the list of [contributors](https://github.com/kulshekhar/ts-jest/contributors) who participated in this project.
|
|
59
59
|
|
|
60
|
+
## Supporters
|
|
61
|
+
|
|
62
|
+
- [JetBrains](https://www.jetbrains.com/?from=ts-jest) has been kind enough to support ts-jest with an [open source license](https://www.jetbrains.com/community/opensource/?from=ts-jest).
|
|
63
|
+
|
|
60
64
|
## License
|
|
61
65
|
|
|
62
66
|
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
|
package/dist/compiler.js
CHANGED
|
@@ -115,16 +115,18 @@ function createCompiler(configs) {
|
|
|
115
115
|
var serviceHost = {
|
|
116
116
|
getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
|
|
117
117
|
getScriptVersion: function (fileName) {
|
|
118
|
-
var
|
|
118
|
+
var normalizedFileName = path_1.normalize(fileName);
|
|
119
|
+
var version = memoryCache.versions[normalizedFileName];
|
|
119
120
|
return version === undefined ? undefined : String(version);
|
|
120
121
|
},
|
|
121
122
|
getScriptSnapshot: function (fileName) {
|
|
122
|
-
var
|
|
123
|
-
|
|
123
|
+
var normalizedFileName = path_1.normalize(fileName);
|
|
124
|
+
var hit = hasOwn.call(memoryCache.contents, normalizedFileName);
|
|
125
|
+
logger.trace({ normalizedFileName: normalizedFileName, cacheHit: hit }, "getScriptSnapshot():", 'cache', hit ? 'hit' : 'miss');
|
|
124
126
|
if (!hit) {
|
|
125
|
-
memoryCache.contents[
|
|
127
|
+
memoryCache.contents[normalizedFileName] = ts.sys.readFile(normalizedFileName);
|
|
126
128
|
}
|
|
127
|
-
var contents = memoryCache.contents[
|
|
129
|
+
var contents = memoryCache.contents[normalizedFileName];
|
|
128
130
|
if (contents === undefined) {
|
|
129
131
|
return;
|
|
130
132
|
}
|
|
@@ -226,7 +228,7 @@ function updateSourceMap(sourceMapText, fileName, _sourceRoot) {
|
|
|
226
228
|
return stableStringify(sourceMap);
|
|
227
229
|
}
|
|
228
230
|
function getCacheName(sourceCode, fileName) {
|
|
229
|
-
return sha1_1.sha1(
|
|
231
|
+
return sha1_1.sha1(fileName, '\x00', sourceCode);
|
|
230
232
|
}
|
|
231
233
|
function isValidCacheContent(contents) {
|
|
232
234
|
return /(?:9|0=|Q==)$/.test(contents.slice(-3));
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { Config } from '@jest/types';
|
|
2
2
|
import { Logger } from 'bs-logger';
|
|
3
3
|
import { CompilerOptions, CustomTransformers, ParsedCommandLine } from 'typescript';
|
|
4
4
|
import { AstTransformerDesc, BabelConfig, BabelJestTransformer, TTypeScript, TsCompiler, TsJestConfig, TsJestGlobalOptions, TsJestHooksMap } from '../types';
|
|
5
5
|
export declare class ConfigSet {
|
|
6
6
|
readonly parentOptions?: TsJestGlobalOptions | undefined;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
get projectPackageJson(): Record<string, any>;
|
|
8
|
+
get projectDependencies(): Record<string, string>;
|
|
9
|
+
get jest(): Config.ProjectConfig;
|
|
10
|
+
get tsJest(): TsJestConfig;
|
|
11
|
+
get typescript(): ParsedCommandLine;
|
|
12
|
+
get tsconfig(): any;
|
|
13
|
+
get versions(): Record<string, string>;
|
|
14
14
|
private static loadConfig;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
get babel(): BabelConfig | undefined;
|
|
16
|
+
get compilerModule(): TTypeScript;
|
|
17
|
+
get babelJestTransformer(): BabelJestTransformer | undefined;
|
|
18
|
+
get tsCompiler(): TsCompiler;
|
|
19
|
+
get astTransformers(): AstTransformerDesc[];
|
|
20
|
+
get tsCustomTransformers(): CustomTransformers;
|
|
21
|
+
get hooks(): TsJestHooksMap;
|
|
22
|
+
get shouldReportDiagnostic(): (filePath: string) => boolean;
|
|
23
|
+
get shouldStringifyContent(): (filePath: string) => boolean;
|
|
24
|
+
get tsCacheDir(): string | undefined;
|
|
25
|
+
get overriddenCompilerOptions(): Partial<CompilerOptions>;
|
|
26
|
+
get rootDir(): string;
|
|
27
|
+
get cwd(): string;
|
|
28
|
+
get tsJestDigest(): string;
|
|
29
|
+
get cacheKey(): string;
|
|
30
30
|
readonly logger: Logger;
|
|
31
|
-
constructor(jestConfig:
|
|
31
|
+
constructor(jestConfig: Config.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
|
|
32
32
|
resolvePath(inputPath: string, { throwIfMissing, nodeResolve }?: {
|
|
33
33
|
throwIfMissing?: boolean;
|
|
34
34
|
nodeResolve?: boolean;
|
|
@@ -361,7 +361,12 @@ var ConfigSet = (function () {
|
|
|
361
361
|
var base = { cwd: this.cwd };
|
|
362
362
|
if (babelConfig.kind === 'file') {
|
|
363
363
|
if (babelConfig.value) {
|
|
364
|
-
|
|
364
|
+
if (path_1.extname(babelConfig.value) === '.js') {
|
|
365
|
+
base = __assign(__assign({}, base), require(babelConfig.value));
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
base = __assign(__assign({}, base), json5.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
|
|
369
|
+
}
|
|
365
370
|
}
|
|
366
371
|
}
|
|
367
372
|
else if (babelConfig.kind === 'inline') {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { Config } from '@jest/types';
|
|
2
2
|
export interface TsJestPresets {
|
|
3
|
-
transform:
|
|
3
|
+
transform: Config.InitialOptions['transform'];
|
|
4
4
|
testMatch?: string[];
|
|
5
5
|
moduleFileExtensions?: string[];
|
|
6
6
|
}
|
|
7
7
|
export interface CreateJestPresetOptions {
|
|
8
8
|
allowJs?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?:
|
|
10
|
+
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: Config.InitialOptions): TsJestPresets;
|
|
@@ -21,7 +21,7 @@ var __spread = (this && this.__spread) || function () {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
var bs_logger_1 = require("bs-logger");
|
|
24
|
-
var HOIST_METHODS = ['mock', 'unmock'];
|
|
24
|
+
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock'];
|
|
25
25
|
exports.name = 'hoisting-jest-mock';
|
|
26
26
|
exports.version = 1;
|
|
27
27
|
function factory(cs) {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransformOptions, TransformedSource, Transformer } from '@jest/transform/build/types';
|
|
2
|
+
import { Config } from '@jest/types';
|
|
2
3
|
import { Logger } from 'bs-logger';
|
|
3
4
|
import { ConfigSet } from './config/config-set';
|
|
4
5
|
import { TsJestGlobalOptions } from './types';
|
|
5
|
-
export declare class TsJestTransformer implements
|
|
6
|
-
static
|
|
6
|
+
export declare class TsJestTransformer implements Transformer {
|
|
7
|
+
static get lastTransformerId(): number;
|
|
7
8
|
readonly logger: Logger;
|
|
8
9
|
readonly id: number;
|
|
9
10
|
readonly options: TsJestGlobalOptions;
|
|
10
11
|
constructor(baseOptions?: TsJestGlobalOptions);
|
|
11
|
-
configsFor(jestConfig:
|
|
12
|
-
process(input: string, filePath:
|
|
12
|
+
configsFor(jestConfig: Config.ProjectConfig | string): ConfigSet;
|
|
13
|
+
process(input: string, filePath: Config.Path, jestConfig: Config.ProjectConfig, transformOptions?: TransformOptions): TransformedSource | string;
|
|
13
14
|
getCacheKey(fileContent: string, filePath: string, jestConfigStr: string, transformOptions?: {
|
|
14
15
|
instrument?: boolean;
|
|
15
16
|
rootDir?: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransformedSource, Transformer } from '@jest/transform/build/types';
|
|
2
2
|
import * as _babel from 'babel__core';
|
|
3
3
|
import { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
|
|
4
4
|
import * as _ts from 'typescript';
|
|
5
5
|
import { ConfigSet } from './config/config-set';
|
|
6
6
|
export declare type TBabelCore = typeof _babel;
|
|
7
7
|
export declare type TTypeScript = typeof _ts;
|
|
8
|
-
export declare type TBabelJest = Required<
|
|
8
|
+
export declare type TBabelJest = Required<Transformer>;
|
|
9
9
|
export declare type BabelJestTransformer = {
|
|
10
|
-
[K in Exclude<keyof
|
|
10
|
+
[K in Exclude<keyof Transformer, 'createTransformer'>]: Exclude<Transformer[K], undefined>;
|
|
11
11
|
};
|
|
12
12
|
export declare type BabelConfig = _babel.TransformOptions;
|
|
13
13
|
export interface TsJestGlobalOptions {
|
|
@@ -18,7 +18,7 @@ export interface TsJestGlobalOptions {
|
|
|
18
18
|
astTransformers?: string[];
|
|
19
19
|
diagnostics?: boolean | {
|
|
20
20
|
pretty?: boolean;
|
|
21
|
-
ignoreCodes?: number | string |
|
|
21
|
+
ignoreCodes?: number | string | (number | string)[];
|
|
22
22
|
pathRegex?: RegExp | string;
|
|
23
23
|
warnOnly?: boolean;
|
|
24
24
|
};
|
|
@@ -70,7 +70,7 @@ export interface TsJestConfig {
|
|
|
70
70
|
stringifyContentPathRegex: TsJestConfig$stringifyContentPathRegex;
|
|
71
71
|
}
|
|
72
72
|
export interface TsJestHooksMap {
|
|
73
|
-
afterProcess?(args: any[], result: string |
|
|
73
|
+
afterProcess?(args: any[], result: string | TransformedSource): string | TransformedSource | void;
|
|
74
74
|
}
|
|
75
75
|
export interface TSCommon {
|
|
76
76
|
version: typeof _ts.version;
|
|
@@ -7,9 +7,9 @@ var messages_1 = require("./messages");
|
|
|
7
7
|
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
|
|
8
8
|
var ExpectedVersions;
|
|
9
9
|
(function (ExpectedVersions) {
|
|
10
|
-
ExpectedVersions["Jest"] = ">=
|
|
10
|
+
ExpectedVersions["Jest"] = ">=25 <26";
|
|
11
11
|
ExpectedVersions["TypeScript"] = ">=2.7 <4";
|
|
12
|
-
ExpectedVersions["BabelJest"] = ">=
|
|
12
|
+
ExpectedVersions["BabelJest"] = ">=25 <26";
|
|
13
13
|
ExpectedVersions["BabelCore"] = ">=7.0.0-beta.0 <8";
|
|
14
14
|
})(ExpectedVersions = exports.ExpectedVersions || (exports.ExpectedVersions = {}));
|
|
15
15
|
exports.VersionCheckers = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-jest",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": "cli.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"test": "run-s -s test:e2e \"test:unit -- {@}\" --",
|
|
16
16
|
"test:prepare": "npm run test:e2e -- --prepareOnly",
|
|
17
17
|
"test:e2e": "node scripts/e2e.js",
|
|
18
|
+
"test:e2e:update-snaphots": "node scripts/e2e.js --updateSnapshot",
|
|
18
19
|
"test:unit": "node_modules/.bin/jest",
|
|
19
20
|
"test:external": "node scripts/test-external-project.js",
|
|
20
21
|
"lint": "run-s lint:ts lint:js",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"prepare": "npm run build",
|
|
34
35
|
"prepublishOnly": "npm run test",
|
|
35
36
|
"preversion": "npm run test",
|
|
37
|
+
"update:e2e": "node scripts/update-e2e-templates.js",
|
|
36
38
|
"version": "npm run changelog && git add CHANGELOG.md"
|
|
37
39
|
},
|
|
38
40
|
"repository": {
|
|
@@ -68,7 +70,7 @@
|
|
|
68
70
|
"yargs-parser": "10.x"
|
|
69
71
|
},
|
|
70
72
|
"peerDependencies": {
|
|
71
|
-
"jest": ">=
|
|
73
|
+
"jest": ">=25 <26"
|
|
72
74
|
},
|
|
73
75
|
"husky": {
|
|
74
76
|
"hooks": {
|
|
@@ -80,11 +82,13 @@
|
|
|
80
82
|
"devDependencies": {
|
|
81
83
|
"@commitlint/cli": "8.x",
|
|
82
84
|
"@commitlint/config-conventional": "7.x",
|
|
85
|
+
"@jest/transform": "25.x",
|
|
86
|
+
"@jest/types": "25.x",
|
|
83
87
|
"@types/babel__core": "7.x",
|
|
84
88
|
"@types/buffer-from": "latest",
|
|
85
89
|
"@types/cross-spawn": "latest",
|
|
86
90
|
"@types/fs-extra": "latest",
|
|
87
|
-
"@types/jest": "
|
|
91
|
+
"@types/jest": "25.x",
|
|
88
92
|
"@types/js-yaml": "latest",
|
|
89
93
|
"@types/json5": "latest",
|
|
90
94
|
"@types/lodash.memoize": "4.x",
|
|
@@ -101,7 +105,7 @@
|
|
|
101
105
|
"fs-extra": "latest",
|
|
102
106
|
"glob-gitignore": "latest",
|
|
103
107
|
"husky": "1.x",
|
|
104
|
-
"jest": "
|
|
108
|
+
"jest": "25.x",
|
|
105
109
|
"js-yaml": "latest",
|
|
106
110
|
"lint-staged": "latest",
|
|
107
111
|
"lodash.merge": "4.x",
|