EE Calculator is a small AngularJS application that displays a basic calculator on your browser. The code has been divided into different components to make the code maintainable and easy to understand.
First, you need Node.js to be installed in your dev environment as this project depends on it. Next, you should clone EE calculator project to your dev environment:
git clone https://github.com/dcapilla/ee-calculator.git
Once the project is cloned you just need to run npm run start to install the dependencies needed and run the project. The following commands are used to run and test the project:
- npm run start (will start the local web server on localhost:8000)
- npm run test (will start karma for countinous testing once code changes are detected)
- npm run test-single-run (will start karma for one single test run)
Above commands are defined in the package.json configuration file in the root of the project. Check it out to understand what is exactly executed once above commands are run.
The project has been divided into different components to make it easy to understand:
- Calculator: this is the main wrapper component
- Button: Calculator button component
- Screen: Calculator screen component
We use Karma + Jasmine to test the application. In order to run tests, just run npm run test-single-run, this will run tests and will produce a Test coverage report under the /coverage folder on the root of the project.