-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add JS testing framework and "vendor" libraries (#61)
* readme and contributing docs laying out testing and local development * don't load vendor JS libraries from external sources - "vendor" them into the project, allowing us to include running them in the test runner * set up nodejs project structure: package.json file including task runners and dependencies. Basic smoke tests for charts.js. Karma test runner configuration for running in headless chrome. * Have jekyll exclude hosting readme, gitignore, node dependencies and project bits.
- Loading branch information
1 parent
ada9a07
commit 1ad0910
Showing
15 changed files
with
4,439 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## Hubble Web Application | ||
|
||
This web application is built as a [Jekyll](https://jekyllrb.com/) site and is intended to be hosted using [GitHub Pages](https://pages.github.com/). | ||
|
||
## Overview | ||
|
||
### Charts | ||
|
||
Each `.html` page in this directory contains one or more charts. Each chart is defined as an `<svg>` element with a few special attributes that define their behaviour: | ||
|
||
1. a `data-url` attribute referencing a `.tsv` file generated by the [updater component](../updater/README.md) - this is a relative URL that directs the chart where to ask for data from. | ||
1. a `class` attribute defining the kind of chart that will be rendered. Acceptable values are `chart`, `table`, and `collaboration`. | ||
1. a `data-type` _only applicable if the `class` is set to `chart`_; attribute referencing the sub-type of chart that will be rendered. Acceptable values are `history` and `list`. | ||
|
||
For details on how each kind of chart is rendered, take a look at the [`charts.js` file](assets/js/charts.js). | ||
|
||
## Development | ||
|
||
To run the site locally, you will need to install [Jekyll](https://jekyllrb.com/). Then change the `_config.yml` file and set the `dataURL` to `http://127.0.0.1:4000/demo-data`. Finally, run `jekyll serve`, | ||
and load http://127.0.0.1:4000 in your browser. | ||
|
||
## Tests | ||
|
||
This web application uses a framework called [Karma](https://karma-runner.github.io) as a test runner (a way to run JavaScript in different browser contexts), and [Jasmine](https://jasmine.github.io) | ||
as the testing / assertion library. The tests are implemented as `.js` files under the `spec/` folder, and as much as possible mirror the filenames of JavaScript source files. | ||
|
||
### Requirements | ||
|
||
- You will need a recent version of [node.js](https://nodejs.org) installed. | ||
- The tests run in a headless instance of the **Google Chrome** browser, so you will need a recent version of Google Chrome installed. | ||
- Install any needed dependencies by running `npm install` from this folder. | ||
|
||
### Running the Tests | ||
|
||
To run the tests once: | ||
|
||
$ npm test | ||
|
||
During local development, it may be nice to keep the test runner running in the background as one makes changes to the JavaScript source files (under `assets/js/`), or the test files (under `spec/`) so as to | ||
get immediate feedback. This mode will re-run the tests every time a source or test file changes. To run in this mode: | ||
|
||
$ npm test -- --no-single-run --auto-watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dataURL: https://autodesk.github.io/hubble/demo-data | ||
exclude: ['spec', 'node_modules', 'README.md', '.gitignore', 'package.json', 'package-lock.json'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.