Skip to content

Latest commit

 

History

History
144 lines (98 loc) · 3.15 KB

File metadata and controls

144 lines (98 loc) · 3.15 KB

How to build, test and Contribute

First of all, nice to have you here. You're a beautiful person!

This document should help you getting started when you want to play around with this project.
If you run into any troubles, don't hesitate to open an issue.

Dependencies

We assume you have node.js installed. For building, ruby and bundler are required since the typekit webfontloader needs to be compiled before we can ship it.

We also recommend installing grunt-cli globally

npm install -g grunt-cli

If this is not possible, you can use ./node_modules/.bin/grunt instead of grunt.

Setup

npm install

This will install npm packages, bower components, webdriver stuff for protractor and initiate a first build.

Build

grunt build

This builds the typekit webfontloader and our dist-files.
Please do not check-in any of those files (See About PRs, dist files and releases).

Demo/Sandbox

grunt demo

The --port is changeable, defaults to 8000

You need to build this project successfully once.
If you want to see google fonts in the demo, you need to setup a Google API KEY.

Test

We use Karma and Protractor for testing.

Before the tests, you need to build this project successfully once.
Note that the End to End tests require a Google API KEY.

Single run

# end to end and unit tests
grunt test
# only one of both
grunt test:unit
grunt test:e2e

Test driven development.

# end to end and unit tests
grunt tdd
# only one of both
grunt tdd:unit
grunt tdd:e2e

Options

Browsers

Both tasks take a --browsers option to specify the browser you want to test on.
Chrome, Firefox and PhantomJS are fine.
Try IE, Opera and Safari at your own risk - don't forget to install the launchers.

Defaults Browsers:

test:unit	Chrome,Firefox,PhantomJS
test:e2e	Chrome
tdd:unit	Chrome
tdd:e2e		Chrome

Reporters

The Karma reporter can be customized using --reporters

Coverage

Start a server to serve the coverage reports.

grunt coverage

The --port is changeable, defaults to 8000

Api Keys

The tests expect a valid API Key for Google Web fonts.
Get one from the Google Developers Console.
Set it as an environment variable in your .bashrc with export JD_FONTSELECT_GOOGLE_FONTS_API_KEY="__yourKeyHere__"

The build and test tasks will now create a file named tmp.apikeys.js in the project root and include it in demos and tests.

About PRs, dist files and releases

When opening a PR please exclude any changes on the ./dist files.
This will keep the git history clean and the dist files will always point to the latest release.

Dist files are being auto-updated once a new release is made.