DEV Community

Chalermporn Posoppitakwong
Chalermporn Posoppitakwong

Posted on • Edited on

Angular13 migrate Jest

Start Angular 13

ng i -g @angular/cli@13
ng new my-app
npm i --legacy-peer-deps
//or
npm -loglevel info install --legacy-peer-deps -strict-ssl false
Enter fullscreen mode Exit fullscreen mode

migrate Jest

npm remove -D @types/jasmine jasmine-core karma-jasmine karma-jasmine-html-reporter karma karma-chrome-launcher karma-coverage

rm -rf karma.conf.js src/test.t
Enter fullscreen mode Exit fullscreen mode

bun remove

bun remove -d @types/jasmine jasmine-core karma-jasmine karma-jasmine-html-reporter karma karma-chrome-launcher karma-coverage
Enter fullscreen mode Exit fullscreen mode

ref: https://www.npmjs.com/package/@angular-builders/jest

npm i -D jest @types/jest @angular-builders/jest@13.x.x --legacy-peer-deps
Enter fullscreen mode Exit fullscreen mode

add script to package.json

"clear": "rm -rf node_modules *-lock.* *.lock",
"init": "npm i --legacy-peer-deps",
Enter fullscreen mode Exit fullscreen mode

ref: https://github.com/briebug/jest-schematic

benchmark bun vs npm vs yarn vs pnpm command line

hyperfine "bun install --backend=hardlink" "yarn install --on-scripts" "npm install --no-scripts --ignore-scripts" "pnpm install --ignore-scripts" --prepare="rm -rf node_modules" --cleanup="rm -rf node_modules" --warmup=8
Enter fullscreen mode Exit fullscreen mode

Top comments (0)