Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kibertoad/ts-jest into je…
Browse files Browse the repository at this point in the history
…st25

� Conflicts:
�	e2e/__templates__/default/package-lock.json
�	e2e/__templates__/default/package.json
�	e2e/__templates__/with-babel-7/package-lock.json
�	e2e/__templates__/with-babel-7/package.json
�	e2e/__templates__/with-typescript-2-7/package-lock.json
�	e2e/__templates__/with-typescript-2-7/package.json
�	e2e/__templates__/with-unsupported-version/package-lock.json
�	e2e/__templates__/with-unsupported-version/package.json
�	package-lock.json
  • Loading branch information
Igor Savin committed Jan 22, 2020
2 parents 111b305 + 9255e9b commit 308fb72
Show file tree
Hide file tree
Showing 51 changed files with 10,829 additions and 6,977 deletions.
56 changes: 39 additions & 17 deletions CHANGELOG.md
@@ -1,3 +1,25 @@
<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

* typescript serviceHost cache miss on Windows operating systems ([26ee731](https://github.com/kulshekhar/ts-jest/commit/26ee731))
* **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))



<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)

Expand Down Expand Up @@ -218,26 +240,29 @@

### Bug Fixes

* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
* **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))
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
* 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))
* **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))
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
* 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))
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
* 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:** 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
Expand All @@ -264,6 +289,7 @@
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
* 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))
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
Expand All @@ -280,27 +306,23 @@
* **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))
* 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)
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
* **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))
* 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))
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))


### Performance Improvements

* do not hash cache key, jest does it underneath ([fbe4f1f](https://github.com/kulshekhar/ts-jest/commit/fbe4f1f))
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))



Expand Down
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ It supports all features of TypeScript including type-checking. [Read more about

[<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/ts-jest-slack)
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://join.slack.com/t/ts-jest/shared_invite/enQtNDE1ODQ0OTEzMTczLWI5NTQ4ZmEzOTYxYzM2NjhiZDM2ZTI3MGYyYjA2Y2E1YTMxMjUyYTcxNTlmNjAyZTc2Nzk4YTRmZmRhYmZmYTg)

<!--
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
Expand Down Expand Up @@ -57,6 +57,10 @@ We **DO NOT** use [SemVer](http://semver.org/) for versioning. Though you can th

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
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Expand Up @@ -228,7 +228,7 @@ GEM
ruby-enum (0.7.2)
i18n
ruby_dep (1.5.0)
rubyzip (1.2.2)
rubyzip (2.0.0)
safe_yaml (1.0.4)
sass (3.5.7)
sass-listen (~> 4.0.0)
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Expand Up @@ -51,6 +51,10 @@ Please make sure to pin your version of `ts-jest` to a specific version if this

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](https:/github.com/kulshekhar/ts-jest/LICENSE.md) file for details
20 changes: 15 additions & 5 deletions docs/user/config/babelConfig.md
Expand Up @@ -7,7 +7,7 @@ title: Babel Config option
The option is `babelConfig` and it works pretty much as the `tsConfig` option, except that it is disabled by default. Here is the possible values it can take:

- `false`: the default, disables the use of Babel
- `true`: enables Babel processing. `ts-jest` will try to find a `.babelrc`, `.babelrc.js` file or a `babel` section in the `package.json` file of your project and use it as the config to pass to `babel-jest` processor.
- `true`: enables Babel processing. `ts-jest` will try to find a `.babelrc`, `.babelrc.js`, `babel.config.js` file or a `babel` section in the `package.json` file of your project and use it as the config to pass to `babel-jest` processor.
- `{ ... }`: inline [Babel options](https://babeljs.io/docs/en/next/options). You can also set this to an empty object (`{}`) so that the default Babel config file is not used.

### Examples
Expand All @@ -30,7 +30,7 @@ module.exports = {

</div><div class="col-md-6" markdown="block">

```js
```json5
// OR package.json
{
// [...]
Expand Down Expand Up @@ -63,10 +63,20 @@ module.exports = {
}
};
```

```js
// OR jest.config.js with require for babelrc
module.exports = {
// [...]
globals: {
'ts-jest': {
babelConfig: require('./babelrc.test.js'),
}
}
};
```
</div><div class="col-md-6" markdown="block">

```js
```json5
// OR package.json
{
// [...]
Expand Down Expand Up @@ -105,7 +115,7 @@ module.exports = {

</div><div class="col-md-6" markdown="block">

```js
```json5
// OR package.json
{
// [...]
Expand Down
4 changes: 4 additions & 0 deletions e2e/__cases__/enum/constants.ts
@@ -0,0 +1,4 @@
export enum MyEnum {
one = 'ONE',
two = 'TWO',
}
6 changes: 6 additions & 0 deletions e2e/__cases__/enum/enum.spec.ts
@@ -0,0 +1,6 @@
import { MyEnum } from './constants'

it('should pass', () => {
expect(MyEnum.one).toBe('ONE')
expect(MyEnum.two).toBe('TWO')
})
5 changes: 3 additions & 2 deletions e2e/__helpers__/templates.ts
@@ -1,9 +1,10 @@
export enum PackageSets {
default = 'default',
babel7 = 'with-babel-7',
babel7StringConfig = 'with-babel-7-string-config',
typescript2_7 = 'with-typescript-2-7',
// invalid
unsupportedVersion = 'with-unsupported-version',
}
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.typescript2_7]
export const allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.typescript2_7]
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
export const allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
33 changes: 15 additions & 18 deletions e2e/__helpers__/test-case/run-descriptor.ts
Expand Up @@ -75,24 +75,21 @@ export default class RunDescriptor {
if (!templates.every((t, i) => templates.indexOf(t, i + 1) === -1)) {
throw new Error(`Each template must be unique. Given ${templates.join(', ')}`)
}
return templates.reduce(
(map, template) => {
const desc = new RunDescriptor(this.name, {
...this._options,
template,
})
const runTest = () => {
return (map[template] = desc.run(expectedStatus))
}
if (iterator) {
iterator(runTest, createIteratorContext(template, expectedStatus))
} else {
runTest()
}
return map
},
{} as TestRunResultsMap<T>,
)
return templates.reduce((map, template) => {
const desc = new RunDescriptor(this.name, {
...this._options,
template,
})
const runTest = () => {
return (map[template] = desc.run(expectedStatus))
}
if (iterator) {
iterator(runTest, createIteratorContext(template, expectedStatus))
} else {
runTest()
}
return map
}, {} as TestRunResultsMap<T>)
}
}

Expand Down

0 comments on commit 308fb72

Please sign in to comment.