develop and publish npm package
- register an account on npmjs.com.
- npm adduser
- npm publish –dry-run
- npm publish
test framework
mocha
#installation
npm i -D ts-mocha mocha chai @types/mocha @types/chai
#add test coverage
npm i nyc -D
#add following content to .nycrc.json
{
"cache": false,
"check-coverage": true,
"extension": [
".ts"
],
"include": [
"**/src/*.ts"
],
"reporter": [
"cobertura",
"text-summary"
],
"statements": 90,
"branches": 90,
"functions": 90,
"lines": 90
}
static test
SonarCloud
static code analyzer that scans your source code and assesses metrics like maintainability, reliability, duplication, and also identifies security issues.