Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@briebug/jest
Advanced tools
This repo & package have been deprecated and renamed to @briebug/jest-schematic
. All future development will take place at https://github.com/briebug/jest-schematic
Add Jest to an Angular 6 project
Install globally
npm install -g @briebug/jest
Then in an Angular CLI project run
ng g @briebug/jest:jest
This schematic will:
Optionally run as one command in an Angular CLI app directory. Note this will add the schematic as a dependency to your project.
ng add @briebug/jest
npm install && npm run link
When 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.
Compile the typescript in watch mode in one shell:
npm run build
Run the following in another shell every time a schematic change is made:
npm run clean:launch
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.
⚠ Be careful not to check in changes to the sandbox directory unless necessary. ⚠
npm run build
to compile the schematic in watch modenpm link ../PATH_TO_THIS_PROJECT
ng g @briebug/jest:jest
For faster developing, find and comment out the following line to avoid npm installing dependencies
context.addTask(new NodePackageInstallTask());
This will reset the sandbox folder to its HEAD
commit and remove un-tracked files.
npm run clean
Compile the typescript files in watch mode
npm run build
Compile the typescript files once
npm run build:once
Run a series of standard tests to ensure the ./sandbox
continues to function normally
npm run test:sandbox
This repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM.
To 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.
Check the documentation with
schematics --help
npm run test
will run the unit tests, using Jasmine as a runner and test framework.
Publishing is handled by np. Ensure you have push access to this repo and are a @breibug NPM contributor. Several options are available for releases such as npm run release --no-publish
.
Once all features are merged into master
:
master
npm run release
Commits:
displayed in your shellIf you receive the following error and are on Angular CLI 1.X, trying moving to "@angular/cli": "1.7"
or higher.
Error: Unregistered task "node-package" in schematic ...
FAQs
Add jest to an Angular CLI project
We found that @briebug/jest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.