|
| 1 | +# 🚀 Angular Jest Scaffolder |
| 2 | + |
| 3 | +[](https://badge.fury.io/js/angular-jest-scaffolder) |
| 4 | +[](https://github.com/yourusername/angular-jest-scaffolder/issues) |
| 5 | +[](https://www.npmjs.com/package/angular-jest-scaffolder) |
| 6 | +[](https://github.com/yourusername/angular-jest-scaffolder/blob/main/LICENSE) |
| 7 | + |
| 8 | +**Angular Jest Scaffolder** is a command-line tool designed to simplify the setup of Angular applications with Jest as the default testing framework, eliminating the need for Jasmine and Karma. This tool creates a new Angular app using version 18 and configures it for modern testing practices. |
| 9 | + |
| 10 | +## 📥 Installation |
| 11 | + |
| 12 | +To install the Angular Jest Scaffolder globally, use the following command: |
| 13 | + |
| 14 | +```bash |
| 15 | +npm install -g angular-jest-scaffolder |
| 16 | +``` |
| 17 | + |
| 18 | +## 📋 Requirements |
| 19 | + |
| 20 | +- **Node.js**: Version 18 or higher. |
| 21 | +- **Angular CLI**: Version 18 will be installed automatically if not present. |
| 22 | + |
| 23 | +## 🚀 Usage |
| 24 | + |
| 25 | +To create a new Angular project with Jest configured, run the command: |
| 26 | + |
| 27 | +```bash |
| 28 | +angular-jest-scaffolder <app-name> |
| 29 | +``` |
| 30 | + |
| 31 | +If you don't specify an app name, it defaults to `angular-jest-starter`. |
| 32 | + |
| 33 | +### Example Command: |
| 34 | + |
| 35 | +```bash |
| 36 | +angular-jest-scaffolder my-angular-app |
| 37 | +``` |
| 38 | + |
| 39 | +### Example Output: |
| 40 | + |
| 41 | +```bash |
| 42 | +npx angular-jest-scaffolder |
| 43 | +No app name provided. |
| 44 | +Using app name: angular-jest-starter |
| 45 | +Node.js version v20.17.0 is compatible. |
| 46 | +Checking for Angular CLI... |
| 47 | +Angular CLI version 18 is already installed. |
| 48 | + |
| 49 | +Creating a new Angular app: angular-jest-starter with options: |
| 50 | +? Which stylesheet format would you like to use? Sass (SCSS) [ https://sass-lang.com/documentation/syntax#scss ] |
| 51 | +? Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? no |
| 52 | +CREATE angular-jest-starter/README.md (1079 bytes) |
| 53 | +CREATE angular-jest-starter/.editorconfig (274 bytes) |
| 54 | +. |
| 55 | +. |
| 56 | +. |
| 57 | +Successfully initialized git. |
| 58 | +Removing Jasmine and Karma... |
| 59 | + |
| 60 | +added 871 packages, and audited 872 packages in 2m |
| 61 | + |
| 62 | +143 packages are looking for funding |
| 63 | + run `npm fund` for details |
| 64 | + |
| 65 | +found 0 vulnerabilities |
| 66 | + |
| 67 | +karma.conf.js or test.ts not found; continuing. |
| 68 | + |
| 69 | +Installing Jest... |
| 70 | + |
| 71 | +added 375 packages, and audited 1247 packages in 13s |
| 72 | + |
| 73 | +155 packages are looking for funding |
| 74 | + run `npm fund` for details |
| 75 | + |
| 76 | +found 0 vulnerabilities |
| 77 | + |
| 78 | +Updating angular.json to configure Jest... |
| 79 | + |
| 80 | +angular.json updated to use Jest. |
| 81 | + |
| 82 | +Creating Jest configuration files... |
| 83 | + |
| 84 | +Jest configuration files created. |
| 85 | + |
| 86 | +Updating TypeScript configurations... |
| 87 | + |
| 88 | +TypeScript configurations updated for Jest. |
| 89 | + |
| 90 | +Updating package.json with Jest test scripts... |
| 91 | + |
| 92 | +package.json updated with Jest test scripts. |
| 93 | + |
| 94 | +Committing Jest-related files to Git... |
| 95 | + |
| 96 | +[main 69bf5fc] Added Jest setup |
| 97 | + 6 files changed, 18239 insertions(+), 38 deletions(-) |
| 98 | + create mode 100644 jest.config.js |
| 99 | + create mode 100644 package-lock.json |
| 100 | + create mode 100644 setup-jest.ts |
| 101 | + |
| 102 | +Jest-related files committed to Git. |
| 103 | +Jest setup completed. |
| 104 | +======================================================== |
| 105 | +Run `npm install` and then `ng test` to start testing with Jest. |
| 106 | +``` |
| 107 | + |
| 108 | +## 🌟 Features |
| 109 | + |
| 110 | +- **Quick Setup**: Easily create a new Angular application with Jest integrated. |
| 111 | +- **Legacy Tool Removal**: Automatically removes Jasmine and Karma to promote modern testing practices. |
| 112 | +- **Customizable Options**: Choose your preferred stylesheet format and whether to enable SSR. |
| 113 | +- **Dependency Management**: Installs the following development dependencies: |
| 114 | + - `@angular/cli@18` |
| 115 | + - `@types/jest@29` |
| 116 | + - `jest@29` |
| 117 | + - `jest-junit@16` |
| 118 | + - `jest-preset-angular@14` |
| 119 | + |
| 120 | +## 📄 License |
| 121 | + |
| 122 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 123 | + |
| 124 | +## 👨💻 Author |
| 125 | + |
| 126 | +**Ayush Jaiswal** |
| 127 | + |
| 128 | +- Email: ayush.jaiswal47.aj@gmail.com |
| 129 | +- LinkedIn: [Ayush Jaiswal](https://www.linkedin.com/in/jaisayush/) |
| 130 | + |
| 131 | +Thank you for using Angular Jest Scaffolder! We hope it enhances your Angular development experience. |
0 commit comments