LastSkywalkerER / innowise-calc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Innowise calculator

Only for sky calculations

Dark Mode

Light Mode

Task

Link on task

How to use

Button Function
Theme changer
Buttons for input numbers, work with keyboard
Devision button, work with keyboard
Multiply button, work with keyboard
Minus button, work with keyboard
Plus button, work with keyboard
Equal button, repeat last operation, work with keyboard
Reset button, work with keyboard
Plus/minus button
Devision second number by 100
Memory clear
Add to memory
Subtract from the memory
Write memory number
Square
Cube
Power
e power
ten power
Devide 1
Square root
Cube root
Root
Factorial
Previous operation

How to run

Live Demo

    npm install
    npm run dev / npm run build

Structure

  • 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

Naming

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.

About test

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

About


Languages

Language:JavaScript 77.0%Language:HTML 8.2%Language:CSS 7.5%Language:Sass 7.3%Language:Shell 0.1%