diff --git a/README.md b/README.md index 5519d11d98..fccb53a62b 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,13 @@ please check [online documentation](https://thymikee.github.io/jest-preset-angul Install using [`yarn`](https://yarnpkg.com/en/package/jest-preset-angular): ```bash -yarn add -D jest jest-preset-angular +yarn add -D jest jest-preset-angular @types/jest ``` Or [`npm`](https://www.npmjs.com/package/jest-preset-angular): ```bash -npm install -D jest jest-preset-angular +npm install -D jest jest-preset-angular @types/jest ``` ## Configuration @@ -59,11 +59,32 @@ module.exports = { } ``` +Adjust your `tsconfig.spec.json` to be: + +```json +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": ["jest"] + }, + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] +} +``` + +## Angular Ivy + +Check out our [Angular Ivy guidance](https://thymikee.github.io/jest-preset-angular/docs/guides/angular-ivy) + +## Example apps + +We have [example apps](https://github.com/thymikee/jest-preset-angular/tree/master/examples) to provide a basic setup to use Jest in an Angular project. + ## Built With - [TypeScript](https://www.typescriptlang.org/) - JavaScript that scales - [Angular](https://angular.io/) - The modern web developer's platform -- [`ts-jest`](https://kulshekhar.github.io/ts-jest) - Jest processor for TypeScript +- [`ts-jest`](https://kulshekhar.github.io/ts-jest) - Jest transformer for TypeScript ## Authors/maintainers diff --git a/examples/example-app-v10/package.json b/examples/example-app-v10/package.json index 6945b59a15..600c14830d 100644 --- a/examples/example-app-v10/package.json +++ b/examples/example-app-v10/package.json @@ -1,5 +1,5 @@ { - "name": "example-app-v11", + "name": "example-app-v10", "version": "0.0.0", "scripts": { "ng": "ng", @@ -33,4 +33,4 @@ "ts-node": "^9.1.1", "typescript": "~4.0.7" } -} \ No newline at end of file +} diff --git a/examples/example-app-v10/tsconfig.spec.json b/examples/example-app-v10/tsconfig.spec.json index 7e7d10a30e..3dbb4a98aa 100644 --- a/examples/example-app-v10/tsconfig.spec.json +++ b/examples/example-app-v10/tsconfig.spec.json @@ -8,9 +8,6 @@ "jest" ] }, - "files": [ - "src/polyfills.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/examples/example-app-v11/tsconfig.spec.json b/examples/example-app-v11/tsconfig.spec.json index 7e7d10a30e..3dbb4a98aa 100644 --- a/examples/example-app-v11/tsconfig.spec.json +++ b/examples/example-app-v11/tsconfig.spec.json @@ -8,9 +8,6 @@ "jest" ] }, - "files": [ - "src/polyfills.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/examples/example-app-v9/tsconfig.spec.json b/examples/example-app-v9/tsconfig.spec.json index 7e7d10a30e..3dbb4a98aa 100644 --- a/examples/example-app-v9/tsconfig.spec.json +++ b/examples/example-app-v9/tsconfig.spec.json @@ -8,9 +8,6 @@ "jest" ] }, - "files": [ - "src/polyfills.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" diff --git a/website/docs/getting-started/installation.md b/website/docs/getting-started/installation.md index df6e49f5e6..6a089530ed 100644 --- a/website/docs/getting-started/installation.md +++ b/website/docs/getting-started/installation.md @@ -10,13 +10,13 @@ You can install `jest-preset-angular` and dependencies all at once with one of t #### NPM ```sh -npm install -D jest jest-preset-angular +npm install -D jest jest-preset-angular @types/jest ``` #### Yarn ```sh -yarn add -D jest jest-preset-angular +yarn add -D jest jest-preset-angular @types/jest ``` ### Configuration @@ -50,6 +50,19 @@ module.exports = { } ``` +Adjust your `tsconfig.spec.json` to be: + +```json +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": ["jest"] + }, + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] +} +``` + ### Customizing #### Global mocks diff --git a/website/versioned_docs/version-8.x/getting-started/installation.md b/website/versioned_docs/version-8.x/getting-started/installation.md index df6e49f5e6..6a089530ed 100644 --- a/website/versioned_docs/version-8.x/getting-started/installation.md +++ b/website/versioned_docs/version-8.x/getting-started/installation.md @@ -10,13 +10,13 @@ You can install `jest-preset-angular` and dependencies all at once with one of t #### NPM ```sh -npm install -D jest jest-preset-angular +npm install -D jest jest-preset-angular @types/jest ``` #### Yarn ```sh -yarn add -D jest jest-preset-angular +yarn add -D jest jest-preset-angular @types/jest ``` ### Configuration @@ -50,6 +50,19 @@ module.exports = { } ``` +Adjust your `tsconfig.spec.json` to be: + +```json +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": ["jest"] + }, + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] +} +``` + ### Customizing #### Global mocks