Slides: http://bit.ly/msd-workshop
No.

Open git bash
git clone https://github.com/<your-username>/emi-calculator.git
cd emi-calculator
npm install
(Both the workshop codebase and VS Code)
git checkout -b <branch-name>
Add new test case to tests/emi.test.js
test('Should throw an error on negative interest rate', () => {
expect(() => EMI.Loan(10000, -1, 10)).toThrowError('wrong parameters: 10000 -1 10')
});
Run tests
npm test
Commit
git add tests/*.test.js
git commit -m "Add test to validate whether Loan() allows negative values"
Linting
npm run lint
Remove extra semicolons, and commit again
./node_modules/.bin/eslint --fix .
Commit and pushjs
// function Loan
if (!amount || amount <= 0 ||
!installmentsNumber || installmentsNumber <= 0 ||
!interestRate || interestRate <= 0) {
throw new Error(`wrong parameters: ${amount} ${installmentsNumber} ${interestRate}`)
}
`
git add src/emi.js
git commit -m "Disallow negative value for all parameters"
git push origin <branch-name>
<branch-name> to masterRakshit Menpara
CTO, Improwised Technologies Private Limited
Feedback: http://bit.ly/sd-workshop