Skip to content

Commit

Permalink
chore: jsdom15 and enable serialzier
Browse files Browse the repository at this point in the history
namely
* update default jsdom enviroment to v15
* enable AngularNoNgAttributesSnapshotSerializer by default
* use better reference of astTransformers (always in preset instead of
relative) to avoid user confusion in README
  • Loading branch information
wtho committed Oct 2, 2019
1 parent 24045bc commit cefe9b9
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 402 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
* (**BREAKING**): Restructure project with `src` and `build` folder ([#307](https://github.com/thymikee/jest-preset-angular/pull/307)).
* (**BREAKING**): Support `tsconfig.spec.json` in root folder by default ([#309](https://github.com/thymikee/jest-preset-angular/pull/309)).
* (**BREAKING**): Remove `core-js` peer dependency and instead add it as direct dependency ([#311](https://github.com/thymikee/jest-preset-angular/pull/309)).
* (**BREAKING**): Enable AngularNoAngularNoNgAttributesSnapshotSerializer (created in [#97](https://github.com/thymikee/jest-preset-angular/pull/97)) by default ([#318](https://github.com/thymikee/jest-preset-angular/pull/318)).

#### Chore && Maintenance
* Update example app to match Angular 8 Boilerplate ([#311](https://github.com/thymikee/jest-preset-angular/pull/309)).
* Update jsdom to current version 15 ([#318](https://github.com/thymikee/jest-preset-angular/pull/318)).

#### Migration Guide
* If the `astTransformers` are referenced in a custom `jest` config, `[ 'jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer']` have to be set instead.
Expand Down Expand Up @@ -42,7 +44,7 @@
#### Migration Guide

* If `global` and `transform` are not set in your configuration in `jest.config.json`, `jest.config.js` or `package.json`, you are done.
* If the `global` value of the configuration was overriden, adjust
* If the `global` value of the configuration was overridden, adjust
* The option `"__TRANSFORM_HTML__": true` is not required anymore. Instead the `"stringifyContentPathRegex": "\\.html$"` should be used inside the `ts-jest`-configuration.
* Change the assignment identifier from `tsConfigFile` to `tsConfig`.
* Add the `astTransformers: [require.resolve('jest-preset-angular/InlineHtmlStripStylesTransformer')]` so Jest can work with `templateUrl`-assignments in Component decorators.
Expand Down Expand Up @@ -71,7 +73,7 @@

### v5.2.2

* Fix: specify angular modules as peerDependancies ([#141](https://github.com/thymikee/jest-preset-angular/pull/141))
* Fix: specify angular modules as peerDependencies ([#141](https://github.com/thymikee/jest-preset-angular/pull/141))
* Fix: update `STYLE_URLS_REGEX` to not break on multiple new lines ([#139](https://github.com/thymikee/jest-preset-angular/pull/139))
* Docs: add more troubleshooting docs ([#129](https://github.com/thymikee/jest-preset-angular/pull/129))

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ module.exports = {
tsConfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: [
require.resolve('./build/InlineFilesTransformer'),
require.resolve('./build/StripStylesTransformer')
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer'
],
},
},
Expand Down Expand Up @@ -465,7 +465,7 @@ Reference: https://github.com/facebook/jest/issues/708

### Failing with Node v7 or lower

By default we use JSDOM v13, which requires Node v8+. If you want to use Node in a lower version to run your tests, make sure to configure jest to use an older JSDOM version, either in your `jest.config.js`, `jest.config.json` or `package.json`:
By default we use JSDOM v15, which requires Node v8+. If you want to use Node in a lower version to run your tests, make sure to configure jest to use an older JSDOM version, either in your `jest.config.js`, `jest.config.json` or `package.json`:

```json
"testEnvironment": "jsdom"
Expand Down
Loading

0 comments on commit cefe9b9

Please sign in to comment.