ts-jest 24.2.0 → 25.2.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 +83 -31
- package/README.md +1 -1
- package/dist/config/config-set.d.ts +3 -4
- package/dist/config/config-set.js +8 -18
- package/dist/config/create-jest-preset.d.ts +3 -3
- package/dist/ts-jest-transformer.d.ts +5 -4
- 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
|
+
35ae96df88417ec4b77b95e0ac77f17d1e091ad1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,64 @@
|
|
|
1
|
+
<a name="25.2.0"></a>
|
|
2
|
+
# [25.2.0](https://github.com/kulshekhar/ts-jest/compare/v25.1.0...v25.2.0) (2020-02-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **config:** comment out unused codes ([dff1332](https://github.com/kulshekhar/ts-jest/commit/dff1332))
|
|
8
|
+
* **config:** pass plain config object to babel-jest transformer ([e0895da](https://github.com/kulshekhar/ts-jest/commit/e0895da))
|
|
9
|
+
* **config:** remove unused codes ([7aa3928](https://github.com/kulshekhar/ts-jest/commit/7aa3928))
|
|
10
|
+
* **config:** remove unused import ([81897e1](https://github.com/kulshekhar/ts-jest/commit/81897e1))
|
|
11
|
+
* **test:** improve unit tests for babel config ([ebd9380](https://github.com/kulshekhar/ts-jest/commit/ebd9380))
|
|
12
|
+
* **test:** update snapshot ([0e1190d](https://github.com/kulshekhar/ts-jest/commit/0e1190d))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<a name="25.1.0"></a>
|
|
17
|
+
# [25.1.0](https://github.com/kulshekhar/ts-jest/compare/v25.0.0...v25.1.0) (2020-01-30)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* jest 25 type definitions ([ba82a9e](https://github.com/kulshekhar/ts-jest/commit/ba82a9e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<a name="25.0.0"></a>
|
|
27
|
+
# [25.0.0](https://github.com/kulshekhar/ts-jest/compare/v24.3.0...v25.0.0) (2020-01-23)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* Fix tests for version checks v2 ([154f1d6](https://github.com/kulshekhar/ts-jest/commit/154f1d6))
|
|
33
|
+
* Try to fix snapshots ([ea0ea50](https://github.com/kulshekhar/ts-jest/commit/ea0ea50))
|
|
34
|
+
* Try to fix snapshots v2 ([82445bb](https://github.com/kulshekhar/ts-jest/commit/82445bb))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* support Jest 25 ([ffc2cfe](https://github.com/kulshekhar/ts-jest/commit/ffc2cfe))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<a name="24.3.0"></a>
|
|
44
|
+
# [24.3.0](https://github.com/kulshekhar/ts-jest/compare/v24.2.0...v24.3.0) (2020-01-07)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **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))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
1
53
|
<a name="24.2.0"></a>
|
|
2
54
|
# [24.2.0](https://github.com/kulshekhar/ts-jest/compare/v24.1.0...v24.2.0) (2019-11-22)
|
|
3
55
|
|
|
4
56
|
|
|
5
57
|
### Bug Fixes
|
|
6
58
|
|
|
59
|
+
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
|
|
7
60
|
* **compiler:** pass filename to sha function instead of file extension ([ac1ac97](https://github.com/kulshekhar/ts-jest/commit/ac1ac97))
|
|
8
61
|
* **transformers:** hoist jest.enableAutomock and jest.disableAutomock ([ac50bc3](https://github.com/kulshekhar/ts-jest/commit/ac50bc3))
|
|
9
|
-
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
|
|
10
62
|
|
|
11
63
|
|
|
12
64
|
|
|
@@ -16,9 +68,9 @@
|
|
|
16
68
|
|
|
17
69
|
### Bug Fixes
|
|
18
70
|
|
|
19
|
-
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
|
20
71
|
* [#825](https://github.com/kulshekhar/ts-jest/issues/825) handle symlinked modules (ala pnpm) correctly ([e190b23](https://github.com/kulshekhar/ts-jest/commit/e190b23))
|
|
21
72
|
* handle tsBuildInfoFile option ([f9583e9](https://github.com/kulshekhar/ts-jest/commit/f9583e9)), closes [#1095](https://github.com/kulshekhar/ts-jest/issues/1095)
|
|
73
|
+
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
|
|
22
74
|
* **types:** unforce esModuleInterop in tsconfig.json ([c2d39b6](https://github.com/kulshekhar/ts-jest/commit/c2d39b6))
|
|
23
75
|
|
|
24
76
|
|
|
@@ -230,56 +282,60 @@
|
|
|
230
282
|
|
|
231
283
|
### Bug Fixes
|
|
232
284
|
|
|
233
|
-
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
|
|
234
|
-
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
|
|
235
|
-
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
|
|
236
|
-
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
|
|
237
285
|
* babel-config + adds test ([12146c3](https://github.com/kulshekhar/ts-jest/commit/12146c3))
|
|
238
286
|
* fixes js style to be node < 10 compatible ([83d7517](https://github.com/kulshekhar/ts-jest/commit/83d7517))
|
|
239
287
|
* hoisting per level + memoize fix ([31847b0](https://github.com/kulshekhar/ts-jest/commit/31847b0))
|
|
240
288
|
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
|
|
289
|
+
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
|
|
241
290
|
* makes node6 happy ([f170285](https://github.com/kulshekhar/ts-jest/commit/f170285))
|
|
291
|
+
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
|
|
292
|
+
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
|
|
293
|
+
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
|
|
294
|
+
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
|
|
295
|
+
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
|
|
296
|
+
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
|
|
242
297
|
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
|
|
298
|
+
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
|
299
|
+
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
|
|
243
300
|
* normalizes bundle hash on any node version ([ce7afaf](https://github.com/kulshekhar/ts-jest/commit/ce7afaf))
|
|
301
|
+
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
|
|
244
302
|
* source maps ([89a30c9](https://github.com/kulshekhar/ts-jest/commit/89a30c9))
|
|
245
303
|
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
|
|
304
|
+
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
|
|
246
305
|
* updates templates ([f2e1da2](https://github.com/kulshekhar/ts-jest/commit/f2e1da2))
|
|
247
306
|
* uses cross-platform spawn + fix pkg versions ([ac1599c](https://github.com/kulshekhar/ts-jest/commit/ac1599c))
|
|
248
307
|
* we are not writing files, use normalized EOL ([47fff43](https://github.com/kulshekhar/ts-jest/commit/47fff43))
|
|
249
|
-
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
|
|
250
|
-
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
|
|
251
|
-
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
|
|
252
|
-
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
|
|
253
308
|
|
|
254
309
|
|
|
255
310
|
### Features
|
|
256
311
|
|
|
312
|
+
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
|
257
313
|
* **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)
|
|
258
314
|
* **logging:** improves log messages + tests ([5d03c4d](https://github.com/kulshekhar/ts-jest/commit/5d03c4d))
|
|
315
|
+
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
|
316
|
+
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
|
259
317
|
* adds logging + better hashing ([4322701](https://github.com/kulshekhar/ts-jest/commit/4322701))
|
|
318
|
+
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
|
260
319
|
* allow env var to add diagnostic codes to ignore ([777edf5](https://github.com/kulshekhar/ts-jest/commit/777edf5))
|
|
261
320
|
* cache key + tests ([bd55448](https://github.com/kulshekhar/ts-jest/commit/bd55448))
|
|
262
|
-
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
|
|
263
321
|
* directly writes to stdio so jest does not swallow ([6a7f01f](https://github.com/kulshekhar/ts-jest/commit/6a7f01f))
|
|
264
322
|
* handles stringifyContentPathRegex ([3fcb4bd](https://github.com/kulshekhar/ts-jest/commit/3fcb4bd))
|
|
265
323
|
* hoisting + tests + many other things ([6186e84](https://github.com/kulshekhar/ts-jest/commit/6186e84))
|
|
266
324
|
* io serializer + other test utils ([d03e0e7](https://github.com/kulshekhar/ts-jest/commit/d03e0e7))
|
|
267
|
-
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
|
|
268
325
|
* warn about unsupported versions ([1103071](https://github.com/kulshekhar/ts-jest/commit/1103071))
|
|
269
|
-
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
|
|
270
|
-
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
|
|
271
326
|
|
|
272
327
|
|
|
273
328
|
### Performance Improvements
|
|
274
329
|
|
|
275
|
-
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
|
|
276
|
-
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
|
277
|
-
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
|
278
330
|
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
|
|
331
|
+
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
|
|
279
332
|
* do not type check if fileName doesn't match ([cc45adc](https://github.com/kulshekhar/ts-jest/commit/cc45adc))
|
|
280
333
|
* faster tests ([37a0187](https://github.com/kulshekhar/ts-jest/commit/37a0187))
|
|
334
|
+
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
|
|
281
335
|
* more cleaning ([c48f7b8](https://github.com/kulshekhar/ts-jest/commit/c48f7b8))
|
|
282
336
|
* trying to improve travis-ci conf ([e4b4d95](https://github.com/kulshekhar/ts-jest/commit/e4b4d95))
|
|
337
|
+
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
|
|
338
|
+
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
|
|
283
339
|
|
|
284
340
|
|
|
285
341
|
|
|
@@ -289,30 +345,26 @@
|
|
|
289
345
|
|
|
290
346
|
### Bug Fixes
|
|
291
347
|
|
|
348
|
+
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
|
349
|
+
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
|
350
|
+
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
|
292
351
|
* allow (but deprecate) use of old preprocessor.js ([a65079f](https://github.com/kulshekhar/ts-jest/commit/a65079f))
|
|
293
352
|
* big refactor + fixes (mainly cache key + coverage) ([e46caae](https://github.com/kulshekhar/ts-jest/commit/e46caae))
|
|
294
353
|
* fixes coverage and tests ([09500c2](https://github.com/kulshekhar/ts-jest/commit/09500c2))
|
|
295
354
|
* gracefully load [@babel](https://github.com/babel)/core or babel-core ([98b2410](https://github.com/kulshekhar/ts-jest/commit/98b2410))
|
|
296
355
|
* 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)
|
|
297
|
-
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
|
|
298
|
-
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
|
|
299
|
-
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
|
|
300
|
-
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
|
|
301
|
-
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
|
|
302
|
-
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
|
|
303
|
-
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
|
|
304
|
-
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
|
|
305
|
-
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
|
|
306
356
|
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
|
|
307
357
|
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
|
|
308
|
-
*
|
|
358
|
+
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
|
|
359
|
+
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
|
|
309
360
|
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
|
|
361
|
+
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
|
|
362
|
+
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
|
|
310
363
|
|
|
311
364
|
|
|
312
365
|
### Performance Improvements
|
|
313
366
|
|
|
314
367
|
* do not hash cache key, jest does it underneath ([fbe4f1f](https://github.com/kulshekhar/ts-jest/commit/fbe4f1f))
|
|
315
|
-
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
|
|
316
368
|
|
|
317
369
|
|
|
318
370
|
|
|
@@ -328,9 +380,9 @@
|
|
|
328
380
|
### Bug Fixes
|
|
329
381
|
|
|
330
382
|
* **package:** update source-map-support to version 0.5.0 ([f0aab12](https://github.com/kulshekhar/ts-jest/commit/f0aab12))
|
|
383
|
+
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
|
331
384
|
* **package:** update yargs to version 10.0.3 ([5cdf969](https://github.com/kulshekhar/ts-jest/commit/5cdf969))
|
|
332
385
|
* **package:** update yargs to version 11.0.0 ([7e9ce40](https://github.com/kulshekhar/ts-jest/commit/7e9ce40))
|
|
333
|
-
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
|
|
334
386
|
* **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))
|
|
335
387
|
|
|
336
388
|
|
|
@@ -386,10 +438,10 @@
|
|
|
386
438
|
|
|
387
439
|
### Bug Fixes
|
|
388
440
|
|
|
389
|
-
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
|
|
390
|
-
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
|
|
391
441
|
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
|
|
392
442
|
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
|
|
443
|
+
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
|
|
444
|
+
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
|
|
393
445
|
|
|
394
446
|
|
|
395
447
|
### 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)
|
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
@@ -6,12 +6,11 @@ export declare class ConfigSet {
|
|
|
6
6
|
readonly parentOptions?: TsJestGlobalOptions | undefined;
|
|
7
7
|
get projectPackageJson(): Record<string, any>;
|
|
8
8
|
get projectDependencies(): Record<string, string>;
|
|
9
|
-
get jest():
|
|
9
|
+
get jest(): Config.ProjectConfig;
|
|
10
10
|
get tsJest(): TsJestConfig;
|
|
11
11
|
get typescript(): ParsedCommandLine;
|
|
12
12
|
get tsconfig(): any;
|
|
13
13
|
get versions(): Record<string, string>;
|
|
14
|
-
private static loadConfig;
|
|
15
14
|
get babel(): BabelConfig | undefined;
|
|
16
15
|
get compilerModule(): TTypeScript;
|
|
17
16
|
get babelJestTransformer(): BabelJestTransformer | undefined;
|
|
@@ -28,7 +27,7 @@ export declare class ConfigSet {
|
|
|
28
27
|
get tsJestDigest(): string;
|
|
29
28
|
get cacheKey(): string;
|
|
30
29
|
readonly logger: Logger;
|
|
31
|
-
constructor(jestConfig:
|
|
30
|
+
constructor(jestConfig: Config.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
|
|
32
31
|
resolvePath(inputPath: string, { throwIfMissing, nodeResolve }?: {
|
|
33
32
|
throwIfMissing?: boolean;
|
|
34
33
|
nodeResolve?: boolean;
|
|
@@ -52,7 +52,6 @@ var bs_logger_1 = require("bs-logger");
|
|
|
52
52
|
var fs_1 = require("fs");
|
|
53
53
|
var json5 = require("json5");
|
|
54
54
|
var path_1 = require("path");
|
|
55
|
-
var semver = require("semver");
|
|
56
55
|
var __1 = require("..");
|
|
57
56
|
var compiler_1 = require("../compiler");
|
|
58
57
|
var transformers_1 = require("../transformers");
|
|
@@ -338,19 +337,6 @@ var ConfigSet = (function () {
|
|
|
338
337
|
enumerable: true,
|
|
339
338
|
configurable: true
|
|
340
339
|
});
|
|
341
|
-
ConfigSet.loadConfig = function (base) {
|
|
342
|
-
var _a = importer_1.importer.babelCore(messages_1.ImportReasons.BabelJest), OptionManager = _a.OptionManager, loadPartialConfig = _a.loadPartialConfig, version = _a.version;
|
|
343
|
-
if (version && semver.satisfies(version, '>=6 <7')) {
|
|
344
|
-
delete base.cwd;
|
|
345
|
-
}
|
|
346
|
-
if (typeof loadPartialConfig === 'function') {
|
|
347
|
-
var partialConfig = loadPartialConfig(base);
|
|
348
|
-
if (partialConfig) {
|
|
349
|
-
return partialConfig.options;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return new OptionManager().init(base);
|
|
353
|
-
};
|
|
354
340
|
Object.defineProperty(ConfigSet.prototype, "babel", {
|
|
355
341
|
get: function () {
|
|
356
342
|
var babelConfig = this.tsJest.babelConfig;
|
|
@@ -361,15 +347,19 @@ var ConfigSet = (function () {
|
|
|
361
347
|
var base = { cwd: this.cwd };
|
|
362
348
|
if (babelConfig.kind === 'file') {
|
|
363
349
|
if (babelConfig.value) {
|
|
364
|
-
|
|
350
|
+
if (path_1.extname(babelConfig.value) === '.js') {
|
|
351
|
+
base = __assign(__assign({}, base), require(babelConfig.value));
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
base = __assign(__assign({}, base), json5.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
|
|
355
|
+
}
|
|
365
356
|
}
|
|
366
357
|
}
|
|
367
358
|
else if (babelConfig.kind === 'inline') {
|
|
368
359
|
base = __assign(__assign({}, base), babelConfig.value);
|
|
369
360
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return config;
|
|
361
|
+
this.logger.debug({ babelConfig: base }, 'normalized babel config via ts-jest option');
|
|
362
|
+
return base;
|
|
373
363
|
},
|
|
374
364
|
enumerable: true,
|
|
375
365
|
configurable: true
|
|
@@ -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;
|
|
@@ -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
|
+
export declare class TsJestTransformer implements Transformer {
|
|
6
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.2.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",
|