Packages are used to create reusable widgets, actions and libraries for exams. This section will help you get started using the seed project to create a new Hammer package. For in-depth instructions and training, visit the Tutorials section.
- Chrome ( https://www.google.com/chrome/browser/features.html )
- Node.js ( https://nodejs.org/en/ )
- Bower ( http://bower.io/ )
npm install -g bower
- HTTP Server
npm install -g http-server
Used to launch the Hammer testing environment with the exam seed. If you are using WebStorm, you don't need to install this. Just open the index.html from within WebStorm.
Though these are not required, they are recommended installations.
- NPM Check
npm install -g npm-check
Checks for outdated node modules used by Hammer.
- NPM Check Updates
npm install -g npm-check-updates
Check for outdated bower components used by your exam.
Hammer uses a private Bower registry to access Hammer packages. If you are on a Windows machine, in order to download and install the Hammer packages from our private repository you will need to download and install Microsoft's Git Credential Manager for Windows
- Create a new repository at the GIT repository. If you do not have a login, please contact Certiport to have one created for you.
- Check out your newly created repository:
git clone <git_repo_url>
- Download the package seed and extracts its contents into your the empty repo direct on your local machine.
- Navigate to your project directory in your terminal and run the following command:
npm install && node setupand following the setup instructions.
- Run http-server from the terminal:
- Open http://localhost:8080 in Chrome
You should be up and running at this point with the default seed project.
Installing Hammer packages
Your package SHOULD NOT have any dependencies of other packages, with the exception of hammer-framework and hammer-application which are core packages and used in every exam. You can install additional packages using Bower. Click here to learn more about Bower.. For example, if you needed support for accessibility, you would run the following command:
bower install hammer-accessibility --save-dev
Your packages are installed in the
The --save-dev adds "hammer-layout" to "bower.json" as a dependency. Make sure you use the --save-dev tag and NOT the --save tag.
Checking for Hammer Package Updates
The easiest way to check for possible updates without automatically updating your packages is to use an node module called
From the project root
ncu -m bower
To update your packages
ncu -m bower -a
Compiling your code will compile to
src directory to "dist" and
"sandbox/bower_components/PACKAGE_NAME". Use the following task"
To have the project compile as you make changes in your source code, run the following task:
Running Unit Tests
Unit tests use the Jasmine framework.
You can run you tests in the browser. This has the advantages in that you can put breakpoints in the
specs and the code to find out where issues are. In WebStorm navigate to tests/unit/spec_runner.html
open in Browser (as described in the section
Running your project in Chrome) or
alternatively you can run
http-server if you have it installed.
Then open http://localhost:8080/tests/unit/spec_runner.html in a browser.
You can optionally run your tests from a command line:
Note: This is still in development.
Running your project in the Chrome browser
Chrome is the official browser used for testing and delivery.
Instructions for WebStorm editor
You can run your project directly from WebStorm. Right-click the HTML file in
in the project root and select
Open in Browser under the menu options.
Instructions for other editors
If you are an alternative editor such as Atom, Sublime or other, you should install
npm install http-server -g
Then initiate the server from the project root and open the url provided in Chrome.