{"id":13495551,"url":"https://github.com/briebug/jest","last_synced_at":"2025-03-28T16:32:57.269Z","repository":{"id":66350330,"uuid":"137411072","full_name":"briebug/jest","owner":"briebug","description":"Angular schematic for adding Jest and the required files to an Angular CLI project","archived":true,"fork":false,"pushed_at":"2018-09-16T04:43:08.000Z","size":1153,"stargazers_count":44,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-01T19:55:52.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briebug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-14T21:25:53.000Z","updated_at":"2024-03-19T11:23:14.000Z","dependencies_parsed_at":"2023-02-21T12:45:24.384Z","dependency_job_id":null,"html_url":"https://github.com/briebug/jest","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briebug%2Fjest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briebug%2Fjest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briebug%2Fjest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briebug%2Fjest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briebug","download_url":"https://codeload.github.com/briebug/jest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222395890,"owners_count":16977643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:01:35.799Z","updated_at":"2024-10-31T10:31:19.361Z","avatar_url":"https://github.com/briebug.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"## DEPRECATED ⚠\n\nThis repo \u0026 package have been deprecated and renamed to `@briebug/jest-schematic`. All future development will take place at https://github.com/briebug/jest-schematic\n\n# Jest Angular Schematic\n\n[![npm (scoped)](https://img.shields.io/npm/v/@briebug/jest.svg)](https://www.npmjs.com/package/@briebug/jest)\n\nAdd [Jest](https://facebook.github.io/jest/) to an Angular 6 project\n\n## Usage 🚀\n\nInstall globally\n\n```shell\nnpm install -g @briebug/jest\n```\n\nThen in an Angular CLI project run\n\n```shel\nng g @briebug/jest:jest\n```\n\nThis schematic will:\n\n- install Jest, it's dependencies, and scripts\n- add necessary files for Jest to work with Angular\n- remove unnecessary Karma files and configuration\n\n![ng-add-jest](docs/ng-add-jest.gif)\n\nOptionally run as one command in an Angular CLI app directory. Note this will add the schematic as a dependency to your project.\n\n```shell\nng add @briebug/jest\n```\n\n## Development 🛠\n\n### Getting started\n\n```shell\nnpm install \u0026\u0026 npm run link\n```\n\n### Test schematic changes against this repositories Angular CLI sandbox\n\nWhen running locally, schematic changes will be applied to the test app in the `./sandbox` directory. The sandbox is a bare CLI app and serves no other purpose than for testing schematics changes.\n\nCompile the typescript in watch mode in one shell:\n\n```shell\nnpm run build\n```\n\nRun the following in another shell every time a schematic change is made:\n\n```shell\nnpm run clean:launch\n```\n\n`clean:launch` will reset the sandbox to is current version controlled state, removing un-tracked files, and run the schematic against the sandbox. This will be your main development command.\n\n⚠ **Be careful not to check in changes to the sandbox directory unless necessary.** ⚠\n\n### Test schematics against a local project\n\n- run `npm run 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 `npm link ../PATH_TO_THIS_PROJECT`\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 @briebug/jest:jest`\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\n### Reset sandbox to its version controlled state\n\nThis will reset the sandbox folder to its `HEAD` commit and remove un-tracked files.\n\n```shell\nnpm run clean\n```\n\n### Compile the schematics\n\nCompile the typescript files in watch mode\n\n```shell\nnpm run build\n```\n\nCompile the typescript files once\n\n```shell\nnpm run build:once\n```\n\n## Testing\n\n### Test local sandbox for regressions\n\nRun a series of standard tests to ensure the `./sandbox` continues to function normally\n\n```shell\nnpm run test:sandbox\n```\n\n## Getting Started With Schematics\n\nThis repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM.\n\n### Schematic Testing\n\nTo test locally, install `@angular-devkit/schematics` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode.\n\nCheck the documentation with\n\n```bash\nschematics --help\n```\n\n### Unit Testing\n\n`npm run test` will run the unit tests, using Jasmine as a runner and test framework.\n\n### Publishing\n\nPublishing is handled by [np](https://github.com/sindresorhus/np#usage). Ensure you have push access to this repo and are a [@breibug](https://www.npmjs.com/settings/briebug/packages) NPM contributor. Several [options](https://github.com/sindresorhus/np#usage) are available for releases such as `npm run release --no-publish`.\n\nOnce all features are merged into `master`:\n\n1. on your machine, checkout `master`\n2. pull latest\n3. `npm run release`\n4. select the next appropriate version given the changes being added\n5. copy the `Commits:` displayed in your shell\n6. ![release-commits](./docs/np-release.png)\n7. edit the new release tag, and paste in the change notes and supply a title if appropriate\n8. ![edit-github-release](./docs/edit-github-release.png)\n\n## Documentation\n\n- [Schematics README](https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/README.md)\n- [Angular CLI schematic examples](https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/app-shell/index.ts)\n\n## Common solutions\n\n### node-package\n\nIf you receive the following error and are on Angular CLI 1.X, trying moving to `\"@angular/cli\": \"1.7\"` or higher.\n\n```shell\nError: Unregistered task \"node-package\" in schematic ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriebug%2Fjest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriebug%2Fjest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriebug%2Fjest/lists"}