{"_id":"@danielsogl/jest-schematic","_rev":"1-f8cc14f306662be905fbdd83762ea48d","name":"@danielsogl/jest-schematic","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"@danielsogl/jest-schematic","version":"4.0.0","description":"Schematic to add jest to an Angular CLI project","repository":{"type":"git","url":"git+https://github.com/danielsogl/jest-schematic.git"},"bugs":{"url":"https://github.com/danielsogl/jest-schematic/issues"},"homepage":"https://github.com/danielsogl/jest-schematic","main":"src/jest/index.js","scripts":{"build":"tsc -p tsconfig.json","reset":"ts-node --project=./scripts/tsconfig.json ./scripts/e2e.ts","test":"ts-node --project=./scripts/tsconfig.json ./scripts/e2e.ts","test:single":"yarn test single","test:workspace":"yarn test workspace","test:reset":"yarn test reset","release":"np"},"keywords":["schematics","jest-schematic","jest","angular"],"author":{"name":"Daniel Sogl"},"license":"MIT","schematics":"./src/collection.json","dependencies":{"@angular-devkit/core":"^12.0.0","@angular-devkit/schematics":"^12.0.0","@schematics/angular":"^12.0.0","@schuchard/schematics-core":"^0.4.1","rxjs":"6.5.5"},"publishConfig":{"access":"public"},"devDependencies":{"@types/jasmine":"^3.7.4","@types/node":"^12.20.13","@types/shelljs":"^0.8.8","husky":"^4.3.8","jasmine":"^3.7.0","lint-staged":"^11.0.0","np":"^7.5.0","prettier":"^2.3.0","shelljs":"^0.8.4","ts-node":"^9.1.1","typescript":"^4.2.4"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,json,md,ts}":["prettier --write"]},"prettier":{"printWidth":100,"tabWidth":2,"semi":true,"singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"arrowParens":"always"},"np":{"anyBranch":true},"gitHead":"da5c28bf5ebba690aaf0ce20668ab1f08c258aef","_id":"@danielsogl/jest-schematic@4.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-QoaM1CZbSoJZ3UTsKpl+zIS1PQXmSalcRNUwQDaxs+Fn/5LVwPyjfEzomyJlvDfsKrM/Kpn8KkYRqlWqxVbDkw==","shasum":"78fa091db57e17a7d01232487fb1a754f6db9a73","tarball":"https://registry.npmjs.org/@danielsogl/jest-schematic/-/jest-schematic-4.0.0.tgz","fileCount":72,"unpackedSize":1076002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgntw7CRA9TVsSAnZWagAA9X4P/3iA2FCBOxonbhuWZavB\nhKpSRoKpec8J5uOLiFEEUlVYB5RJQzC4MFSDlFRopKshWdCP2n55WOydJ3SX\n/hNv5WJM+3ch48zcP/YfdwLJ4qaEM5a15PMcJXxAm4wJ2Z5RgE13AKfPS3wm\n7k2SMM64Tsj8nCooYuhw+SbC0MzL+rdzy8YpJC0rIy0HP2/70oz6fy3ICrDz\nt/i+eWVLP6ctDzRaHP+H4eJeO+Rwc0ohnpvnzSU6WH3TynGBX3nnE0/l8Met\nnCSkjLAwcv2ZtlQzXrzVBWP+SPjlNrzl8uHZSI8mZKRWYNSLDMMcoaIUb+Gf\nczjSK4tiMlCNahxqkcLaVnOQVb3FEKMSfU+k5FnBZwKL6e4y/7lVM8p0jh+G\nWpb9cWnoYxVcqKchzXL58MdyO06kkFOxvkNAh6OfDeQcgGofuNbxslDVllYx\nIRE0abz690e6dXb+Apr9FPNNmylLULYGdOg1EjaVB3LlIIXIP2+SqF8Zy9Ib\nv+V1i2+iw+tweg1Pw9vm+YI6+ea49QZOA0T3NB4oLW7w/Y1kT0mbt4fdaNW+\nZqtgyqBTHK5icjd16dwDd3jRejbfVhCaDHglhdpKzrIqhcqgdH7lewg6SGBS\natG9g7NZsX/FMSdEXJdkI6/vf17OF7xyRUa/Q/ia5fySzxNbo0rXNfcGpF6u\ni5Zb\r\n=ut7O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICybU57x559Oz0ebyD4Lh4ERK40dNQPMq0xX7KLuCqx4AiEAou4Ge2+QFdRX8BgT0lve1wQZrEY+Wl35IMlC7XYoV74="}]},"_npmUser":{"name":"danielsogl","email":"mytechde@outlook.com"},"directories":{},"maintainers":[{"name":"danielsogl","email":"mytechde@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-schematic_4.0.0_1621023803336_0.89048616792191"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-14T20:23:23.278Z","4.0.0":"2021-05-14T20:23:23.557Z","modified":"2022-04-05T02:41:31.884Z"},"maintainers":[{"name":"danielsogl","email":"mytechde@outlook.com"}],"description":"Schematic to add jest to an Angular CLI project","homepage":"https://github.com/danielsogl/jest-schematic","keywords":["schematics","jest-schematic","jest","angular"],"repository":{"type":"git","url":"git+https://github.com/danielsogl/jest-schematic.git"},"author":{"name":"Daniel Sogl"},"bugs":{"url":"https://github.com/danielsogl/jest-schematic/issues"},"license":"MIT","readme":"# Jest Angular Schematic\n\nThis schematic will configure Angular to execute unit tests with Jest for single projects or workspaces.\n\n[![npm (scoped)](https://img.shields.io/npm/v/@danielsogl/jest-schematic.svg)](https://www.npmjs.com/package/@danielsogl/jest-schematic)\n\n## Usage 🚀\n\n```shell\nng add @danielsogl/jest-schematic\n```\n\n- install [Jest](https://facebook.github.io/jest/), types and a [builder](https://github.com/just-jeb/angular-builders/tree/master/packages/jest)\n- add Jest configuration files\n- remove Karma & Jasmine along with their configuration files\n\n### Optionally: install globally\n\n```shell\nnpm install -g @danielsogl/jest-schematic\n```\n\nThen in an Angular CLI project run\n\n```shell\nng g @danielsogl/jest-schematic:add\n```\n\n![jest-schematic-demo-500](docs/jest-schematic-demo-500.gif)\n\n## Issues 🧐\n\nIf you're experiencing issues when trying to run your tests with Jest, please view the documentation for the [builder](https://github.com/just-jeb/angular-builders/tree/master/packages/jest) which uses [jest-preset-angular](https://github.com/thymikee/jest-preset-angular#troubleshooting).\n\nA common issues involves library dependencies. For example if your app depends on `NgRx` you'll need to tell Jest to compile the sources [explicitly](https://github.com/thymikee/jest-preset-angular#adjust-your-transformignorepatterns-whitelist) by appending it to the `transformIgnorePatterns` property in the `jest.config.js` file.\n\n```js\nmodule.exports = {\n  transformIgnorePatterns: ['node_modules/(?!(jest-test|@ngrx))'],\n};\n```\n\nIssues with this schematic can be filed [here](https://github.com/danielsogl/jest-schematic/issues/new/choose).\n\n## Learning Resources 📚\n\n- [Unit Testing Angular With Jest](https://medium.com/@ole.ersoy/unit-testing-angular-with-jest-b65888ff33f6)\n\n## Development 🛠\n\n### Getting started\n\nClone or fork the repo and install the dependencies with Yarn\n\n```shell\nyarn\n```\n\n### Test schematic changes against a sandbox app\n\nWhen running locally, schematic changes will be applied to a test app in the `/sandboxes` directory. `/sandboxes` contain a single app repo and a workspace repo with an application and library.\n\nRun the following when a schematic change is made to test:\n\n```bash\n// runs against /sandboxes/single-app\nyarn test single\n\n// runs against /sandboxes/workspace\nyarn test workspace\n```\n\n⚠ **Be careful not to check in changes to the sandbox directory unless necessary.** ⚠\n\n### Reset sandboxes to their version controlled state\n\nThis will reset the sandboxes to their `HEAD` commit and remove un-tracked files.\n\n```shell\nyarn reset\n```\n\n### Test schematics against a local project\n\n- run `yarn build` to compile the schematic in watch mode\n- open another shell, cd into the local repo you want to run the schematic against, and run `yarn link @danielsogl/jest-schematic`. This assumes you've run `yarn link` in this repo on your machine.\n  - this will symlink the projects so that the Jest schematic command runs from you're local filesystem\n- in the local repo you want to run the schematic against, run `ng g @danielsogl/jest-schematic:add`\n\n### Dev tips\n\nFor faster developing, find and comment out the following line to avoid npm installing dependencies\n\n```ts\ncontext.addTask(new NodePackageInstallTask());\n```\n","readmeFilename":"README.md"}