Add node modules and new code for release (#39)

Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2022-01-05 11:26:06 -05:00 committed by GitHub
parent a10d84bc2e
commit 7ad2aa66bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7655 changed files with 1763577 additions and 14 deletions

1
node_modules/ts-jest/.ts-jest-digest generated vendored Normal file
View file

@ -0,0 +1 @@
d9672057404fee19f80db714ea000c61a1375776

713
node_modules/ts-jest/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,713 @@
<a name="25.5.1"></a>
## [25.5.1](https://github.com/kulshekhar/ts-jest/compare/v25.5.0...v25.5.1) (2020-05-09)
### Bug Fixes
* **compiler:** don't resolve files from build folder for `projectReferences` ([#1614](https://github.com/kulshekhar/ts-jest/issues/1614)) ([74b92d3](https://github.com/kulshekhar/ts-jest/commit/74b92d3))
* **config:** don't set `include` value of `tsconfig` to empty array ([#1606](https://github.com/kulshekhar/ts-jest/issues/1606)) ([8a29aaa](https://github.com/kulshekhar/ts-jest/commit/8a29aaa))
<a name="25.5.0"></a>
# [25.5.0](https://github.com/kulshekhar/ts-jest/compare/v25.4.0...v25.5.0) (2020-05-05)
### Bug Fixes
* **compiler:** make `projectReferences` work with `isolatedModules: false` ([#1541](https://github.com/kulshekhar/ts-jest/issues/1541)) ([3e8efbe](https://github.com/kulshekhar/ts-jest/commit/3e8efbe))
* **compiler:** allow using `files` provided by `tsconfig` ([#1562](https://github.com/kulshekhar/ts-jest/issues/1562)) ([a9f02bd](https://github.com/kulshekhar/ts-jest/commit/a9f02bd))
* **config:** verify `testMatchPatterns` contain RegExp instance or string type values ([#1569](https://github.com/kulshekhar/ts-jest/issues/1569)) ([7f85bab](https://github.com/kulshekhar/ts-jest/commit/7f85bab))
### Features
* **config:** add `tsconfig` alias to `tsConfig` option ([#1565](https://github.com/kulshekhar/ts-jest/issues/1565)) ([c10eb6d](https://github.com/kulshekhar/ts-jest/commit/c10eb6d))
* **config:** define 'ts-jest' on `ConfigGlobals` interface of `@jest/types` ([#1592](https://github.com/kulshekhar/ts-jest/issues/1592)) ([4526392](https://github.com/kulshekhar/ts-jest/commit/4526392))
### Performance Improvements
* **compiler:** dont write compile output to file system but rely on jest cache ([#1561](https://github.com/kulshekhar/ts-jest/issues/1561)) ([d11a4ea](https://github.com/kulshekhar/ts-jest/commit/d11a4ea))
* **compiler:** improve performance for `isolatedModules: false` ([#1558](https://github.com/kulshekhar/ts-jest/issues/1558)) ([85c09e3](https://github.com/kulshekhar/ts-jest/commit/85c09e3))
### BREAKING CHANGES
* Any custom typing files or files which are needed to be compiled and intended to use with `jest` need to be defined in `files` option of `tsconfig`.
For example:
```
// tsconfig.json
{
// ...other configs
"files": [
"my-custom-typings.d.ts",
"my-global-module.ts"
]
}
```
* **compiler:** `incremental` and `compilerHost` options are no longer available. Please remove it from your `ts-jest` config.
<a name="25.5.0-beta.0"></a>
# [25.5.0-beta.0](https://github.com/kulshekhar/ts-jest/compare/v25.5.0-alpha.0...v25.5.0-beta.0) (2020-04-29)
### Bug Fixes
* **compiler:** allow using `files` provided by `tsconfig` ([#1562](https://github.com/kulshekhar/ts-jest/issues/1562)) ([907a280](https://github.com/kulshekhar/ts-jest/commit/907a280))
* **config:** verify `testMatchPatterns` contain `RegExp` instance or `string` type values ([#1569](https://github.com/kulshekhar/ts-jest/issues/1569)) ([7f85bab](https://github.com/kulshekhar/ts-jest/commit/7f85bab))
### Features
* **config:** add `tsconfig` alias to `tsConfig` option ([#1565](https://github.com/kulshekhar/ts-jest/issues/1565)) ([c10eb6d](https://github.com/kulshekhar/ts-jest/commit/c10eb6d))
### Performance Improvements
* **compiler:** dont write compile output to file system but rely on `jest` cache ([#1561](https://github.com/kulshekhar/ts-jest/issues/1561)) ([07b5f62](https://github.com/kulshekhar/ts-jest/commit/07b5f62))
### BREAKING CHANGES
* Any custom typing files or files which are needed to be compiled and intended to use with `jest` need to be defined in `files` option of `tsconfig`.
For example
```
// tsconfig.json
{
// ...other configs
"files": [
"my-custom-typings.d.ts".
"my-global-module.ts"
]
}
```
<a name="25.5.0-alpha.0"></a>
# [25.5.0-alpha.0](https://github.com/kulshekhar/ts-jest/compare/v25.4.0...v25.5.0-alpha.0) (2020-04-22)
### Bug Fixes
* **compiler:** make `projectReferences` work with `isolatedModules: false` ([#1541](https://github.com/kulshekhar/ts-jest/issues/1541)) ([3e8efbe](https://github.com/kulshekhar/ts-jest/commit/3e8efbe))
### Performance
* **compiler:** improve performance for `isolatedModules: false` ([#1558](https://github.com/kulshekhar/ts-jest/issues/1558)) ([85c09e3](https://github.com/kulshekhar/ts-jest/commit/85c09e3))
### BREAKING CHANGES
* **config:** `compilerHost` and `incremental` options are no longer available
<a name="25.4.0"></a>
# [25.4.0](https://github.com/kulshekhar/ts-jest/compare/v25.3.1...v25.4.0) (2020-04-17)
### Bug Fixes
* **compiler:** make `projectReferences` work with `isolatedModules: true` ([#1527](https://github.com/kulshekhar/ts-jest/issues/1527)) ([aa6b74c](https://github.com/kulshekhar/ts-jest/commit/aa6b74c))
* **compiler:** make sure `LanguageService` updated with test file information before getting diagnostics for test file ([#1507](https://github.com/kulshekhar/ts-jest/issues/1507)) ([311eaeb](https://github.com/kulshekhar/ts-jest/commit/311eaeb))
* **config:** set default `outDir` when `allowJs` is true and no `outDir` in `tsconfig` ([#1502](https://github.com/kulshekhar/ts-jest/issues/1502)) ([1a287ad](https://github.com/kulshekhar/ts-jest/commit/1a287ad))
* **config:** use original jest config object instead of stringified config ([#1511](https://github.com/kulshekhar/ts-jest/issues/1511)) ([4f0bb33](https://github.com/kulshekhar/ts-jest/commit/4f0bb33))
<a name="25.3.1"></a>
## [25.3.1](https://github.com/kulshekhar/ts-jest/compare/v25.3.0...v25.3.1) (2020-04-03)
### Bug Fixes
* only do type checking while compiling file ([#1483](https://github.com/kulshekhar/ts-jest/issues/1483)) ([dbc0a08](https://github.com/kulshekhar/ts-jest/commit/dbc0a08))
* **config:** set default outDir for enabled allowJs without outDir ([#1472](https://github.com/kulshekhar/ts-jest/issues/1472)) ([57c7af0](https://github.com/kulshekhar/ts-jest/commit/57c7af0))
<a name="25.3.0"></a>
# [25.3.0](https://github.com/kulshekhar/ts-jest/compare/25.2.1...v25.3.0) (2020-03-30)
### Bug Fixes
* add `jest-config` to dependencies list ([6d9e0d8](https://github.com/kulshekhar/ts-jest/commit/6d9e0d8))
* always do type check for all files provided to ts-jest transformer for non-watch mode ([#1450](https://github.com/kulshekhar/ts-jest/issues/1450)) ([107e062](https://github.com/kulshekhar/ts-jest/commit/107e062))
### Chores
* **docs:** add `TROUBLESHOOTING` ([96cd9b3](https://github.com/kulshekhar/ts-jest/commit/b8ebf36))
### Features
* **compiler:** expose internal ts `Program` via ConfigSet `TsCompiler` ([#1433](https://github.com/kulshekhar/ts-jest/issues/1433)) ([7153246](https://github.com/kulshekhar/ts-jest/commit/7153246))
* **config:** add incremental option ([#1418](https://github.com/kulshekhar/ts-jest/issues/1418)) ([5a69bce](https://github.com/kulshekhar/ts-jest/commit/5a69bce))
### BREAKING CHANGES
* **config:** improve diagnostics message ([#1444](https://github.com/kulshekhar/ts-jest/issues/1444)) ([96cd9b3](https://github.com/kulshekhar/ts-jest/commit/96cd9b3)). This will affect to any snapshots or assertion against diagnostics messages
<a name="25.2.1"></a>
# [25.2.1](https://github.com/kulshekhar/ts-jest/compare/25.2.0...25.2.1) (2020-02-21)
### Bug Fixes
* **compiler:** allow transformation of typescript files in node_modules ([#1385](https://github.com/kulshekhar/ts-jest/issues/1385)) ([814405e](https://github.com/kulshekhar/ts-jest/commit/814405e))
* **docs:** fixing slack link and some minor typos in documenation ([#1404](https://github.com/kulshekhar/ts-jest/issues/1404)) ([3e2e008](https://github.com/kulshekhar/ts-jest/commit/3e2e008))
* **transformer:** add deepUnmock to hoist method list ([#1372](https://github.com/kulshekhar/ts-jest/issues/1372)) ([0fbbc00](https://github.com/kulshekhar/ts-jest/commit/0fbbc00))
* **util:** use resolve package typescript package in yarn workspaces ([#1377](https://github.com/kulshekhar/ts-jest/issues/1377)) ([a63808c](https://github.com/kulshekhar/ts-jest/commit/a63808c))
<a name="25.2.0"></a>
# [25.2.0](https://github.com/kulshekhar/ts-jest/compare/v25.1.0...v25.2.0) (2020-02-03)
### Bug Fixes
* **config:** let babel-jest handle loading babel config ([#1370](https://github.com/kulshekhar/ts-jest/issues/1370))
<a name="25.1.0"></a>
# [25.1.0](https://github.com/kulshekhar/ts-jest/compare/v25.0.0...v25.1.0) (2020-01-30)
### Bug Fixes
* jest 25 type definitions ([#1363](https://github.com/kulshekhar/ts-jest/issues/1363)) ([ba82a9e](https://github.com/kulshekhar/ts-jest/commit/ba82a9e))
<a name="25.0.0"></a>
# [25.0.0](https://github.com/kulshekhar/ts-jest/compare/v24.3.0...v25.0.0) (2020-01-23)
### Features
* support Jest 25 ([#1355](https://github.com/kulshekhar/ts-jest/issues/1355))
<a name="24.3.0"></a>
# [24.3.0](https://github.com/kulshekhar/ts-jest/compare/v24.2.0...v24.3.0) (2020-01-07)
### Bug Fixes
* **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))
<a name="24.2.0"></a>
# [24.2.0](https://github.com/kulshekhar/ts-jest/compare/v24.1.0...v24.2.0) (2019-11-22)
### Bug Fixes
* **compiler:** pass filename to sha function instead of file extension ([ac1ac97](https://github.com/kulshekhar/ts-jest/commit/ac1ac97))
* **transformers:** hoist jest.enableAutomock and jest.disableAutomock ([ac50bc3](https://github.com/kulshekhar/ts-jest/commit/ac50bc3))
* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
<a name="24.1.0"></a>
# [24.1.0](https://github.com/kulshekhar/ts-jest/compare/v24.0.2...v24.1.0) (2019-09-12)
### Bug Fixes
* **perf:** add cache for fs calls ([#908](https://github.com/kulshekhar/ts-jest/issues/908)) ([3dada81](https://github.com/kulshekhar/ts-jest/commit/3dada81))
* [#825](https://github.com/kulshekhar/ts-jest/issues/825) handle symlinked modules (ala pnpm) correctly ([e190b23](https://github.com/kulshekhar/ts-jest/commit/e190b23))
* handle tsBuildInfoFile option ([f9583e9](https://github.com/kulshekhar/ts-jest/commit/f9583e9)), closes [#1095](https://github.com/kulshekhar/ts-jest/issues/1095)
* **types:** unforce esModuleInterop in tsconfig.json ([c2d39b6](https://github.com/kulshekhar/ts-jest/commit/c2d39b6))
<a name="24.0.2"></a>
## [24.0.2](https://github.com/kulshekhar/ts-jest/compare/v24.0.1...v24.0.2) (2019-04-05)
<a name="24.0.1"></a>
## [24.0.1](https://github.com/kulshekhar/ts-jest/compare/v24.0.0...v24.0.1) (2019-03-30)
### Bug Fixes
* update call to globIgnore ([#1002](https://github.com/kulshekhar/ts-jest/issues/1002)) ([#1003](https://github.com/kulshekhar/ts-jest/issues/1003)) ([05b63af](https://github.com/kulshekhar/ts-jest/commit/05b63af))
### Features
* **config:** specify package.json location ([#823](https://github.com/kulshekhar/ts-jest/issues/823)) ([#1013](https://github.com/kulshekhar/ts-jest/issues/1013)) ([fb7dd55](https://github.com/kulshekhar/ts-jest/commit/fb7dd55))
<a name="24.0.0"></a>
# [24.0.0](https://github.com/kulshekhar/ts-jest/compare/v23.10.5...v24.0.0) (2019-02-18)
### Bug Fixes
* cli test ([1d67101](https://github.com/kulshekhar/ts-jest/commit/1d67101))
* module tests and some snapshots ([999f889](https://github.com/kulshekhar/ts-jest/commit/999f889))
* remove unused snapshots ([108b08b](https://github.com/kulshekhar/ts-jest/commit/108b08b))
* some tests ([d0f2231](https://github.com/kulshekhar/ts-jest/commit/d0f2231))
* test command ([8372b5e](https://github.com/kulshekhar/ts-jest/commit/8372b5e))
* test path for windows (attempt 1) ([6824ac4](https://github.com/kulshekhar/ts-jest/commit/6824ac4))
* test path for windows (attempt 2) ([eb2fc8a](https://github.com/kulshekhar/ts-jest/commit/eb2fc8a))
### Features
* **jest:** bump to 24 ([defcb77](https://github.com/kulshekhar/ts-jest/commit/defcb77))
<a name="23.10.4"></a>
## [23.10.4](https://github.com/kulshekhar/ts-jest/compare/v23.10.3...v23.10.4) (2018-10-06)
### Bug Fixes
* **cache:** adds project's dep versions to cache key ([6cacbea](https://github.com/kulshekhar/ts-jest/commit/6cacbea)), closes [#785](https://github.com/kulshekhar/ts-jest/issues/785)
* **cli:** change options to better reflect the new presets ([68abcfb](https://github.com/kulshekhar/ts-jest/commit/68abcfb))
* **helpers:** deprecate import from ts-jest, now ts-jest/utils ([33ff29f](https://github.com/kulshekhar/ts-jest/commit/33ff29f)), closes [#782](https://github.com/kulshekhar/ts-jest/issues/782)
* **typings:** typo in presets definition file ([53767ab](https://github.com/kulshekhar/ts-jest/commit/53767ab))
* **typings:** wrong import in preset typings + test ([94dc4e7](https://github.com/kulshekhar/ts-jest/commit/94dc4e7))
<a name="23.10.3"></a>
## [23.10.3](https://github.com/kulshekhar/ts-jest/compare/v23.10.2...v23.10.3) (2018-09-30)
### Bug Fixes
* **compiler:** do not force module kind if piping babel ([acebc8c](https://github.com/kulshekhar/ts-jest/commit/acebc8c)), closes [#767](https://github.com/kulshekhar/ts-jest/issues/767)
### Features
* **helpers:** adds a mocked test helper for mock typings ([f976135](https://github.com/kulshekhar/ts-jest/commit/f976135)), closes [#576](https://github.com/kulshekhar/ts-jest/issues/576)
<a name="23.10.2"></a>
## [23.10.2](https://github.com/kulshekhar/ts-jest/compare/v23.10.1...v23.10.2) (2018-09-26)
### Bug Fixes
* **cache:** resolved tsconfig in cache key + pkg digest ([e891608](https://github.com/kulshekhar/ts-jest/commit/e891608)), closes [#749](https://github.com/kulshekhar/ts-jest/issues/749)
* **cli:** resets testMatch if using testRegex option ([31ad0aa](https://github.com/kulshekhar/ts-jest/commit/31ad0aa)), closes [#756](https://github.com/kulshekhar/ts-jest/issues/756)
* **diagnostics:** throws only for category warning and error ([bb28849](https://github.com/kulshekhar/ts-jest/commit/bb28849)), closes [#748](https://github.com/kulshekhar/ts-jest/issues/748)
* **import:** wrong error message when a module exists but fails ([e0d6c57](https://github.com/kulshekhar/ts-jest/commit/e0d6c57))
* **preset:** createJestPreset fails with base and no array ([3c325e8](https://github.com/kulshekhar/ts-jest/commit/3c325e8))
### Features
* **cli:** CLI 'config:migrate' now detects best preset ([febd8d3](https://github.com/kulshekhar/ts-jest/commit/febd8d3))
* **preset:** adds 2 presets along the default one ([9f3d759](https://github.com/kulshekhar/ts-jest/commit/9f3d759))
* **preset:** adds presets typings and export all presets ([f55d895](https://github.com/kulshekhar/ts-jest/commit/f55d895))
* **typings:** emit declaration files, filtering out internals ([4f10f7e](https://github.com/kulshekhar/ts-jest/commit/4f10f7e)), closes [#745](https://github.com/kulshekhar/ts-jest/issues/745)
<a name="23.10.1"></a>
## [23.10.1](https://github.com/kulshekhar/ts-jest/compare/v23.10.0...v23.10.1) (2018-09-20)
### Bug Fixes
* **compile:** js files were never transpiled thru TS ([374dca1](https://github.com/kulshekhar/ts-jest/commit/374dca1)), closes [#740](https://github.com/kulshekhar/ts-jest/issues/740)
* **config:** warn instead of forcing ESM interoperability ([a2a4be2](https://github.com/kulshekhar/ts-jest/commit/a2a4be2))
* **windows:** normalize paths ([c12dfff](https://github.com/kulshekhar/ts-jest/commit/c12dfff))
<a name="23.10.0"></a>
# [23.10.0](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.6...v23.10.0) (2018-09-19)
### Bug Fixes
* **babel:** fixes the babel 6 hack ([c8d51cf](https://github.com/kulshekhar/ts-jest/commit/c8d51cf))
* **config:** jsx should also be considered as js files ([6c32a93](https://github.com/kulshekhar/ts-jest/commit/6c32a93))
### Features
* **hints:** warns if transform matches js without allowJs ([952cc87](https://github.com/kulshekhar/ts-jest/commit/952cc87))
<a name="23.10.0-beta.6"></a>
# [23.10.0-beta.6](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.5...v23.10.0-beta.6) (2018-09-13)
### Bug Fixes
* **babel:** instrumentation was done twice when using babel ([659a7fb](https://github.com/kulshekhar/ts-jest/commit/659a7fb)), closes [#713](https://github.com/kulshekhar/ts-jest/issues/713)
* **cache:** includes all parameters in cache key computing ([70e1867](https://github.com/kulshekhar/ts-jest/commit/70e1867))
* **e2e:** fixes the eval tool (not used yet) ([939d13a](https://github.com/kulshekhar/ts-jest/commit/939d13a))
<a name="23.10.0-beta.5"></a>
# [23.10.0-beta.5](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.4...v23.10.0-beta.5) (2018-09-12)
### Bug Fixes
* **package:** fixes the outdated package-lock ([c5a5b7a](https://github.com/kulshekhar/ts-jest/commit/c5a5b7a))
### Features
* **diagnostics:** add option to enable/disable first-TS-error-throws ([2c840c2](https://github.com/kulshekhar/ts-jest/commit/2c840c2))
<a name="23.10.0-beta.4"></a>
# [23.10.0-beta.4](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.3...v23.10.0-beta.4) (2018-09-06)
### Bug Fixes
* **config:** fixes a bug in the tsconfig file resolver ([3910f2c](https://github.com/kulshekhar/ts-jest/commit/3910f2c))
<a name="23.10.0-beta.3"></a>
# [23.10.0-beta.3](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.2...v23.10.0-beta.3) (2018-09-06)
### Bug Fixes
* **config:** fixes a bug in path resolver ([ceb0424](https://github.com/kulshekhar/ts-jest/commit/ceb0424))
### Features
* **cli:** adds a cli tool to migrate old config ([714f5f0](https://github.com/kulshekhar/ts-jest/commit/714f5f0))
* **cli:** ads a simple config:init helper + tests ([6700522](https://github.com/kulshekhar/ts-jest/commit/6700522))
* **config:** exposes custom transformers to config for presets ([885bc44](https://github.com/kulshekhar/ts-jest/commit/885bc44))
* **logger:** adds ts-jest version in the logger's context ([bb0c06e](https://github.com/kulshekhar/ts-jest/commit/bb0c06e))
### Performance Improvements
* **bundle:** improves bundle size ([34eedc3](https://github.com/kulshekhar/ts-jest/commit/34eedc3))
<a name="23.10.0-beta.2"></a>
# [23.10.0-beta.2](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.1...v23.10.0-beta.2) (2018-09-02)
### Bug Fixes
* **caching:** fixes a possible cache collision ([9c38694](https://github.com/kulshekhar/ts-jest/commit/9c38694))
* **testing:** change logging level for some utility ([16f125a](https://github.com/kulshekhar/ts-jest/commit/16f125a))
### Features
* **config:** typeCheck default to true (langauge service) ([623b2f4](https://github.com/kulshekhar/ts-jest/commit/623b2f4))
### BREAKING CHANGES
* **config:** Language service will be used by default from now on
<a name="23.10.0-beta.1"></a>
# [23.10.0-beta.1](https://github.com/kulshekhar/ts-jest/compare/v23.1.4...v23.10.0-beta.1) (2018-09-01)
### Bug Fixes
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
* babel-config + adds test ([12146c3](https://github.com/kulshekhar/ts-jest/commit/12146c3))
* fixes js style to be node < 10 compatible ([83d7517](https://github.com/kulshekhar/ts-jest/commit/83d7517))
* hoisting per level + memoize fix ([31847b0](https://github.com/kulshekhar/ts-jest/commit/31847b0))
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
* makes node6 happy ([f170285](https://github.com/kulshekhar/ts-jest/commit/f170285))
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
* normalizes bundle hash on any node version ([ce7afaf](https://github.com/kulshekhar/ts-jest/commit/ce7afaf))
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
* source maps ([89a30c9](https://github.com/kulshekhar/ts-jest/commit/89a30c9))
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
* updates templates ([f2e1da2](https://github.com/kulshekhar/ts-jest/commit/f2e1da2))
* uses cross-platform spawn + fix pkg versions ([ac1599c](https://github.com/kulshekhar/ts-jest/commit/ac1599c))
* we are not writing files, use normalized EOL ([47fff43](https://github.com/kulshekhar/ts-jest/commit/47fff43))
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
### Features
* **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)
* **logging:** improves log messages + tests ([5d03c4d](https://github.com/kulshekhar/ts-jest/commit/5d03c4d))
* adds logging + better hashing ([4322701](https://github.com/kulshekhar/ts-jest/commit/4322701))
* allow env var to add diagnostic codes to ignore ([777edf5](https://github.com/kulshekhar/ts-jest/commit/777edf5))
* cache key + tests ([bd55448](https://github.com/kulshekhar/ts-jest/commit/bd55448))
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
* directly writes to stdio so jest does not swallow ([6a7f01f](https://github.com/kulshekhar/ts-jest/commit/6a7f01f))
* handles stringifyContentPathRegex ([3fcb4bd](https://github.com/kulshekhar/ts-jest/commit/3fcb4bd))
* hoisting + tests + many other things ([6186e84](https://github.com/kulshekhar/ts-jest/commit/6186e84))
* io serializer + other test utils ([d03e0e7](https://github.com/kulshekhar/ts-jest/commit/d03e0e7))
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
* warn about unsupported versions ([1103071](https://github.com/kulshekhar/ts-jest/commit/1103071))
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
### Performance Improvements
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
* do not type check if fileName doesn't match ([cc45adc](https://github.com/kulshekhar/ts-jest/commit/cc45adc))
* faster tests ([37a0187](https://github.com/kulshekhar/ts-jest/commit/37a0187))
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
* more cleaning ([c48f7b8](https://github.com/kulshekhar/ts-jest/commit/c48f7b8))
* trying to improve travis-ci conf ([e4b4d95](https://github.com/kulshekhar/ts-jest/commit/e4b4d95))
<a name="23.1.3"></a>
## [23.1.3](https://github.com/kulshekhar/ts-jest/compare/v23.1.2...v23.1.3) (2018-08-06)
### Bug Fixes
* allow (but deprecate) use of old preprocessor.js ([a65079f](https://github.com/kulshekhar/ts-jest/commit/a65079f))
* big refactor + fixes (mainly cache key + coverage) ([e46caae](https://github.com/kulshekhar/ts-jest/commit/e46caae))
* fixes coverage and tests ([09500c2](https://github.com/kulshekhar/ts-jest/commit/09500c2))
* gracefully load [@babel](https://github.com/babel)/core or babel-core ([98b2410](https://github.com/kulshekhar/ts-jest/commit/98b2410))
* 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)
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
### Performance Improvements
* do not hash cache key, jest does it underneath ([fbe4f1f](https://github.com/kulshekhar/ts-jest/commit/fbe4f1f))
<a name="22.4.5"></a>
## [22.4.5](https://github.com/kulshekhar/ts-jest/compare/v22.4.4...v22.4.5) (2018-05-05)
<a name="22.4.1"></a>
## [22.4.1](https://github.com/kulshekhar/ts-jest/compare/v22.4.0...v22.4.1) (2018-03-02)
### Bug Fixes
* **package:** update source-map-support to version 0.5.0 ([f0aab12](https://github.com/kulshekhar/ts-jest/commit/f0aab12))
* **package:** update yargs to version 10.0.3 ([5cdf969](https://github.com/kulshekhar/ts-jest/commit/5cdf969))
* **package:** update yargs to version 11.0.0 ([7e9ce40](https://github.com/kulshekhar/ts-jest/commit/7e9ce40))
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
* **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))
### Features
* add option to run TypeScript diagnostics ([13b77d9](https://github.com/kulshekhar/ts-jest/commit/13b77d9))
<a name="21.0.1"></a>
## [21.0.1](https://github.com/kulshekhar/ts-jest/compare/v21.0.0...v21.0.1) (2017-09-14)
<a name="21.0.0"></a>
# [21.0.0](https://github.com/kulshekhar/ts-jest/compare/v20.0.14...v21.0.0) (2017-09-05)
<a name="20.0.14"></a>
## [20.0.14](https://github.com/kulshekhar/ts-jest/compare/v20.0.13...v20.0.14) (2017-09-01)
<a name="20.0.13"></a>
## [20.0.13](https://github.com/kulshekhar/ts-jest/compare/v20.0.12...v20.0.13) (2017-08-30)
<a name="20.0.12"></a>
## [20.0.12](https://github.com/kulshekhar/ts-jest/compare/v20.0.11...v20.0.12) (2017-08-30)
<a name="20.0.11"></a>
## [20.0.11](https://github.com/kulshekhar/ts-jest/compare/v20.0.9...v20.0.11) (2017-08-29)
<a name="20.0.9"></a>
## [20.0.9](https://github.com/kulshekhar/ts-jest/compare/20.0.9...v20.0.9) (2017-08-04)
### Bug Fixes
* **package:** update fs-extra to version 4.0.0 ([5be18fb](https://github.com/kulshekhar/ts-jest/commit/5be18fb))
<a name="20.0.7"></a>
## [20.0.7](https://github.com/kulshekhar/ts-jest/compare/17.0.3...20.0.7) (2017-07-07)
### Bug Fixes
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
### Features
* export transpileIfTypescript ([6f835af](https://github.com/kulshekhar/ts-jest/commit/6f835af))
<a name="17.0.3"></a>
## [17.0.3](https://github.com/kulshekhar/ts-jest/compare/17.0.2...17.0.3) (2016-12-01)
<a name="17.0.2"></a>
## [17.0.2](https://github.com/kulshekhar/ts-jest/compare/17.0.1...17.0.2) (2016-12-01)
<a name="17.0.1"></a>
## [17.0.1](https://github.com/kulshekhar/ts-jest/compare/17.0.0...17.0.1) (2016-11-30)
<a name="17.0.0"></a>
# [17.0.0](https://github.com/kulshekhar/ts-jest/compare/0.1.13...17.0.0) (2016-11-09)
<a name="0.1.13"></a>
## [0.1.13](https://github.com/kulshekhar/ts-jest/compare/0.1.12...0.1.13) (2016-11-07)
<a name="0.1.12"></a>
## [0.1.12](https://github.com/kulshekhar/ts-jest/compare/0.1.11...0.1.12) (2016-11-03)
<a name="0.1.11"></a>
## [0.1.11](https://github.com/kulshekhar/ts-jest/compare/0.1.10...0.1.11) (2016-10-27)
<a name="0.1.10"></a>
## [0.1.10](https://github.com/kulshekhar/ts-jest/compare/0.1.9...0.1.10) (2016-10-26)
<a name="0.1.9"></a>
## [0.1.9](https://github.com/kulshekhar/ts-jest/compare/0.1.8...0.1.9) (2016-10-24)
<a name="0.1.8"></a>
## [0.1.8](https://github.com/kulshekhar/ts-jest/compare/0.1.7...0.1.8) (2016-10-14)
<a name="0.1.7"></a>
## [0.1.7](https://github.com/kulshekhar/ts-jest/compare/0.1.6...0.1.7) (2016-10-10)
<a name="0.1.6"></a>
## [0.1.6](https://github.com/kulshekhar/ts-jest/compare/0.1.5...0.1.6) (2016-10-08)
<a name="0.1.5"></a>
## [0.1.5](https://github.com/kulshekhar/ts-jest/compare/0.1.4...0.1.5) (2016-09-22)
<a name="0.1.4"></a>
## [0.1.4](https://github.com/kulshekhar/ts-jest/compare/0.1.3...0.1.4) (2016-09-16)
<a name="0.1.3"></a>
## [0.1.3](https://github.com/kulshekhar/ts-jest/compare/0.1.2...0.1.3) (2016-08-31)
<a name="0.1.2"></a>
## [0.1.2](https://github.com/kulshekhar/ts-jest/compare/0.1.1...0.1.2) (2016-08-31)
<a name="0.1.1"></a>
## [0.1.1](https://github.com/kulshekhar/ts-jest/compare/0.1.0...0.1.1) (2016-08-31)
<a name="0.1.0"></a>
# [0.1.0](https://github.com/kulshekhar/ts-jest/compare/0.0.1...0.1.0) (2016-08-31)
<a name="0.0.1"></a>
## [0.0.1](https://github.com/kulshekhar/ts-jest/compare/0.0.0...0.0.1) (2016-08-30)
<a name="0.0.0"></a>
# 0.0.0 (2016-08-30)

67
node_modules/ts-jest/CONTRIBUTING.md generated vendored Normal file
View file

@ -0,0 +1,67 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [slack](https://bit.ly/3bRHFPQ) or [issue](https://github.com/kulshekhar/ts-jest/issues) with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure the tests are passing and that you have latest `master` branch merged in.
2. Update the `docs/` with details of your changes if required.
3. If possible, squash your commits. There must be only one commit in your PR (until a review). Then after each review requesting changes, DO NOT squash your commits with the one before the review, so that we can see intermediate modifications.
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at kulshekhar@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

21
node_modules/ts-jest/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2018
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

73
node_modules/ts-jest/README.md generated vendored Normal file
View file

@ -0,0 +1,73 @@
# ts-jest
[![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest)
[![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest)
[![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest)
[![Coverage Status](https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master)](https://coveralls.io/github/kulshekhar/ts-jest?branch=master)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=kulshekhar/ts-jest)](https://dependabot.com)
[![Build Status](https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.com/kulshekhar/ts-jest)
[![doc-generator](https://github.com/kulshekhar/ts-jest/workflows/doc-generator/badge.svg)](https://github.com/kulshekhar/ts-jest/actions)
[![release-and-publish](https://github.com/kulshekhar/ts-jest/workflows/release-and-publish/badge.svg)](https://github.com/kulshekhar/ts-jest/actions)
<img src="./icon.png" align="right" title="ts-jest Logo" width="128" height="128">
**`ts-jest`** is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript.
It supports all features of TypeScript including type-checking. [Read more about Babel7 + `preset-typescript` **vs** TypeScript (and `ts-jest`)](https://kulshekhar.github.io/ts-jest/user/babel7-or-ts).
---
| We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version |
|---|
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/3bRHFPQ)
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](TROUBLESHOOTING.md)
[<img src="./docs/assets/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
---
## Getting Started
These instructions will get you setup to use `ts-jest` in your project. For more detailed documentation, please check [online documentation](https://kulshekhar.github.io/ts-jest).
| | using npm | using yarn |
|---:|---|---|
| **Prerequisites** | `npm i -D jest typescript` | `yarn add --dev jest typescript` |
| **Installing** | `npm i -D ts-jest @types/jest` | `yarn add --dev ts-jest @types/jest` |
| **Creating config** | `npx ts-jest config:init` | `yarn ts-jest config:init` |
| **Running tests** | `npm t` or `npx jest` | `yarn test` or `yarn jest` |
## Built With
* [TypeScript](https://www.typescriptlang.org/) - JavaScript that scales
* [Jest](https://jestjs.io/) - Delightful JavaScript Testing
* [`ts-jest`](https://kulshekhar.github.io/ts-jest) - Jest processor for TypeScript _(yes, `ts-jest` uses itself for its tests)_
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We **DO NOT** use [SemVer](http://semver.org/) for versioning. Though you can think about SemVer when reading our version, except our major number follows the one of Jest. For the versions available, see the [tags on this repository](https://github.com/kulshekhar/ts-jest/tags).
## Authors/maintainers
* **Kulshekhar Kabra** - [kulshekhar](https://github.com/kulshekhar)
* **Gustav Wengel** - [GeeWee](https://github.com/GeeWee)
* **Ahn** - [ahnpnl](https://github.com/ahnpnl)
* **Huafu Gandon** - [huafu](https://github.com/huafu)
See also the list of [contributors](https://github.com/kulshekhar/ts-jest/contributors) who participated in this project.
## Supporters
- [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).
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

41
node_modules/ts-jest/TROUBLESHOOTING.md generated vendored Normal file
View file

@ -0,0 +1,41 @@
# Troubleshooting
## Running ts-jest on CI tools
### PROBLEM
Cannot find module "" from ""
### SOLUTION
- Check if `rootDir` is referenced correctly. If not add this on your existing jest configuration.
```javascipt
module.exports = {
...
roots: ["<rootDir>"]
}
```
- Check if module directories are included on your jest configuration. If not add this on your existing jest configuration.
```javascipt
module.exports = {
...
moduleDirectories: ["node_modules","<module-directory>"],
modulePaths: ["<path-of-module>"],
}
```
- Check if module name is properly mapped and can be referenced by jest. If not, you can define moduleNameMapper for your jest configuration.
```javascipt
module.exports = {
...
moduleNameMapper: {
"<import-path>": "<rootDir>/<real-physical-path>",
},
}
```
- Check github folder names if its identical to you local folder names. Sometimes github never updates your folder names even if you rename it locally. If this happens rename your folders via github or use this command `git mv <source> <destination>` and commit changes.

3
node_modules/ts-jest/cli.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env node
require('./dist/cli').processArgv()

1
node_modules/ts-jest/dist/cli/config/init.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

152
node_modules/ts-jest/dist/cli/config/init.js generated vendored Normal file
View file

@ -0,0 +1,152 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var json5_1 = require("json5");
var path_1 = require("path");
var presets_1 = require("../helpers/presets");
exports.run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, base, tsJestConf, content;
return __generator(this, function (_b) {
file = args._[0] || 'jest.config.js';
filePath = path_1.join(process.cwd(), file);
name = path_1.basename(file);
isPackage = name === 'package.json';
exists = fs_1.existsSync(filePath);
pkgFile = isPackage ? filePath : path_1.join(process.cwd(), 'package.json');
hasPackage = isPackage || fs_1.existsSync(pkgFile);
_a = args.jestPreset, jestPreset = _a === void 0 ? true : _a, askedTsconfig = args.tsconfig, force = args.force, jsdom = args.jsdom;
tsconfig = askedTsconfig === 'tsconfig.json' ? undefined : askedTsconfig;
pkgJson = hasPackage ? JSON.parse(fs_1.readFileSync(pkgFile, 'utf8')) : {};
jsFilesProcessor = args.js, shouldPostProcessWithBabel = args.babel;
if (jsFilesProcessor == null) {
jsFilesProcessor = shouldPostProcessWithBabel ? 'babel' : undefined;
}
else if (shouldPostProcessWithBabel == null) {
shouldPostProcessWithBabel = jsFilesProcessor === 'babel';
}
if (jsFilesProcessor === 'babel') {
preset = presets_1.jsWIthBabel;
}
else if (jsFilesProcessor === 'ts') {
preset = presets_1.jsWithTs;
}
else {
preset = presets_1.defaults;
}
if (isPackage && !exists) {
throw new Error("File " + file + " does not exists.");
}
else if (!isPackage && exists && !force) {
throw new Error("Configuration file " + file + " already exists.");
}
if (!isPackage && !name.endsWith('.js')) {
throw new TypeError("Configuration file " + file + " must be a .js file or the package.json.");
}
if (hasPackage && pkgJson.jest) {
if (force && !isPackage) {
delete pkgJson.jest;
fs_1.writeFileSync(pkgFile, JSON.stringify(pkgJson, undefined, ' '));
}
else if (!force) {
throw new Error("A Jest configuration is already set in " + pkgFile + ".");
}
}
if (isPackage) {
base = jestPreset ? { preset: preset.name } : __assign({}, preset.value);
if (!jsdom)
base.testEnvironment = 'node';
if (tsconfig || shouldPostProcessWithBabel) {
tsJestConf = {};
base.globals = { 'ts-jest': tsJestConf };
if (tsconfig)
tsJestConf.tsconfig = tsconfig;
if (shouldPostProcessWithBabel)
tsJestConf.babelConfig = true;
}
body = JSON.stringify(__assign(__assign({}, pkgJson), { jest: base }), undefined, ' ');
}
else {
content = [];
if (!jestPreset) {
content.push(preset.jsImport('tsjPreset') + ";", '');
}
content.push('module.exports = {');
if (jestPreset) {
content.push(" preset: '" + preset.name + "',");
}
else {
content.push(' ...tsjPreset,');
}
if (!jsdom)
content.push(" testEnvironment: 'node',");
if (tsconfig || shouldPostProcessWithBabel) {
content.push(' globals: {');
content.push(" 'ts-jest': {");
if (tsconfig)
content.push(" tsconfig: " + json5_1.stringify(tsconfig) + ",");
if (shouldPostProcessWithBabel)
content.push(' babelConfig: true,');
content.push(' },');
content.push(' },');
}
content.push('};');
body = content.join('\n');
}
fs_1.writeFileSync(filePath, body);
process.stderr.write("\nJest configuration written to \"" + filePath + "\".\n");
return [2];
});
}); };
exports.help = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest config:init [options] [<config-file>]\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n Default: jest.config.js\n\nOptions:\n --force Discard any existing Jest config\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n --tsconfig <file> Path to the tsconfig.json file\n --babel Pipe babel-jest after ts-jest\n --jsdom Use jsdom as test environment instead of node\n");
return [2];
});
}); };

1
node_modules/ts-jest/dist/cli/config/migrate.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

217
node_modules/ts-jest/dist/cli/config/migrate.js generated vendored Normal file
View file

@ -0,0 +1,217 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var stableStringify = require("fast-json-stable-stringify");
var fs_1 = require("fs");
var json5_1 = require("json5");
var path_1 = require("path");
var backports_1 = require("../../util/backports");
var presets_1 = require("../helpers/presets");
exports.run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
var nullLogger, file, filePath, footNotes, name, isPackage, actualConfig, migratedConfig, presetName, preset, jsTransformers, jsWithTs, jsWithBabel, presetValue, migratedValue, presetValue, migratedValue, before, after, stringify, prefix;
return __generator(this, function (_a) {
nullLogger = bs_logger_1.createLogger({ targets: [] });
file = args._[0];
filePath = path_1.resolve(process.cwd(), file);
footNotes = [];
if (!fs_1.existsSync(filePath)) {
throw new Error("Configuration file " + file + " does not exists.");
}
name = path_1.basename(file);
isPackage = name === 'package.json';
if (!/\.(js|json)$/.test(name)) {
throw new TypeError("Configuration file " + file + " must be a JavaScript or JSON file.");
}
actualConfig = require(filePath);
if (isPackage) {
actualConfig = actualConfig.jest;
}
if (!actualConfig)
actualConfig = {};
migratedConfig = backports_1.backportJestConfig(nullLogger, actualConfig);
if (!migratedConfig.preset && args.jestPreset) {
if (args.js) {
presetName = args.js === 'babel' ? "ts-jest/presets/js-with-babel" : "ts-jest/presets/js-with-ts";
}
else {
jsTransformers = Object.keys(migratedConfig.transform || {}).reduce(function (list, pattern) {
if (RegExp(pattern.replace(/^<rootDir>\/?/, '/dummy-project/')).test('/dummy-project/src/foo.js')) {
var transformer = migratedConfig.transform[pattern];
if (/\bbabel-jest\b/.test(transformer))
transformer = 'babel-jest';
else if (/\ts-jest\b/.test(transformer))
transformer = 'ts-jest';
return __spread(list, [transformer]);
}
return list;
}, []);
jsWithTs = jsTransformers.includes('ts-jest');
jsWithBabel = jsTransformers.includes('babel-jest');
if (jsWithBabel && !jsWithTs) {
presetName = "ts-jest/presets/js-with-babel";
}
else if (jsWithTs && !jsWithBabel) {
presetName = "ts-jest/presets/js-with-ts";
}
else {
presetName = "ts-jest/presets/default";
}
}
presetName = presetName || "ts-jest/presets/default";
preset = presets_1.allPresets[presetName];
footNotes.push("Detected preset '" + preset.label + "' as the best matching preset for your configuration.\nVisit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.\n");
}
else if (migratedConfig.preset && migratedConfig.preset.startsWith('ts-jest')) {
if (args.jestPreset === false) {
delete migratedConfig.preset;
}
else {
preset = presets_1.allPresets[migratedConfig.preset] || presets_1.defaults;
}
}
if (preset)
migratedConfig.preset = preset.name;
if (migratedConfig.moduleFileExtensions && migratedConfig.moduleFileExtensions.length && preset) {
presetValue = dedupSort(preset.value.moduleFileExtensions || []).join('::');
migratedValue = dedupSort(migratedConfig.moduleFileExtensions).join('::');
if (presetValue === migratedValue) {
delete migratedConfig.moduleFileExtensions;
}
}
if (migratedConfig.testRegex && preset) {
migratedConfig.testMatch = null;
}
else if (migratedConfig.testMatch && migratedConfig.testMatch.length && preset) {
presetValue = dedupSort(preset.value.testMatch || []).join('::');
migratedValue = dedupSort(migratedConfig.testMatch).join('::');
if (presetValue === migratedValue) {
delete migratedConfig.testMatch;
}
}
if (migratedConfig.transform) {
Object.keys(migratedConfig.transform).forEach(function (key) {
var val = migratedConfig.transform[key];
if (typeof val === 'string' && /\/?ts-jest(?:\/preprocessor\.js)?$/.test(val)) {
;
migratedConfig.transform[key] = 'ts-jest';
}
});
}
if (preset &&
migratedConfig.transform &&
stableStringify(migratedConfig.transform) === stableStringify(preset.value.transform)) {
delete migratedConfig.transform;
}
cleanupConfig(actualConfig);
cleanupConfig(migratedConfig);
before = stableStringify(actualConfig);
after = stableStringify(migratedConfig);
if (after === before) {
process.stderr.write("\nNo migration needed for given Jest configuration\n ");
return [2];
}
stringify = file.endsWith('.json') ? JSON.stringify : json5_1.stringify;
prefix = file.endsWith('.json') ? '"jest": ' : 'module.exports = ';
if (preset && migratedConfig.transform) {
footNotes.push("\nI couldn't check if your \"transform\" value is the same as mine which is: " + stringify(preset.value.transform, undefined, ' ') + "\nIf it is the case, you can safely remove the \"transform\" from what I've migrated.\n");
}
process.stderr.write("\nMigrated Jest configuration:\n");
process.stdout.write("" + prefix + stringify(migratedConfig, undefined, ' ') + "\n");
if (footNotes.length) {
process.stderr.write("\n" + footNotes.join('\n') + "\n");
}
return [2];
});
}); };
function cleanupConfig(config) {
if (config.globals) {
if (config.globals['ts-jest'] && Object.keys(config.globals['ts-jest']).length === 0) {
delete config.globals['ts-jest'];
}
if (Object.keys(config.globals).length === 0) {
delete config.globals;
}
}
if (config.transform && Object.keys(config.transform).length === 0) {
delete config.transform;
}
if (config.moduleFileExtensions) {
config.moduleFileExtensions = dedupSort(config.moduleFileExtensions);
if (config.moduleFileExtensions.length === 0)
delete config.moduleFileExtensions;
}
if (config.testMatch) {
config.testMatch = dedupSort(config.testMatch);
if (config.testMatch.length === 0)
delete config.testMatch;
}
if (config.preset === "ts-jest/presets/default")
config.preset = presets_1.defaults.name;
}
function dedupSort(arr) {
return arr
.filter(function (s, i, a) { return a.findIndex(function (e) { return s.toString() === e.toString(); }) === i; })
.sort(function (a, b) { return (a.toString() > b.toString() ? 1 : a.toString() < b.toString() ? -1 : 0); });
}
exports.help = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest config:migrate [options] <config-file>\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n\nOptions:\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n");
return [2];
});
}); };

1
node_modules/ts-jest/dist/cli/help.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

45
node_modules/ts-jest/dist/cli/help.js generated vendored Normal file
View file

@ -0,0 +1,45 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = function (_) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest command [options] [...args]\n\nCommands:\n config:init Creates initial Jest configuration\n config:migrate Migrates a given Jest configuration\n help [command] Show this help, or help about a command\n\nExample:\n ts-jest help config:migrate\n");
return [2];
});
}); };
exports.help = exports.run;

1
node_modules/ts-jest/dist/cli/helpers/presets.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

33
node_modules/ts-jest/dist/cli/helpers/presets.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var definePreset = function (fullName) { return ({
fullName: fullName,
get name() {
return this.isDefault ? 'ts-jest' : fullName;
},
get label() {
return fullName.split('/').pop();
},
get jsVarName() {
return this.isDefault
? 'defaults'
: fullName
.split('/')
.pop()
.replace(/\-([a-z])/g, function (_, l) { return l.toUpperCase(); });
},
get value() {
return require("../../../" + fullName.replace(/^ts-jest\//, '') + "/jest-preset");
},
jsImport: function (varName) {
if (varName === void 0) { varName = 'tsjPreset'; }
return "const { " + this.jsVarName + ": " + varName + " } = require('ts-jest/presets')";
},
get isDefault() {
return fullName === "ts-jest/presets/default";
},
}); };
exports.allPresets = {};
exports.defaults = (exports.allPresets["ts-jest/presets/default"] = definePreset("ts-jest/presets/default"));
exports.jsWithTs = (exports.allPresets["ts-jest/presets/js-with-ts"] = definePreset("ts-jest/presets/js-with-ts"));
exports.jsWIthBabel = (exports.allPresets["ts-jest/presets/js-with-babel"] = definePreset("ts-jest/presets/js-with-babel"));

1
node_modules/ts-jest/dist/cli/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

103
node_modules/ts-jest/dist/cli/index.js generated vendored Normal file
View file

@ -0,0 +1,103 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var yargsParser = require("yargs-parser");
var logger_1 = require("../util/logger");
var VALID_COMMANDS = ['help', 'config:migrate', 'config:init'];
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'cli', _a[bs_logger_1.LogContexts.application] = 'ts-jest', _a));
function cli(args) {
return __awaiter(this, void 0, void 0, function () {
var parsedArgv, command, isHelp, _a, run, help, cmd;
return __generator(this, function (_b) {
parsedArgv = yargsParser(args, {
boolean: ['dry-run', 'jest-preset', 'allow-js', 'diff', 'babel', 'force', 'jsdom'],
string: ['tsconfig', 'js'],
count: ['verbose'],
alias: { verbose: ['v'] },
default: { jestPreset: true, verbose: 0 },
coerce: {
js: function (val) {
var res = val.trim().toLowerCase();
if (!['babel', 'ts'].includes(res))
throw new Error("The 'js' option must be 'babel' or 'ts', given: '" + val + "'.");
return res;
},
},
});
if (parsedArgv.allowJs != null) {
if (parsedArgv.js)
throw new Error("The 'allowJs' and 'js' options cannot be set together.");
parsedArgv.js = parsedArgv.allowJs ? 'ts' : undefined;
}
command = parsedArgv._.shift();
isHelp = command === 'help';
if (isHelp)
command = parsedArgv._.shift();
if (!VALID_COMMANDS.includes(command))
command = 'help';
_a = require("./" + command.replace(/:/g, '/')), run = _a.run, help = _a.help;
cmd = isHelp && command !== 'help' ? help : run;
return [2, cmd(parsedArgv, logger)];
});
});
}
function processArgv() {
return __awaiter(this, void 0, void 0, function () {
var err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4, cli(process.argv.slice(2))];
case 1:
_a.sent();
process.exit(0);
return [3, 3];
case 2:
err_1 = _a.sent();
logger.fatal(err_1.message);
process.exit(1);
return [3, 3];
case 3: return [2];
}
});
});
}
exports.processArgv = processArgv;

View file

@ -0,0 +1 @@
export {};

33
node_modules/ts-jest/dist/compiler/compiler-utils.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var micromatch = require("micromatch");
var path_1 = require("path");
var sha1_1 = require("../util/sha1");
function getResolvedModulesCache(cacheDir) {
return path_1.join(cacheDir, sha1_1.sha1('ts-jest-resolved-modules', '\x00'));
}
exports.getResolvedModulesCache = getResolvedModulesCache;
function cacheResolvedModules(fileName, fileContent, memoryCache, program, cacheDir, logger) {
var importReferences = program.getSourceFile(fileName).imports;
if (importReferences.length) {
logger.debug({ fileName: fileName }, 'cacheResolvedModules(): get resolved modules');
memoryCache.resolvedModules[fileName] = Object.create(null);
memoryCache.resolvedModules[fileName].modulePaths = importReferences
.filter(function (importReference) { var _a; return (_a = importReference.parent.parent.resolvedModules) === null || _a === void 0 ? void 0 : _a.get(importReference.text); })
.map(function (importReference) {
return path_1.normalize(importReference.parent.parent.resolvedModules.get(importReference.text)
.resolvedFileName);
})
.reduce(function (a, b) { return a.concat(b); }, []);
memoryCache.resolvedModules[fileName].testFileContent = fileContent;
fs_1.writeFileSync(getResolvedModulesCache(cacheDir), JSON.stringify(memoryCache.resolvedModules));
}
}
exports.cacheResolvedModules = cacheResolvedModules;
function isTestFile(testMatchPatterns, fileName) {
return testMatchPatterns.some(function (pattern) {
return typeof pattern === 'string' ? micromatch.isMatch(fileName, pattern) : pattern.test(fileName);
});
}
exports.isTestFile = isTestFile;

1
node_modules/ts-jest/dist/compiler/instance.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

96
node_modules/ts-jest/dist/compiler/instance.js generated vendored Normal file
View file

@ -0,0 +1,96 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var mkdirp = require("mkdirp");
var path_1 = require("path");
var compiler_utils_1 = require("./compiler-utils");
var language_service_1 = require("./language-service");
var transpiler_1 = require("./transpiler");
function updateOutput(outputText, normalizedFileName, sourceMap, getExtension) {
var base = path_1.basename(normalizedFileName);
var base64Map = Buffer.from(updateSourceMap(sourceMap, normalizedFileName), 'utf8').toString('base64');
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
var sourceMapLength = (base + ".map").length + (getExtension(normalizedFileName).length - path_1.extname(normalizedFileName).length);
return outputText.slice(0, -sourceMapLength) + sourceMapContent;
}
var updateSourceMap = function (sourceMapText, normalizedFileName) {
var sourceMap = JSON.parse(sourceMapText);
sourceMap.file = normalizedFileName;
sourceMap.sources = [normalizedFileName];
delete sourceMap.sourceRoot;
return JSON.stringify(sourceMap);
};
var compileAndCacheResult = function (memoryCache, compileFn, getExtension, logger) { return function (code, fileName, lineOffset) {
logger.debug({ fileName: fileName }, 'compileAndCacheResult(): get compile output');
var _a = __read(compileFn(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
var output = updateOutput(value, fileName, sourceMap, getExtension);
memoryCache.files.set(fileName, __assign(__assign({}, memoryCache.files.get(fileName)), { output: output }));
return output;
}; };
exports.createCompilerInstance = function (configs) {
var logger = configs.logger.child({ namespace: 'ts-compiler' });
var compilerOptions = configs.parsedTsConfig.options, tsJest = configs.tsJest;
var cacheDir = configs.tsCacheDir;
var ts = configs.compilerModule;
var extensions = ['.ts', '.tsx'];
var memoryCache = {
files: new Map(),
resolvedModules: Object.create(null),
};
if (compilerOptions.allowJs) {
extensions.push('.js');
extensions.push('.jsx');
}
if (cacheDir) {
mkdirp.sync(cacheDir);
try {
var fsMemoryCache = fs_1.readFileSync(compiler_utils_1.getResolvedModulesCache(cacheDir), 'utf-8');
memoryCache.resolvedModules = JSON.parse(fsMemoryCache);
}
catch (e) { }
}
configs.parsedTsConfig.fileNames.forEach(function (fileName) {
memoryCache.files.set(fileName, {
version: 0,
});
});
var getExtension = compilerOptions.jsx === ts.JsxEmit.Preserve
? function (path) { return (/\.[tj]sx$/.test(path) ? '.jsx' : '.js'); }
: function (_) { return '.js'; };
var compilerInstance;
if (!tsJest.isolatedModules) {
compilerInstance = language_service_1.initializeLanguageServiceInstance(configs, memoryCache, logger);
}
else {
compilerInstance = transpiler_1.initializeTranspilerInstance(configs, memoryCache, logger);
}
var compile = compileAndCacheResult(memoryCache, compilerInstance.compileFn, getExtension, logger);
return { cwd: configs.cwd, compile: compile, program: compilerInstance.program };
};

View file

@ -0,0 +1 @@
export {};

155
node_modules/ts-jest/dist/compiler/language-service.js generated vendored Normal file
View file

@ -0,0 +1,155 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var path_1 = require("path");
var constants_1 = require("../constants");
var messages_1 = require("../util/messages");
var compiler_utils_1 = require("./compiler-utils");
var memoize = require("lodash.memoize");
function doTypeChecking(configs, fileName, service, logger) {
if (configs.shouldReportDiagnostic(fileName)) {
var diagnostics = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName));
configs.raiseDiagnostics(diagnostics, fileName, logger);
}
}
exports.initializeLanguageServiceInstance = function (configs, memoryCache, logger) {
var _a;
logger.debug('initializeLanguageServiceInstance(): create typescript compiler');
var ts = configs.compilerModule;
var cwd = configs.cwd;
var cacheDir = configs.tsCacheDir;
var _b = configs.parsedTsConfig, options = _b.options, fileNames = _b.fileNames;
var serviceHostTraceCtx = (_a = {
namespace: 'ts:serviceHost',
call: null
},
_a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace,
_a);
function isFileInCache(fileName) {
return memoryCache.files.has(fileName) && memoryCache.files.get(fileName).version !== 0;
}
var projectVersion = 1;
var updateMemoryCache = function (contents, fileName) {
logger.debug({ fileName: fileName }, 'updateMemoryCache(): update memory cache for language service');
var shouldIncrementProjectVersion = false;
var hit = isFileInCache(fileName);
if (!hit) {
memoryCache.files.set(fileName, {
text: contents,
version: 1,
});
shouldIncrementProjectVersion = true;
}
else {
var previousContents = memoryCache.files.get(fileName).text;
if (previousContents !== contents) {
memoryCache.files.set(fileName, {
text: contents,
version: memoryCache.files.get(fileName).version + 1,
});
if (hit)
shouldIncrementProjectVersion = true;
}
if (!fileNames.includes(fileName)) {
shouldIncrementProjectVersion = true;
}
}
if (shouldIncrementProjectVersion)
projectVersion++;
};
var serviceHost = {
getProjectVersion: function () { return String(projectVersion); },
getScriptFileNames: function () { return __spread(memoryCache.files.keys()); },
getScriptVersion: function (fileName) {
var normalizedFileName = path_1.normalize(fileName);
var version = memoryCache.files.get(normalizedFileName).version;
return version === undefined ? undefined : String(version);
},
getScriptSnapshot: function (fileName) {
var _a;
var normalizedFileName = path_1.normalize(fileName);
var hit = memoryCache.files.has(normalizedFileName) && memoryCache.files.get(normalizedFileName).version !== 0;
logger.trace({ normalizedFileName: normalizedFileName, cacheHit: hit }, 'getScriptSnapshot():', 'cache', hit ? 'hit' : 'miss');
if (!hit) {
memoryCache.files.set(normalizedFileName, {
text: ts.sys.readFile(normalizedFileName),
version: 1,
});
}
var contents = (_a = memoryCache.files.get(normalizedFileName)) === null || _a === void 0 ? void 0 : _a.text;
if (contents === undefined)
return;
return ts.ScriptSnapshot.fromString(contents);
},
fileExists: memoize(ts.sys.fileExists),
readFile: logger.wrap(serviceHostTraceCtx, 'readFile', memoize(ts.sys.readFile)),
readDirectory: memoize(ts.sys.readDirectory),
getDirectories: memoize(ts.sys.getDirectories),
directoryExists: memoize(ts.sys.directoryExists),
realpath: memoize(ts.sys.realpath),
getNewLine: function () { return constants_1.LINE_FEED; },
getCurrentDirectory: function () { return cwd; },
getCompilationSettings: function () { return options; },
getDefaultLibFileName: function () { return ts.getDefaultLibFilePath(options); },
getCustomTransformers: function () { return configs.tsCustomTransformers; },
};
logger.debug('initializeLanguageServiceInstance(): creating language service');
var service = ts.createLanguageService(serviceHost, ts.createDocumentRegistry());
return {
compileFn: function (code, fileName) {
logger.debug({ fileName: fileName }, 'compileFn(): compiling using language service');
updateMemoryCache(code, fileName);
var output = service.getEmitOutput(fileName);
logger.debug({ fileName: fileName }, 'compileFn(): computing diagnostics using language service');
doTypeChecking(configs, fileName, service, logger);
if (cacheDir) {
if (compiler_utils_1.isTestFile(configs.testMatchPatterns, fileName)) {
compiler_utils_1.cacheResolvedModules(fileName, code, memoryCache, service.getProgram(), cacheDir, logger);
}
else {
Object.entries(memoryCache.resolvedModules)
.filter(function (entry) {
return entry[1].modulePaths.find(function (modulePath) { return modulePath === fileName; }) && !memoryCache.files.has(entry[0]);
})
.forEach(function (entry) {
var testFileName = entry[0];
var testFileContent = entry[1].testFileContent;
logger.debug({ fileName: fileName }, 'compileFn(): computing diagnostics for test file that imports this module using language service');
updateMemoryCache(testFileContent, testFileName);
doTypeChecking(configs, testFileName, service, logger);
});
}
}
if (output.emitSkipped) {
throw new TypeError(path_1.relative(cwd, fileName) + ": Emit skipped for language service");
}
if (!output.outputFiles.length) {
throw new TypeError(messages_1.interpolate("Unable to require `.d.ts` file for file: {{file}}.\nThis is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or another executable extension available alongside `{{file}}`.", {
file: path_1.basename(fileName),
}));
}
return [output.outputFiles[1].text, output.outputFiles[0].text];
},
program: service.getProgram(),
};
};

1
node_modules/ts-jest/dist/compiler/transpiler.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

32
node_modules/ts-jest/dist/compiler/transpiler.js generated vendored Normal file
View file

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeTranspilerInstance = function (configs, memoryCache, logger) {
logger.debug('initializeTranspilerInstance(): create typescript compiler');
var _a = configs.parsedTsConfig, options = _a.options, fileNames = _a.fileNames;
var ts = configs.compilerModule;
var program = ts.createProgram(fileNames, options);
var updateFileInCache = function (contents, filePath) {
var file = memoryCache.files.get(filePath);
if (file && file.text !== contents) {
file.version++;
file.text = contents;
}
};
return {
compileFn: function (code, fileName) {
updateFileInCache(code, fileName);
logger.debug({ fileName: fileName }, 'compileFn(): compiling as isolated module');
var result = ts.transpileModule(code, {
fileName: fileName,
transformers: configs.tsCustomTransformers,
compilerOptions: options,
reportDiagnostics: configs.shouldReportDiagnostic(fileName),
});
if (result.diagnostics && configs.shouldReportDiagnostic(fileName)) {
configs.raiseDiagnostics(result.diagnostics, fileName, logger);
}
return [result.outputText, result.sourceMapText];
},
program: program,
};
};

11
node_modules/ts-jest/dist/config/config-set.d.ts generated vendored Normal file
View file

@ -0,0 +1,11 @@
import { Config } from '@jest/types';
import { Logger } from 'bs-logger';
import { TsCompiler, TsJestGlobalOptions } from '../types';
export declare class ConfigSet {
readonly parentOptions?: TsJestGlobalOptions | undefined;
get versions(): Record<string, string>;
get tsCompiler(): TsCompiler;
get tsJestDigest(): string;
readonly logger: Logger;
constructor(jestConfig: Config.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
}

781
node_modules/ts-jest/dist/config/config-set.js generated vendored Normal file
View file

@ -0,0 +1,781 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var fs_1 = require("fs");
var json5 = require("json5");
var path_1 = require("path");
var __1 = require("..");
var instance_1 = require("../compiler/instance");
var constants_1 = require("../constants");
var transformers_1 = require("../transformers");
var backports_1 = require("../util/backports");
var get_package_version_1 = require("../util/get-package-version");
var importer_1 = require("../util/importer");
var json_1 = require("../util/json");
var jsonable_value_1 = require("../util/jsonable-value");
var logger_1 = require("../util/logger");
var memoize_1 = require("../util/memoize");
var messages_1 = require("../util/messages");
var normalize_slashes_1 = require("../util/normalize-slashes");
var sha1_1 = require("../util/sha1");
var ts_error_1 = require("../util/ts-error");
var logger = logger_1.rootLogger.child({ namespace: 'config' });
exports.MATCH_NOTHING = /a^/;
exports.IGNORE_DIAGNOSTIC_CODES = [
6059,
18002,
18003,
];
exports.TS_JEST_OUT_DIR = '$$ts-jest$$';
var normalizeRegex = function (pattern) {
return pattern ? (typeof pattern === 'string' ? pattern : pattern.source) : undefined;
};
var toDiagnosticCode = function (code) {
return code ? parseInt(("" + code).trim().replace(/^TS/, ''), 10) || undefined : undefined;
};
var toDiagnosticCodeList = function (items, into) {
var e_1, _a;
if (into === void 0) { into = []; }
if (!Array.isArray(items))
items = [items];
try {
for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
var item = items_1_1.value;
if (!item)
continue;
if (Array.isArray(item)) {
toDiagnosticCodeList(item, into);
continue;
}
else if (typeof item === 'string') {
var children = item.trim().split(/\s*,\s*/g);
if (children.length > 1) {
toDiagnosticCodeList(children, into);
continue;
}
item = children[0];
}
if (!item)
continue;
var code = toDiagnosticCode(item);
if (code && !into.includes(code))
into.push(code);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
}
finally { if (e_1) throw e_1.error; }
}
return into;
};
var ConfigSet = (function () {
function ConfigSet(jestConfig, parentOptions, parentLogger) {
var _a;
this.parentOptions = parentOptions;
this._jestConfig = jestConfig;
this.logger = parentLogger ? parentLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'config', _a)) : logger;
}
Object.defineProperty(ConfigSet.prototype, "projectPackageJson", {
get: function () {
var packageJson = this.tsJest.packageJson;
if (packageJson && packageJson.kind === 'inline') {
return packageJson.value;
}
if (packageJson && packageJson.kind === 'file' && packageJson.value) {
var path = this.resolvePath(packageJson.value);
if (fs_1.existsSync(path)) {
return require(path);
}
this.logger.warn("Unable to find the root of the project where ts-jest has been installed.");
return {};
}
var tsJestRoot = path_1.resolve(__dirname, '..', '..');
var pkgPath = path_1.resolve(tsJestRoot, '..', '..', 'package.json');
if (fs_1.existsSync(pkgPath)) {
return require(pkgPath);
}
if (fs_1.realpathSync(this.rootDir) === fs_1.realpathSync(tsJestRoot)) {
pkgPath = path_1.resolve(tsJestRoot, 'package.json');
if (fs_1.existsSync(pkgPath)) {
return require(pkgPath);
}
}
this.logger.warn("Unable to find the root of the project where ts-jest has been installed.");
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "projectDependencies", {
get: function () {
var pkg = this.projectPackageJson;
var names = Object.keys(__assign(__assign(__assign(__assign({}, pkg.optionalDependencies), pkg.peerDependencies), pkg.devDependencies), pkg.dependencies));
return names.reduce(function (map, name) {
var version = get_package_version_1.getPackageVersion(name);
if (version)
map[name] = version;
return map;
}, {});
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "jest", {
get: function () {
var _a;
var config = backports_1.backportJestConfig(this.logger, this._jestConfig);
if (this.parentOptions) {
var globals = (_a = config.globals) !== null && _a !== void 0 ? _a : {};
globals['ts-jest'] = __assign(__assign({}, this.parentOptions), globals['ts-jest']);
}
this.logger.debug({ jestConfig: config }, 'normalized jest config');
return config;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "testMatchPatterns", {
get: function () {
var matchablePatterns = __spread(this.jest.testMatch, this.jest.testRegex).filter(function (pattern) {
return pattern instanceof RegExp || typeof pattern === 'string';
});
if (!matchablePatterns.length) {
matchablePatterns.push.apply(matchablePatterns, __spread(constants_1.DEFAULT_JEST_TEST_MATCH));
}
return matchablePatterns;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsJest", {
get: function () {
var _this = this;
var _a, _b, _c;
var parsedConfig = this.jest;
var _d = parsedConfig.globals, globals = _d === void 0 ? {} : _d;
var options = __assign({}, globals['ts-jest']);
var tsConfigOpt = (_b = (_a = options.tsConfig) !== null && _a !== void 0 ? _a : options.tsconfig) !== null && _b !== void 0 ? _b : true;
var tsConfig;
if (typeof tsConfigOpt === 'string' || tsConfigOpt === true) {
tsConfig = {
kind: 'file',
value: typeof tsConfigOpt === 'string' ? this.resolvePath(tsConfigOpt) : undefined,
};
}
else if (typeof tsConfigOpt === 'object') {
tsConfig = {
kind: 'inline',
value: tsConfigOpt,
};
}
var packageJsonOpt = options.packageJson;
var packageJson;
if (typeof packageJsonOpt === 'string' || packageJsonOpt == null || packageJsonOpt === true) {
packageJson = {
kind: 'file',
value: typeof packageJsonOpt === 'string' ? this.resolvePath(packageJsonOpt) : undefined,
};
}
else if (typeof packageJsonOpt === 'object') {
packageJson = {
kind: 'inline',
value: packageJsonOpt,
};
}
var transformers = (options.astTransformers || []).map(function (mod) { return _this.resolvePath(mod, { nodeResolve: true }); });
var babelConfigOpt = options.babelConfig;
var babelConfig;
if (typeof babelConfigOpt === 'string' || babelConfigOpt === true) {
babelConfig = {
kind: 'file',
value: babelConfigOpt === true ? undefined : this.resolvePath(babelConfigOpt),
};
}
else if (babelConfigOpt) {
babelConfig = {
kind: 'inline',
value: babelConfigOpt,
};
}
var diagnostics;
var _e = options.diagnostics, diagnosticsOpt = _e === void 0 ? true : _e;
var ignoreList = [exports.IGNORE_DIAGNOSTIC_CODES, process.env.TS_JEST_IGNORE_DIAGNOSTICS];
if (diagnosticsOpt === true || diagnosticsOpt == null) {
diagnostics = { ignoreCodes: [], pretty: true, throws: true };
}
else if (diagnosticsOpt === false) {
diagnostics = {
throws: false,
pretty: true,
ignoreCodes: [],
pathRegex: exports.MATCH_NOTHING.source,
};
}
else {
ignoreList.push(diagnosticsOpt.ignoreCodes);
diagnostics = {
pretty: diagnosticsOpt.pretty == null ? true : !!diagnosticsOpt.pretty,
ignoreCodes: [],
pathRegex: normalizeRegex(diagnosticsOpt.pathRegex),
throws: !diagnosticsOpt.warnOnly,
};
}
diagnostics.ignoreCodes = toDiagnosticCodeList(ignoreList);
var stringifyContentPathRegex = normalizeRegex(options.stringifyContentPathRegex);
var res = {
tsConfig: tsConfig,
packageJson: packageJson,
babelConfig: babelConfig,
diagnostics: diagnostics,
isolatedModules: !!options.isolatedModules,
compiler: (_c = options.compiler) !== null && _c !== void 0 ? _c : 'typescript',
transformers: transformers,
stringifyContentPathRegex: stringifyContentPathRegex,
};
this.logger.debug({ tsJestConfig: res }, 'normalized ts-jest config');
return res;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "parsedTsConfig", {
get: function () {
return this._parsedTsConfig;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "versions", {
get: function () {
var modules = ['jest', this.tsJest.compiler];
if (this.tsJest.babelConfig) {
modules.push('@babel/core', 'babel-jest');
}
return modules.reduce(function (map, name) {
var _a;
map[name] = (_a = get_package_version_1.getPackageVersion(name)) !== null && _a !== void 0 ? _a : '-';
return map;
}, { 'ts-jest': __1.version });
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "_parsedTsConfig", {
get: function () {
var tsConfig = this.tsJest.tsConfig;
var configFilePath = tsConfig && tsConfig.kind === 'file' ? tsConfig.value : undefined;
var result = this.readTsConfig(tsConfig && tsConfig.kind === 'inline' ? tsConfig.value : undefined, configFilePath, tsConfig == null);
this.raiseDiagnostics(result.errors, configFilePath);
this.logger.debug({ tsconfig: result }, 'normalized typescript config');
return result;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "raiseDiagnostics", {
get: function () {
var _this = this;
var _a = this, createTsError = _a.createTsError, filterDiagnostics = _a.filterDiagnostics, throws = _a.tsJest.diagnostics.throws, DiagnosticCategory = _a.compilerModule.DiagnosticCategory;
return function (diagnostics, filePath, logger) {
if (logger === void 0) { logger = _this.logger; }
var filteredDiagnostics = filterDiagnostics(diagnostics, filePath);
if (!filteredDiagnostics.length)
return;
var error = createTsError(filteredDiagnostics);
var importantCategories = [DiagnosticCategory.Warning, DiagnosticCategory.Error];
if (throws && filteredDiagnostics.some(function (d) { return importantCategories.includes(d.category); })) {
throw error;
}
logger.warn({ error: error }, error.message);
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "babel", {
get: function () {
var babelConfig = this.tsJest.babelConfig;
if (babelConfig == null) {
this.logger.debug('babel is disabled');
return undefined;
}
var base = { cwd: this.cwd };
if (babelConfig.kind === 'file') {
if (babelConfig.value) {
if (path_1.extname(babelConfig.value) === '.js') {
base = __assign(__assign({}, base), require(babelConfig.value));
}
else {
base = __assign(__assign({}, base), json5.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
}
}
}
else if (babelConfig.kind === 'inline') {
base = __assign(__assign({}, base), babelConfig.value);
}
this.logger.debug({ babelConfig: base }, 'normalized babel config via ts-jest option');
return base;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "compilerModule", {
get: function () {
return importer_1.importer.typescript("Using \"ts-jest\" requires this package to be installed.", this.tsJest.compiler);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "babelJestTransformer", {
get: function () {
var babel = this.babel;
if (!babel)
return undefined;
this.logger.debug('creating babel-jest transformer');
return importer_1.importer.babelJest("Using \"babel-jest\" requires this package to be installed.").createTransformer(babel);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCompiler", {
get: function () {
return instance_1.createCompilerInstance(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "astTransformers", {
get: function () {
return __spread(transformers_1.internals, this.tsJest.transformers.map(function (m) { return require(m); }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCustomTransformers", {
get: function () {
var _this = this;
return {
before: this.astTransformers.map(function (t) { return t.factory(_this); }),
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "hooks", {
get: function () {
var hooksFile = process.env.TS_JEST_HOOKS;
if (hooksFile) {
hooksFile = path_1.resolve(this.cwd, hooksFile);
return importer_1.importer.tryTheseOr(hooksFile, {});
}
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "filterDiagnostics", {
get: function () {
var _a = this, ignoreCodes = _a.tsJest.diagnostics.ignoreCodes, shouldReportDiagnostic = _a.shouldReportDiagnostic;
return function (diagnostics, filePath) {
if (filePath && !shouldReportDiagnostic(filePath))
return [];
return diagnostics.filter(function (diagnostic) {
var _a;
if (((_a = diagnostic.file) === null || _a === void 0 ? void 0 : _a.fileName) && !shouldReportDiagnostic(diagnostic.file.fileName)) {
return false;
}
return !ignoreCodes.includes(diagnostic.code);
});
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "shouldReportDiagnostic", {
get: function () {
var pathRegex = this.tsJest.diagnostics.pathRegex;
if (pathRegex) {
var regex_1 = new RegExp(pathRegex);
return function (file) { return regex_1.test(file); };
}
else {
return function () { return true; };
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "shouldStringifyContent", {
get: function () {
var stringifyContentPathRegex = this.tsJest.stringifyContentPathRegex;
if (stringifyContentPathRegex) {
var regex_2 = new RegExp(stringifyContentPathRegex);
return function (file) { return regex_2.test(file); };
}
else {
return function () { return false; };
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "createTsError", {
get: function () {
var _this = this;
var pretty = this.tsJest.diagnostics.pretty;
var formatDiagnostics = pretty
? this.compilerModule.formatDiagnosticsWithColorAndContext
: this.compilerModule.formatDiagnostics;
var diagnosticHost = {
getNewLine: function () { return '\n'; },
getCurrentDirectory: function () { return _this.cwd; },
getCanonicalFileName: function (path) { return path; },
};
return function (diagnostics) {
var diagnosticText = formatDiagnostics(diagnostics, diagnosticHost);
var diagnosticCodes = diagnostics.map(function (x) { return x.code; });
return new ts_error_1.TSError(diagnosticText, diagnosticCodes);
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCacheDir", {
get: function () {
if (!this.jest.cache) {
logger.debug('file caching disabled');
return undefined;
}
var cacheSuffix = sha1_1.sha1(json_1.stringify({
version: this.compilerModule.version,
digest: this.tsJestDigest,
dependencies: this.projectDependencies,
compiler: this.tsJest.compiler,
compilerOptions: this.parsedTsConfig.options,
isolatedModules: this.tsJest.isolatedModules,
diagnostics: this.tsJest.diagnostics,
}));
var res = path_1.join(this.jest.cacheDirectory, 'ts-jest', cacheSuffix.substr(0, 2), cacheSuffix.substr(2));
logger.debug({ cacheDirectory: res }, 'will use file caching');
return res;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "overriddenCompilerOptions", {
get: function () {
var options = {
sourceMap: true,
inlineSourceMap: false,
inlineSources: true,
declaration: false,
noEmit: false,
removeComments: false,
out: undefined,
outFile: undefined,
composite: undefined,
declarationDir: undefined,
declarationMap: undefined,
emitDeclarationOnly: undefined,
sourceRoot: undefined,
tsBuildInfoFile: undefined,
};
if (!this.tsJest.babelConfig) {
options.module = this.compilerModule.ModuleKind.CommonJS;
}
return options;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "rootDir", {
get: function () {
return path_1.normalize(this.jest.rootDir || this.cwd);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "cwd", {
get: function () {
return path_1.normalize(this.jest.cwd || process.cwd());
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsJestDigest", {
get: function () {
return __1.digest;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "jsonValue", {
get: function () {
var jest = __assign({}, this.jest);
var globals = (jest.globals = __assign({}, jest.globals));
delete jest.name;
delete jest.cacheDirectory;
delete globals['ts-jest'];
return new jsonable_value_1.JsonableValue({
versions: this.versions,
projectDepVersions: this.projectDependencies,
digest: this.tsJestDigest,
transformers: this.astTransformers.map(function (t) { return t.name + "@" + t.version; }),
jest: jest,
tsJest: this.tsJest,
babel: this.babel,
tsconfig: this.parsedTsConfig.options,
});
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "cacheKey", {
get: function () {
return this.jsonValue.serialized;
},
enumerable: true,
configurable: true
});
ConfigSet.prototype.makeDiagnostic = function (code, messageText, options) {
if (options === void 0) { options = {}; }
var _a = options.category, category = _a === void 0 ? this.compilerModule.DiagnosticCategory.Warning : _a, file = options.file, start = options.start, length = options.length;
return {
code: code,
messageText: messageText,
category: category,
file: file,
start: start,
length: length,
};
};
ConfigSet.prototype.readTsConfig = function (compilerOptions, resolvedConfigFile, noProject) {
var e_2, _a;
var config = { compilerOptions: {} };
var basePath = normalize_slashes_1.normalizeSlashes(this.rootDir);
var configFileName;
var ts = this.compilerModule;
if (!noProject) {
configFileName = resolvedConfigFile
? normalize_slashes_1.normalizeSlashes(resolvedConfigFile)
: ts.findConfigFile(normalize_slashes_1.normalizeSlashes(this.rootDir), ts.sys.fileExists);
if (configFileName) {
this.logger.debug({ tsConfigFileName: configFileName }, 'readTsConfig(): reading', configFileName);
var result_1 = ts.readConfigFile(configFileName, ts.sys.readFile);
if (result_1.error) {
return { errors: [result_1.error], fileNames: [], options: {} };
}
config = result_1.config;
basePath = normalize_slashes_1.normalizeSlashes(path_1.dirname(configFileName));
}
}
config.compilerOptions = __assign(__assign({}, config.compilerOptions), compilerOptions);
var result = ts.parseJsonConfigFileContent(config, ts.sys, basePath, undefined, configFileName);
var forcedOptions = this.overriddenCompilerOptions;
var finalOptions = result.options;
if (finalOptions.target === undefined) {
finalOptions.target = ts.ScriptTarget.ES5;
}
var target = finalOptions.target;
var defaultModule = [ts.ScriptTarget.ES3, ts.ScriptTarget.ES5].includes(target)
? ts.ModuleKind.CommonJS
: ts.ModuleKind.ESNext;
var moduleValue = finalOptions.module == null ? defaultModule : finalOptions.module;
if ('module' in forcedOptions &&
moduleValue !== forcedOptions.module &&
!(finalOptions.esModuleInterop || finalOptions.allowSyntheticDefaultImports)) {
result.errors.push(this.makeDiagnostic(151001, "If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.", {
category: ts.DiagnosticCategory.Message,
}));
if (!('allowSyntheticDefaultImports' in config.compilerOptions)) {
finalOptions.allowSyntheticDefaultImports = true;
}
}
if (finalOptions.allowJs && !finalOptions.outDir) {
finalOptions.outDir = exports.TS_JEST_OUT_DIR;
}
try {
for (var _b = __values(Object.keys(forcedOptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
var key = _c.value;
var val = forcedOptions[key];
if (val === undefined) {
delete finalOptions[key];
}
else {
finalOptions[key] = val;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return result;
};
ConfigSet.prototype.resolvePath = function (inputPath, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.throwIfMissing, throwIfMissing = _c === void 0 ? true : _c, _d = _b.nodeResolve, nodeResolve = _d === void 0 ? false : _d;
var path = inputPath;
var nodeResolved = false;
if (path.startsWith('<rootDir>')) {
path = path_1.resolve(path_1.join(this.rootDir, path.substr(9)));
}
else if (!path_1.isAbsolute(path)) {
if (!path.startsWith('.') && nodeResolve) {
try {
path = require.resolve(path);
nodeResolved = true;
}
catch (_) { }
}
if (!nodeResolved) {
path = path_1.resolve(this.cwd, path);
}
}
if (!nodeResolved && nodeResolve) {
try {
path = require.resolve(path);
nodeResolved = true;
}
catch (_) { }
}
if (throwIfMissing && !fs_1.existsSync(path)) {
throw new Error(messages_1.interpolate("File not found: {{inputPath}} (resolved as: {{resolvedPath}})", { inputPath: inputPath, resolvedPath: path }));
}
this.logger.debug({ fromPath: inputPath, toPath: path }, 'resolved path from', inputPath, 'to', path);
return path;
};
ConfigSet.prototype.toJSON = function () {
return this.jsonValue.value;
};
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "projectPackageJson", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "projectDependencies", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "jest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "testMatchPatterns", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsJest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "versions", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "_parsedTsConfig", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "raiseDiagnostics", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "babel", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "compilerModule", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "babelJestTransformer", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCompiler", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "astTransformers", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCustomTransformers", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "hooks", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "filterDiagnostics", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "shouldReportDiagnostic", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "shouldStringifyContent", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "createTsError", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCacheDir", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "overriddenCompilerOptions", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "rootDir", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "cwd", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsJestDigest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "jsonValue", null);
return ConfigSet;
}());
exports.ConfigSet = ConfigSet;

View file

@ -0,0 +1,10 @@
import { Config } from '@jest/types';
export interface TsJestPresets {
transform: Config.InitialOptions['transform'];
testMatch?: string[];
moduleFileExtensions?: string[];
}
export interface CreateJestPresetOptions {
allowJs?: boolean;
}
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: Config.InitialOptions): TsJestPresets;

23
node_modules/ts-jest/dist/config/create-jest-preset.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("../util/logger");
var logger = logger_1.rootLogger.child({ namespace: 'jest-preset' });
function createJestPreset(_a, from) {
var _b;
var _c = (_a === void 0 ? {} : _a).allowJs, allowJs = _c === void 0 ? false : _c;
if (from === void 0) { from = {}; }
logger.debug({ allowJs: allowJs }, 'creating jest presets', allowJs ? 'handling' : 'not handling', 'JavaScript files');
return __assign(__assign({ transform: __assign(__assign({}, from.transform), (_b = {}, _b[allowJs ? '^.+\\.[tj]sx?$' : '^.+\\.tsx?$'] = 'ts-jest', _b)) }, (from.testMatch ? { testMatch: from.testMatch } : undefined)), (from.moduleFileExtensions ? { moduleFileExtensions: from.moduleFileExtensions } : undefined));
}
exports.createJestPreset = createJestPreset;

View file

@ -0,0 +1,5 @@
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
prefix?: string | undefined;
}) => {
[key: string]: string | string[];
} | undefined;

View file

@ -0,0 +1,63 @@
"use strict";
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var logger_1 = require("../util/logger");
var messages_1 = require("../util/messages");
var escapeRegex = function (str) { return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); };
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'path-mapper', _a));
exports.pathsToModuleNameMapper = function (mapping, _a) {
var e_1, _b;
var _c = (_a === void 0 ? {} : _a).prefix, prefix = _c === void 0 ? '' : _c;
var jestMap = {};
try {
for (var _d = __values(Object.keys(mapping)), _e = _d.next(); !_e.done; _e = _d.next()) {
var fromPath = _e.value;
var pattern = void 0;
var toPaths = mapping[fromPath];
if (toPaths.length === 0) {
logger.warn(messages_1.interpolate("Not mapping \"{{path}}\" because it has no target.", { path: fromPath }));
continue;
}
else if (toPaths.length > 1) {
logger.warn(messages_1.interpolate("Mapping only to first target of \"{{path}}\" because it has more than one ({{count}}).", {
path: fromPath,
count: toPaths.length,
}));
}
var target = toPaths[0];
var segments = fromPath.split(/\*/g);
if (segments.length === 1) {
pattern = "^" + escapeRegex(fromPath) + "$";
jestMap[pattern] = "" + prefix + target;
}
else if (segments.length === 2) {
pattern = "^" + escapeRegex(segments[0]) + "(.*)" + escapeRegex(segments[1]) + "$";
jestMap[pattern] = "" + prefix + target.replace(/\*/g, '$1');
}
else {
logger.warn(messages_1.interpolate("Not mapping \"{{path}}\" because it has more than one star (`*`).", { path: fromPath }));
continue;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
}
finally { if (e_1) throw e_1.error; }
}
return jestMap;
};

1
node_modules/ts-jest/dist/constants.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

8
node_modules/ts-jest/dist/constants.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LINE_FEED = '\n';
exports.EXTENSION_REGEX = /\.[^.]+$/;
exports.TS_TSX_REGEX = /\.tsx?$/;
exports.JS_JSX_REGEX = /\.jsx?$/;
exports.JSON_REGEX = /\.json$/i;
exports.DEFAULT_JEST_TEST_MATCH = ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'];

23
node_modules/ts-jest/dist/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,23 @@
import { createJestPreset as createJestPresetCore } from './config/create-jest-preset';
import { TsJestTransformer } from './ts-jest-transformer';
import { TsJestGlobalOptions } from './types';
import { mocked as mockedCore } from './util/testing';
declare module '@jest/types' {
namespace Config {
interface ConfigGlobals {
'ts-jest': TsJestGlobalOptions;
}
}
}
export declare const mocked: typeof mockedCore;
export declare const createJestPreset: typeof createJestPresetCore;
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
prefix?: string | undefined;
}) => {
[key: string]: string | string[];
} | undefined;
export declare const version: string;
export declare const digest: string;
export declare function createTransformer(baseConfig?: TsJestGlobalOptions): TsJestTransformer;
declare const jestPreset: import("./config/create-jest-preset").TsJestPresets;
export { jestPreset, };

74
node_modules/ts-jest/dist/index.js generated vendored Normal file
View file

@ -0,0 +1,74 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var fs_1 = require("fs");
var path_1 = require("path");
var create_jest_preset_1 = require("./config/create-jest-preset");
var paths_to_module_name_mapper_1 = require("./config/paths-to-module-name-mapper");
var ts_jest_transformer_1 = require("./ts-jest-transformer");
var logger_1 = require("./util/logger");
var messages_1 = require("./util/messages");
var testing_1 = require("./util/testing");
var version_checkers_1 = require("./util/version-checkers");
var warn = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.warn, _a));
var helperMoved = function (name, helper) {
return warn.wrap(messages_1.interpolate("The `{{helper}}` helper has been moved to `ts-jest/utils`. Use `import { {{helper}} } from 'ts-jest/utils'` instead.", { helper: name }), helper);
};
exports.mocked = helperMoved('mocked', testing_1.mocked);
exports.createJestPreset = helperMoved('createJestPreset', create_jest_preset_1.createJestPreset);
exports.pathsToModuleNameMapper = helperMoved('pathsToModuleNameMapper', paths_to_module_name_mapper_1.pathsToModuleNameMapper);
exports.version = require('../package.json').version;
exports.digest = fs_1.readFileSync(path_1.resolve(__dirname, '..', '.ts-jest-digest'), 'utf8');
var transformer;
function defaultTransformer() {
return transformer || (transformer = createTransformer());
}
function createTransformer(baseConfig) {
version_checkers_1.VersionCheckers.jest.warn();
return new ts_jest_transformer_1.TsJestTransformer(baseConfig);
}
exports.createTransformer = createTransformer;
function process() {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return (_a = defaultTransformer()).process.apply(_a, __spread(args));
}
exports.process = process;
function getCacheKey() {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return (_a = defaultTransformer()).getCacheKey.apply(_a, __spread(args));
}
exports.getCacheKey = getCacheKey;
exports.canInstrument = false;
var jestPreset = create_jest_preset_1.createJestPreset();
exports.jestPreset = jestPreset;
exports.__singleton = function () { return transformer; };
exports.__resetModule = function () { return (transformer = undefined); };

View file

@ -0,0 +1 @@
export {};

81
node_modules/ts-jest/dist/transformers/hoist-jest.js generated vendored Normal file
View file

@ -0,0 +1,81 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var HOIST_METHODS = ['mock', 'unmock', 'enableAutomock', 'disableAutomock', 'deepUnmock'];
exports.name = 'hoisting-jest-mock';
exports.version = 1;
function factory(cs) {
var logger = cs.logger.child({ namespace: 'ts-hoisting' });
var ts = cs.compilerModule;
function shouldHoistExpression(expression) {
return (ts.isCallExpression(expression) &&
ts.isPropertyAccessExpression(expression.expression) &&
HOIST_METHODS.includes(expression.expression.name.text) &&
((ts.isIdentifier(expression.expression.expression) && expression.expression.expression.text === 'jest') ||
shouldHoistExpression(expression.expression.expression)));
}
function shouldHoistNode(node) {
return ts.isExpressionStatement(node) && shouldHoistExpression(node.expression);
}
function createVisitor(ctx, _) {
var level = 0;
var hoisted = [];
var enter = function () {
level++;
if (hoisted[level]) {
hoisted[level].splice(0, hoisted[level].length);
}
};
var exit = function () { return level--; };
var hoist = function (node) {
if (hoisted[level]) {
hoisted[level].push(node);
}
else {
hoisted[level] = [node];
}
};
var visitor = function (node) {
enter();
var resultNode = ts.visitEachChild(node, visitor, ctx);
if (hoisted[level] && hoisted[level].length) {
var hoistedStmts_1 = hoisted[level];
var otherStmts = resultNode.statements.filter(function (s) { return !hoistedStmts_1.includes(s); });
var newNode = ts.getMutableClone(resultNode);
newNode.statements = ts.createNodeArray(__spread(hoistedStmts_1, otherStmts));
resultNode = newNode;
}
exit();
if (shouldHoistNode(resultNode)) {
hoist(resultNode);
}
return resultNode;
};
return visitor;
}
return function (ctx) {
var _a;
return logger.wrap((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.debug, _a.call = null, _a), 'visitSourceFileNode(): hoisting', function (sf) { return ts.visitNode(sf, createVisitor(ctx, sf)); });
};
}
exports.factory = factory;

1
node_modules/ts-jest/dist/transformers/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

4
node_modules/ts-jest/dist/transformers/index.js generated vendored Normal file
View file

@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var hoisting = require("./hoist-jest");
exports.internals = [hoisting];

13
node_modules/ts-jest/dist/ts-jest-transformer.d.ts generated vendored Normal file
View file

@ -0,0 +1,13 @@
import { CacheKeyOptions, TransformOptions, TransformedSource, Transformer } from '@jest/transform';
import { Config } from '@jest/types';
import { ConfigSet } from './config/config-set';
import { TsJestGlobalOptions } from './types';
export declare class TsJestTransformer implements Transformer {
private readonly logger;
private readonly id;
private readonly options;
constructor(baseOptions?: TsJestGlobalOptions);
configsFor(jestConfig: Config.ProjectConfig): ConfigSet;
process(input: string, filePath: Config.Path, jestConfig: Config.ProjectConfig, transformOptions?: TransformOptions): TransformedSource | string;
getCacheKey(fileContent: string, filePath: string, _jestConfigStr: string, transformOptions: CacheKeyOptions): string;
}

115
node_modules/ts-jest/dist/ts-jest-transformer.js generated vendored Normal file
View file

@ -0,0 +1,115 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("util");
var config_set_1 = require("./config/config-set");
var constants_1 = require("./constants");
var json_1 = require("./util/json");
var jsonable_value_1 = require("./util/jsonable-value");
var logger_1 = require("./util/logger");
var messages_1 = require("./util/messages");
var sha1_1 = require("./util/sha1");
var INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
var TsJestTransformer = (function () {
function TsJestTransformer(baseOptions) {
if (baseOptions === void 0) { baseOptions = {}; }
this.options = __assign({}, baseOptions);
this.id = TsJestTransformer._nextTransformerId;
this.logger = logger_1.rootLogger.child({
transformerId: this.id,
namespace: 'jest-transformer',
});
this.logger.debug({ baseOptions: baseOptions }, 'created new transformer');
}
Object.defineProperty(TsJestTransformer, "_nextTransformerId", {
get: function () {
return ++TsJestTransformer._lastTransformerId;
},
enumerable: true,
configurable: true
});
TsJestTransformer.prototype[INSPECT_CUSTOM] = function () {
return "[object TsJestTransformer<#" + this.id + ">]";
};
TsJestTransformer.prototype.configsFor = function (jestConfig) {
var csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.value === jestConfig; });
if (csi)
return csi.configSet;
var serialized = json_1.stringify(jestConfig);
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.serialized === serialized; });
if (csi) {
csi.jestConfig.value = jestConfig;
return csi.configSet;
}
var jestConfigObj = jestConfig;
this.logger.info('no matching config-set found, creating a new one');
var configSet = new config_set_1.ConfigSet(jestConfigObj, this.options, this.logger);
TsJestTransformer._configSetsIndex.push({
jestConfig: new jsonable_value_1.JsonableValue(jestConfigObj),
configSet: configSet,
});
return configSet;
};
TsJestTransformer.prototype.process = function (input, filePath, jestConfig, transformOptions) {
this.logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'processing', filePath);
var result;
var source = input;
var configs = this.configsFor(jestConfig);
var hooks = configs.hooks;
var stringify = configs.shouldStringifyContent(filePath);
var babelJest = stringify ? undefined : configs.babelJestTransformer;
var isDefinitionFile = filePath.endsWith('.d.ts');
var isJsFile = constants_1.JS_JSX_REGEX.test(filePath);
var isTsFile = !isDefinitionFile && constants_1.TS_TSX_REGEX.test(filePath);
if (stringify) {
result = "module.exports=" + JSON.stringify(source);
}
else if (isDefinitionFile) {
result = '';
}
else if (!configs.parsedTsConfig.options.allowJs && isJsFile) {
this.logger.warn({ fileName: filePath }, messages_1.interpolate("Got a `.js` file to compile while `allowJs` option is not set to `true` (file: {{path}}). To fix this:\n - if you want TypeScript to process JS files, set `allowJs` to `true` in your TypeScript config (usually tsconfig.json)\n - if you do not want TypeScript to process your `.js` files, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match `.js` files anymore", { path: filePath }));
result = source;
}
else if (isJsFile || isTsFile) {
result = configs.tsCompiler.compile(source, filePath);
}
else {
var message = babelJest ? "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore. If you still want Babel to process it, add another entry to the `transform` option with value `babel-jest` which key matches this type of files." : "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.";
this.logger.warn({ fileName: filePath }, messages_1.interpolate(message, { path: filePath }));
result = source;
}
if (babelJest) {
this.logger.debug({ fileName: filePath }, 'calling babel-jest processor');
result = babelJest.process(result, filePath, jestConfig, __assign(__assign({}, transformOptions), { instrument: false }));
}
if (hooks.afterProcess) {
this.logger.debug({ fileName: filePath, hookName: 'afterProcess' }, 'calling afterProcess hook');
var newResult = hooks.afterProcess([input, filePath, jestConfig, transformOptions], result);
if (newResult !== undefined) {
return newResult;
}
}
return result;
};
TsJestTransformer.prototype.getCacheKey = function (fileContent, filePath, _jestConfigStr, transformOptions) {
this.logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'computing cache key for', filePath);
var configs = this.configsFor(transformOptions.config);
var _a = transformOptions.instrument, instrument = _a === void 0 ? false : _a, _b = transformOptions.rootDir, rootDir = _b === void 0 ? configs.rootDir : _b;
return sha1_1.sha1(configs.cacheKey, '\x00', rootDir, '\x00', "instrument:" + (instrument ? 'on' : 'off'), '\x00', fileContent, '\x00', filePath);
};
TsJestTransformer._configSetsIndex = [];
TsJestTransformer._lastTransformerId = 0;
return TsJestTransformer;
}());
exports.TsJestTransformer = TsJestTransformer;

76
node_modules/ts-jest/dist/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,76 @@
import * as _ts from 'typescript';
export interface TsJestGlobalOptions {
tsConfig?: boolean | string | _ts.CompilerOptions;
tsconfig?: boolean | string | _ts.CompilerOptions;
packageJson?: boolean | string | object;
isolatedModules?: boolean;
compiler?: string;
astTransformers?: string[];
diagnostics?: boolean | {
pretty?: boolean;
ignoreCodes?: number | string | (number | string)[];
pathRegex?: RegExp | string;
warnOnly?: boolean;
};
babelConfig?: boolean | string | BabelConfig;
stringifyContentPathRegex?: string | RegExp;
}
interface TsJestConfig$tsConfig$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$tsConfig$inline {
kind: 'inline';
value: _ts.CompilerOptions;
}
declare type TsJestConfig$tsConfig = TsJestConfig$tsConfig$file | TsJestConfig$tsConfig$inline | undefined;
interface TsJestConfig$diagnostics {
pretty: boolean;
ignoreCodes: number[];
pathRegex?: string | undefined;
throws: boolean;
warnOnly?: boolean;
}
interface TsJestConfig$babelConfig$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$babelConfig$inline {
kind: 'inline';
value: BabelConfig;
}
declare type TsJestConfig$babelConfig = TsJestConfig$babelConfig$file | TsJestConfig$babelConfig$inline | undefined;
interface TsJestConfig$packageJson$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$packageJson$inline {
kind: 'inline';
value: any;
}
declare type TsJestConfig$packageJson = TsJestConfig$packageJson$file | TsJestConfig$packageJson$inline | undefined;
declare type TsJestConfig$stringifyContentPathRegex = string | undefined;
export interface TsJestConfig {
tsConfig: TsJestConfig$tsConfig;
packageJson: TsJestConfig$packageJson;
isolatedModules: boolean;
compiler: string;
diagnostics: TsJestConfig$diagnostics;
babelConfig: TsJestConfig$babelConfig;
transformers: string[];
stringifyContentPathRegex: TsJestConfig$stringifyContentPathRegex;
}
export interface TsCompiler {
program: _ts.Program | undefined;
}
export declare type TSFiles = Map<string, TSFile>;
export interface TSFile {
text?: string;
output?: string;
version: number;
projectReference?: {
project?: _ts.ResolvedProjectReference;
outputFileName?: string;
};
}
export {};

2
node_modules/ts-jest/dist/types.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

1
node_modules/ts-jest/dist/util/backports.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

101
node_modules/ts-jest/dist/util/backports.js generated vendored Normal file
View file

@ -0,0 +1,101 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var messages_1 = require("./messages");
var context = (_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'backports', _a);
exports.backportJestConfig = function (logger, config) {
logger.debug(__assign(__assign({}, context), { config: config }), 'backporting config');
var _a = (config || {}).globals, globals = _a === void 0 ? {} : _a;
var _b = globals["ts-jest"], tsJest = _b === void 0 ? {} : _b;
var mergeTsJest = {};
var hadWarnings = false;
var warnConfig = function (oldPath, newPath, note) {
hadWarnings = true;
logger.warn(context, messages_1.interpolate(note ? "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.\n \u21B3 {{note}}" : "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.", {
oldPath: oldPath,
newPath: newPath,
note: note,
}));
};
if ('__TS_CONFIG__' in globals) {
warnConfig('globals.__TS_CONFIG__', 'globals.ts-jest.tsConfig');
if (typeof globals.__TS_CONFIG__ === 'object') {
mergeTsJest.tsConfig = globals.__TS_CONFIG__;
}
delete globals.__TS_CONFIG__;
}
if ('__TRANSFORM_HTML__' in globals) {
warnConfig('globals.__TRANSFORM_HTML__', 'globals.ts-jest.stringifyContentPathRegex');
if (globals.__TRANSFORM_HTML__) {
mergeTsJest.stringifyContentPathRegex = '\\.html?$';
}
delete globals.__TRANSFORM_HTML__;
}
if ('typeCheck' in tsJest) {
warnConfig('globals.ts-jest.typeCheck', 'globals.ts-jest.isolatedModules');
mergeTsJest.isolatedModules = !tsJest.typeCheck;
delete tsJest.typeCheck;
}
if ('tsConfigFile' in tsJest) {
warnConfig('globals.ts-jest.tsConfigFile', 'globals.ts-jest.tsConfig');
if (tsJest.tsConfigFile) {
mergeTsJest.tsConfig = tsJest.tsConfigFile;
}
delete tsJest.tsConfigFile;
}
if ('enableTsDiagnostics' in tsJest) {
warnConfig('globals.ts-jest.enableTsDiagnostics', 'globals.ts-jest.diagnostics');
if (tsJest.enableTsDiagnostics) {
mergeTsJest.diagnostics = { warnOnly: true };
if (typeof tsJest.enableTsDiagnostics === 'string')
mergeTsJest.diagnostics.pathRegex = tsJest.enableTsDiagnostics;
}
else {
mergeTsJest.diagnostics = false;
}
delete tsJest.enableTsDiagnostics;
}
if ('useBabelrc' in tsJest) {
warnConfig('globals.ts-jest.useBabelrc', 'globals.ts-jest.babelConfig', "See `babel-jest` related issue: https://github.com/facebook/jest/issues/3845");
if (tsJest.useBabelrc != null) {
mergeTsJest.babelConfig = tsJest.useBabelrc ? true : {};
}
delete tsJest.useBabelrc;
}
if ('skipBabel' in tsJest) {
warnConfig('globals.ts-jest.skipBabel', 'globals.ts-jest.babelConfig');
if (tsJest.skipBabel === false && !mergeTsJest.babelConfig) {
mergeTsJest.babelConfig = true;
}
delete tsJest.skipBabel;
}
if (hadWarnings) {
logger.warn(context, "Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate <config-file>.");
}
return __assign(__assign({}, config), { globals: __assign(__assign({}, globals), { 'ts-jest': __assign(__assign({}, mergeTsJest), tsJest) }) });
};
exports.backportTsJestDebugEnvVar = function (logger) {
if ('TS_JEST_DEBUG' in process.env) {
var shouldLog = !/^\s*(?:0|f(?:alse)?|no?|disabled?|off|)\s*$/i.test(process.env.TS_JEST_DEBUG || '');
delete process.env.TS_JEST_DEBUG;
if (shouldLog) {
process.env.TS_JEST_LOG = 'ts-jest.log,stderr:warn';
}
logger.warn(context, messages_1.interpolate("Using env. var \"{{old}}\" is deprecated, use \"{{new}}\" instead.", {
old: 'TS_JEST_DEBUG',
new: 'TS_JEST_LOG',
}));
}
};

3
node_modules/ts-jest/dist/util/exported.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
export { mocked } from './testing';
export { createJestPreset } from '../config/create-jest-preset';
export { pathsToModuleNameMapper } from '../config/paths-to-module-name-mapper';

8
node_modules/ts-jest/dist/util/exported.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var testing_1 = require("./testing");
exports.mocked = testing_1.mocked;
var create_jest_preset_1 = require("../config/create-jest-preset");
exports.createJestPreset = create_jest_preset_1.createJestPreset;
var paths_to_module_name_mapper_1 = require("../config/paths-to-module-name-mapper");
exports.pathsToModuleNameMapper = paths_to_module_name_mapper_1.pathsToModuleNameMapper;

View file

@ -0,0 +1 @@
export {};

10
node_modules/ts-jest/dist/util/get-package-version.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getPackageVersion(moduleName) {
try {
return require(moduleName + "/package.json").version;
}
catch (err) { }
return;
}
exports.getPackageVersion = getPackageVersion;

1
node_modules/ts-jest/dist/util/importer.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

196
node_modules/ts-jest/dist/util/importer.js generated vendored Normal file
View file

@ -0,0 +1,196 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("./logger");
var memoize_1 = require("./memoize");
var messages_1 = require("./messages");
var version_checkers_1 = require("./version-checkers");
var logger = logger_1.rootLogger.child({ namespace: 'Importer' });
var passThru = function (action) { return function (input) {
action();
return input;
}; };
var Importer = (function () {
function Importer(_patches) {
if (_patches === void 0) { _patches = {}; }
this._patches = _patches;
}
Object.defineProperty(Importer, "instance", {
get: function () {
logger.debug('creating Importer singleton');
return new Importer({
'@babel/core': [passThru(version_checkers_1.VersionCheckers.babelCore.warn)],
'babel-jest': [passThru(version_checkers_1.VersionCheckers.babelJest.warn)],
typescript: [passThru(version_checkers_1.VersionCheckers.typescript.warn)],
jest: [passThru(version_checkers_1.VersionCheckers.jest.warn)],
});
},
enumerable: true,
configurable: true
});
Importer.prototype.babelJest = function (why) {
return this._import(why, 'babel-jest');
};
Importer.prototype.babelCore = function (why) {
return this._import(why, '@babel/core');
};
Importer.prototype.typescript = function (why, which) {
return this._import(why, which);
};
Importer.prototype.tryThese = function (moduleName) {
var fallbacks = [];
for (var _i = 1; _i < arguments.length; _i++) {
fallbacks[_i - 1] = arguments[_i];
}
var name;
var loaded;
var tries = __spread([moduleName], fallbacks);
while ((name = tries.shift()) !== undefined) {
var req = requireWrapper(name);
var contextReq = __assign({}, req);
delete contextReq.exports;
if (req.exists) {
loaded = req;
if (loaded.error) {
logger.error({ requireResult: contextReq }, "failed loading module '" + name + "'", loaded.error.message);
}
else {
logger.debug({ requireResult: contextReq }, 'loaded module', name);
loaded.exports = this._patch(name, loaded.exports);
}
break;
}
else {
logger.debug({ requireResult: contextReq }, "module '" + name + "' not found");
continue;
}
}
return loaded;
};
Importer.prototype.tryTheseOr = function (moduleNames, missingResult, allowLoadError) {
if (allowLoadError === void 0) { allowLoadError = false; }
var args = Array.isArray(moduleNames) ? moduleNames : [moduleNames];
var result = this.tryThese.apply(this, __spread(args));
if (!result)
return missingResult;
if (!result.error)
return result.exports;
if (allowLoadError)
return missingResult;
throw result.error;
};
Importer.prototype._patch = function (name, unpatched) {
if (name in this._patches) {
logger.debug('patching', name);
return this._patches[name].reduce(function (mod, patcher) { return patcher(mod); }, unpatched);
}
return unpatched;
};
Importer.prototype._import = function (why, moduleName, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.alternatives, alternatives = _c === void 0 ? [] : _c, _d = _b.installTip, installTip = _d === void 0 ? moduleName : _d;
var res = this.tryThese.apply(this, __spread([moduleName], alternatives));
if (res && res.exists) {
if (!res.error)
return res.exports;
throw new Error(messages_1.interpolate("Loading module {{module}} failed with error: {{error}}", { module: res.given, error: res.error.message }));
}
var msg = alternatives.length ? "Unable to load any of these modules: {{module}}. {{reason}}. To fix it:\n{{fix}}" : "Unable to load the module {{module}}. {{reason}} To fix it:\n{{fix}}";
var loadModule = __spread([moduleName], alternatives).map(function (m) { return "\"" + m + "\""; }).join(', ');
if (typeof installTip === 'string') {
installTip = [{ module: installTip, label: "install \"" + installTip + "\"" }];
}
var fix = installTip
.map(function (tip) { return " " + (installTip.length === 1 ? '↳' : '•') + " " + messages_1.interpolate("{{label}}: `npm i -D {{module}}` (or `yarn add --dev {{module}}`)", tip); })
.join('\n');
throw new Error(messages_1.interpolate(msg, {
module: loadModule,
reason: why,
fix: fix,
}));
};
__decorate([
memoize_1.Memoize(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return args.join(':');
})
], Importer.prototype, "tryThese", null);
__decorate([
memoize_1.Memoize(function (name) { return name; })
], Importer.prototype, "_patch", null);
__decorate([
memoize_1.Memoize()
], Importer, "instance", null);
return Importer;
}());
exports.Importer = Importer;
exports.importer = Importer.instance;
function requireWrapper(moduleName) {
var path;
var exists = false;
try {
path = resolveModule(moduleName);
exists = true;
}
catch (error) {
return { error: error, exists: exists, given: moduleName };
}
var result = { exists: exists, path: path, given: moduleName };
try {
result.exports = requireModule(path);
}
catch (error) {
try {
result.exports = requireModule(moduleName);
}
catch (error) {
result.error = error;
}
}
return result;
}
var requireModule = function (mod) { return require(mod); };
var resolveModule = function (mod) { return require.resolve(mod, { paths: [process.cwd(), __dirname] }); };
function __requireModule(localRequire, localResolve) {
requireModule = localRequire;
resolveModule = localResolve;
}
exports.__requireModule = __requireModule;

1
node_modules/ts-jest/dist/util/json.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

31
node_modules/ts-jest/dist/util/json.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var stableStringify = require("fast-json-stable-stringify");
var UNDEFINED = 'undefined';
function stringify(input) {
return input === undefined ? UNDEFINED : stableStringify(input);
}
exports.stringify = stringify;
function parse(input) {
return input === UNDEFINED ? undefined : JSON.parse(input);
}
exports.parse = parse;
function normalize(input, _a) {
var _b = (_a === void 0 ? {} : _a).parse, parser = _b === void 0 ? parse : _b;
var result;
if (normalize.cache.has(input)) {
result = normalize.cache.get(input);
}
else {
var data = parser(input);
result = stringify(data);
if (result === input)
result = undefined;
normalize.cache.set(input, result);
}
return result === undefined ? input : result;
}
exports.normalize = normalize;
(function (normalize) {
normalize.cache = new Map();
})(normalize = exports.normalize || (exports.normalize = {}));

1
node_modules/ts-jest/dist/util/jsonable-value.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

34
node_modules/ts-jest/dist/util/jsonable-value.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var json_1 = require("./json");
var JsonableValue = (function () {
function JsonableValue(value) {
this.value = value;
}
Object.defineProperty(JsonableValue.prototype, "value", {
get: function () {
return this._value;
},
set: function (value) {
this._value = value;
this._serialized = json_1.stringify(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(JsonableValue.prototype, "serialized", {
get: function () {
return this._serialized;
},
enumerable: true,
configurable: true
});
JsonableValue.prototype.valueOf = function () {
return this._value;
};
JsonableValue.prototype.toString = function () {
return this._serialized;
};
return JsonableValue;
}());
exports.JsonableValue = JsonableValue;

1
node_modules/ts-jest/dist/util/logger.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

21
node_modules/ts-jest/dist/util/logger.js generated vendored Normal file
View file

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var backports_1 = require("./backports");
var original = process.env.TS_JEST_LOG;
var buildOptions = function () {
var _a;
return ({
context: (_a = {},
_a[bs_logger_1.LogContexts.package] = 'ts-jest',
_a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace,
_a.version = require('../../package.json').version,
_a),
targets: process.env.TS_JEST_LOG || undefined,
});
};
exports.rootLogger = bs_logger_1.createLogger(buildOptions());
backports_1.backportTsJestDebugEnvVar(exports.rootLogger);
if (original !== process.env.TS_JEST_LOG) {
exports.rootLogger = bs_logger_1.createLogger(buildOptions());
}

1
node_modules/ts-jest/dist/util/memoize.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

47
node_modules/ts-jest/dist/util/memoize.js generated vendored Normal file
View file

@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cacheProp = Symbol.for('[memoize]');
function Memoize(keyBuilder) {
return function (_, propertyKey, descriptor) {
if (descriptor.value != null) {
descriptor.value = memoize(propertyKey, descriptor.value, keyBuilder || (function (v) { return v; }));
}
else if (descriptor.get != null) {
descriptor.get = memoize(propertyKey, descriptor.get, keyBuilder || (function () { return propertyKey; }));
}
};
}
exports.Memoize = Memoize;
function ensureCache(target, reset) {
if (reset === void 0) { reset = false; }
if (reset || !target[cacheProp]) {
Object.defineProperty(target, cacheProp, {
value: Object.create(null),
configurable: true,
});
}
return target[cacheProp];
}
function ensureChildCache(target, key, reset) {
if (reset === void 0) { reset = false; }
var dict = ensureCache(target);
if (reset || !dict[key]) {
dict[key] = new Map();
}
return dict[key];
}
function memoize(namespace, func, keyBuilder) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var cache = ensureChildCache(this, namespace);
var key = keyBuilder.apply(this, args);
if (cache.has(key))
return cache.get(key);
var res = func.apply(this, args);
cache.set(key, res);
return res;
};
}

1
node_modules/ts-jest/dist/util/messages.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

7
node_modules/ts-jest/dist/util/messages.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function interpolate(msg, vars) {
if (vars === void 0) { vars = {}; }
return msg.replace(/\{\{([^\}]+)\}\}/g, function (_, key) { return (key in vars ? vars[key] : _); });
}
exports.interpolate = interpolate;

View file

@ -0,0 +1 @@
export {};

6
node_modules/ts-jest/dist/util/normalize-slashes.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function normalizeSlashes(value) {
return value.replace(/\\/g, '/');
}
exports.normalizeSlashes = normalizeSlashes;

1
node_modules/ts-jest/dist/util/sha1.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

31
node_modules/ts-jest/dist/util/sha1.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var crypto_1 = require("crypto");
exports.cache = Object.create(null);
function sha1() {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
var canCache = data.length === 1 && typeof data[0] === 'string';
var cacheKey;
if (canCache) {
cacheKey = data[0];
if (cacheKey in exports.cache) {
return exports.cache[cacheKey];
}
}
var hash = crypto_1.createHash('sha1');
data.forEach(function (item) {
if (typeof item === 'string')
hash.update(item, 'utf8');
else
hash.update(item);
});
var res = hash.digest('hex').toString();
if (canCache) {
exports.cache[cacheKey] = res;
}
return res;
}
exports.sha1 = sha1;

34
node_modules/ts-jest/dist/util/testing.d.ts generated vendored Normal file
View file

@ -0,0 +1,34 @@
/// <reference types="jest" />
declare type MockableFunction = (...args: any[]) => any;
declare type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends MockableFunction ? K : never;
}[keyof T];
declare type PropertyKeysOf<T> = {
[K in keyof T]: T[K] extends MockableFunction ? never : K;
}[keyof T];
declare type ArgumentsOf<T> = T extends (...args: infer A) => any ? A : never;
declare type ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never;
interface MockWithArgs<T extends MockableFunction> extends jest.MockInstance<ReturnType<T>, ArgumentsOf<T>> {
new (...args: ConstructorArgumentsOf<T>): T;
(...args: ArgumentsOf<T>): ReturnType<T>;
}
declare type MaybeMockedConstructor<T> = T extends new (...args: any[]) => infer R ? jest.MockInstance<R, ConstructorArgumentsOf<T>> : {};
declare type MockedFunction<T extends MockableFunction> = MockWithArgs<T> & {
[K in keyof T]: T[K];
};
declare type MockedFunctionDeep<T extends MockableFunction> = MockWithArgs<T> & MockedObjectDeep<T>;
declare type MockedObject<T> = MaybeMockedConstructor<T> & {
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunction<T[K]> : T[K];
} & {
[K in PropertyKeysOf<T>]: T[K];
};
declare type MockedObjectDeep<T> = MaybeMockedConstructor<T> & {
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunctionDeep<T[K]> : T[K];
} & {
[K in PropertyKeysOf<T>]: MaybeMockedDeep<T[K]>;
};
export declare type MaybeMockedDeep<T> = T extends MockableFunction ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;
export declare type MaybeMocked<T> = T extends MockableFunction ? MockedFunction<T> : T extends object ? MockedObject<T> : T;
export declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
export declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
export {};

7
node_modules/ts-jest/dist/util/testing.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function mocked(item, _deep) {
if (_deep === void 0) { _deep = false; }
return item;
}
exports.mocked = mocked;

1
node_modules/ts-jest/dist/util/ts-error.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

40
node_modules/ts-jest/dist/util/ts-error.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var make_error_1 = require("make-error");
var util_1 = require("util");
var logger_1 = require("./logger");
var messages_1 = require("./messages");
var logger = logger_1.rootLogger.child({ namespace: 'TSError' });
exports.INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
var TSError = (function (_super) {
__extends(TSError, _super);
function TSError(diagnosticText, diagnosticCodes) {
var _this = _super.call(this, messages_1.interpolate("{{diagnostics}}", {
diagnostics: diagnosticText.trim(),
})) || this;
_this.diagnosticText = diagnosticText;
_this.diagnosticCodes = diagnosticCodes;
_this.name = 'TSError';
logger.debug({ diagnosticCodes: diagnosticCodes, diagnosticText: diagnosticText }, 'created new TSError');
Object.defineProperty(_this, 'stack', { value: '' });
return _this;
}
TSError.prototype[exports.INSPECT_CUSTOM] = function () {
return this.diagnosticText;
};
return TSError;
}(make_error_1.BaseError));
exports.TSError = TSError;

1
node_modules/ts-jest/dist/util/version-checkers.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

56
node_modules/ts-jest/dist/util/version-checkers.js generated vendored Normal file
View file

@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var semver_1 = require("semver");
var get_package_version_1 = require("./get-package-version");
var logger_1 = require("./logger");
var messages_1 = require("./messages");
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
exports.VersionCheckers = {
jest: createVersionChecker('jest', ">=25 <26"),
typescript: createVersionChecker('typescript', ">=3.4 <4"),
babelJest: createVersionChecker('babel-jest', ">=25 <26"),
babelCore: createVersionChecker('@babel/core', ">=7.0.0-beta.0 <8"),
};
function checkVersion(name, expectedRange, action) {
if (action === void 0) { action = 'warn'; }
var version = get_package_version_1.getPackageVersion(name);
var success = !!version && semver_1.satisfies(version, expectedRange);
logger.debug({
actualVersion: version,
expectedVersion: expectedRange,
}, 'checking version of %s: %s', name, success ? 'OK' : 'NOT OK');
if (!action || success)
return success;
var message = messages_1.interpolate(version ? "Version {{actualVersion}} of {{module}} installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version ({{expectedVersion}}). Please do not report issues in ts-jest if you are using unsupported versions." : "Module {{module}} is not installed. If you're experiencing issues, consider installing a supported version ({{expectedVersion}}).", {
module: name,
actualVersion: version || '??',
expectedVersion: rangeToHumanString(expectedRange),
});
if (action === 'warn') {
logger.warn(message);
}
else if (action === 'throw') {
logger.fatal(message);
throw new RangeError(message);
}
return success;
}
function rangeToHumanString(versionRange) {
return new semver_1.Range(versionRange).toString();
}
function createVersionChecker(moduleName, expectedVersion) {
var memo;
var warn = function () {
if (memo !== undefined)
return memo;
return (memo = checkVersion(moduleName, expectedVersion, 'warn'));
};
var raise = function () { return checkVersion(moduleName, expectedVersion, 'throw'); };
return {
raise: raise,
warn: warn,
forget: function () {
memo = undefined;
},
};
}

1
node_modules/ts-jest/jest-preset.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./presets/default/jest-preset')

139
node_modules/ts-jest/package.json generated vendored Normal file
View file

@ -0,0 +1,139 @@
{
"name": "ts-jest",
"version": "25.5.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": "cli.js",
"description": "A preprocessor with source maps support to help use TypeScript with Jest",
"scripts": {
"prebuild": "node scripts/clean-dist.js",
"build": "tsc -p tsconfig.build.json",
"postbuild": "node scripts/post-build.js",
"build:watch": "tsc -p tsconfig.build.json -w",
"clean": "node scripts/clean.js",
"pretest": "npm run lint",
"test": "run-s -s test:e2e \"test:unit -- {@}\" --",
"test:prepare": "npm run test:e2e -- --prepareOnly",
"test:e2e": "node scripts/e2e.js",
"test:e2e:update-snaphots": "node scripts/e2e.js --updateSnapshot",
"test:unit": "node_modules/.bin/jest",
"test:external": "node scripts/test-external-project.js",
"test:external-repos": "npm run test:external external-repos",
"lint": "node_modules/.bin/eslint --ext .js,.ts .",
"lint:fix": "node_modules/.bin/eslint --fix --ext .js,.ts .",
"typecheck": "node_modules/.bin/tsc -p .",
"doc": "cd docs && bundle exec jekyll serve --livereload",
"doc:link": "git worktree add docs/_site gh-pages",
"doc:unlink": "git worktree prune",
"doc:build": "cd docs && bundle exec jekyll build",
"doc:build-commit": "npm run doc:build && cd docs/_site && git add --all && git commit -m \"Updates github pages\"",
"changelog": "node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"prepare": "npm run build",
"prepublishOnly": "npm run test",
"preversion": "npm run test",
"update:e2e": "node scripts/update-e2e-templates.js",
"version": "npm run changelog && git add CHANGELOG.md"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kulshekhar/ts-jest.git"
},
"keywords": [
"jest",
"typescript",
"sourcemap",
"react",
"testing"
],
"author": "Kulshekhar Kabra <kulshekhar@users.noreply.github.com> (https://github.com/kulshekhar)",
"contributors": [
"Huafu Gandon <huafu.gandon@gmail.com> (https://github.com/huafu)",
"Anh Pham <anhpnnd@gmail.com> (https://github.com/ahnpnl)",
"Gustav Wengel <gustavwengel@gmail.com> (https://github.com/GeeWee)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/kulshekhar/ts-jest/issues"
},
"homepage": "https://kulshekhar.github.io/ts-jest",
"dependencies": {
"bs-logger": "0.x",
"buffer-from": "1.x",
"fast-json-stable-stringify": "2.x",
"json5": "2.x",
"lodash.memoize": "4.x",
"make-error": "1.x",
"micromatch": "4.x",
"mkdirp": "0.x",
"semver": "6.x",
"yargs-parser": "18.x"
},
"peerDependencies": {
"jest": ">=25 <26",
"typescript": ">=3.4 <4.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-commit": "git reset"
}
},
"devDependencies": {
"@commitlint/cli": "8.x",
"@commitlint/config-conventional": "8.x",
"@jest/transform": "25.x",
"@jest/types": "25.x",
"@types/babel__core": "7.x",
"@types/buffer-from": "latest",
"@types/cross-spawn": "latest",
"@types/fs-extra": "latest",
"@types/jest": "25.x",
"@types/js-yaml": "latest",
"@types/json5": "latest",
"@types/lodash.memoize": "4.x",
"@types/lodash.merge": "4.x",
"@types/lodash.set": "4.x",
"@types/micromatch": "4.x",
"@types/mkdirp": "latest",
"@types/node": "10.x",
"@types/react": "16.x",
"@types/semver": "latest",
"@types/yargs": "latest",
"@types/yargs-parser": "15.x",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"conventional-changelog-cli": "2.x",
"cross-spawn": "latest",
"eslint": "latest",
"eslint-config-prettier": "latest",
"eslint-plugin-jest": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prettier": "latest",
"fs-extra": "8.x",
"glob-gitignore": "latest",
"husky": "3.x",
"jest": "25.x",
"js-yaml": "latest",
"lint-staged": "latest",
"lodash.merge": "4.x",
"lodash.set": "4.x",
"npm-run-all": "latest",
"prettier": "1.x",
"source-map": "latest",
"typescript": "3.x"
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",
"git add"
],
"*.{js,jsx}": [
"eslint --fix",
"git add"
]
},
"engines": {
"node": ">= 8"
}
}

8
node_modules/ts-jest/preprocessor.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
// eslint-disable-next-line no-console
console.warn(
'ts-jest[main] (WARN) Replace any occurrences of "ts-jest/dist/preprocessor.js" or ' +
' "<rootDir>/node_modules/ts-jest/preprocessor.js"' +
' in the \'transform\' section of your Jest config with just "ts-jest".'
)
module.exports = require('./dist')

1
node_modules/ts-jest/presets/create.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/config/create-jest-preset').createJestPreset

1
node_modules/ts-jest/presets/default/jest-preset.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('..').defaults

5
node_modules/ts-jest/presets/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,5 @@
import { TsJestPresets } from '../dist/config/create-jest-preset'
export const defaults: TsJestPresets
export const jsWithTs: TsJestPresets
export const jsWithBabel: TsJestPresets

20
node_modules/ts-jest/presets/index.js generated vendored Normal file
View file

@ -0,0 +1,20 @@
const create = require('./create')
module.exports = {
get defaults() {
return create()
},
get jsWithTs() {
return create({ allowJs: true })
},
get jsWithBabel() {
return create(
{ allowJs: false },
{
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
}
)
},
}

View file

@ -0,0 +1 @@
module.exports = require('..').jsWithBabel

View file

@ -0,0 +1 @@
module.exports = require('..').jsWithTs

1
node_modules/ts-jest/utils/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export * from '../dist/util/exported'

1
node_modules/ts-jest/utils/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/util/exported')