diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d15679a82..8c73b61510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Changelog (master) * Feature: Simplify installation by adding @types/jest as a package dependency ([#116](https://github.com/thymikee/jest-preset-angular/pull/116)) * Chore: Upgrade example app to Angular 5.2 using Angular CLI 1.6 ([#116](https://github.com/thymikee/jest-preset-angular/pull/116)) +* Docs: Add a configuration section with vendor libraries like jQuery ([#117](https://github.com/thymikee/jest-preset-angular/pull/117)) ### v5.0.0 * Breaking: Upgrade Jest to 22 ([#109](https://github.com/thymikee/jest-preset-angular/pull/109)) diff --git a/README.md b/README.md index d2e8055f0d..86a2d3a752 100644 --- a/README.md +++ b/README.md @@ -224,3 +224,22 @@ import 'rxjs/add/operator/catch'; import './jestGlobalMocks'; ``` + +### Allow vendor libraries like jQuery, etc... + +The same like normal Jest configuration, you can load jQuery in your Jest setup file. For example your Jest setup file is `setupJest.ts` you can declare jQuery: + +``` +window.$ = require('path/to/jquery'); +`` + +or + +``` +import $ from 'jquery'; +global.$ = global.jQuery = $; +``` + + The same declaration can be applied to other vendor libraries. + + Reference: https://github.com/facebook/jest/issues/708