npm install
npm run dev / npm run build
- Root folder
- .husky / folder for husky settings(pre-commit hook)
- coverage / folder for jest testing data
- readme_assets / assets for README.md file
- src / main project files
- modules / project modules
- Commands / calculator commands
- Commands.tests / tests of main functions
- drawers / classes responsible for rendering
- helpers / supporting modules
- modules / project modules
Files with a capital letter contains the class:
CalcMath.js
Files with a small letter contain functions, variables, etc.
buttonNames.js
Files with functions and classes at the same time divided into files with the appropriate name.
Describtion of Command.test file
import Command from '../Commands/Command'; //import of Command for test
import CommandsTester from './CommandsTester'; //import custom tester
const commandTester = new CommandsTester(Command); //get an tester object
commandTester.fillTestValues(operand1, operand2, operator, answerInOperand1); // add values for test command
commandTester.test(stringFromThrownError, precisionForFloatNumbers); // run test
run tests:
npm run test