Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unitTesting using mocha, chai and phantomjs. Fixes GH-665 Signed-off-by: Anmol Jagetia <anmoljagetia@gmail.com>
- Loading branch information
1 parent
9f7fbf3
commit 550d10f
Showing
6 changed files
with
140 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ before_script: | |
- npm install -g bower | ||
- npm install -g gulp | ||
- bower install | ||
after_script: | ||
- gulp |
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 |
---|---|---|
|
@@ -122,4 +122,4 @@ | |
}; | ||
|
||
return Menu; | ||
})); | ||
})); |
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,96 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>HPCC Visualization Unit Tests</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" /> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="../node_modules/mocha/mocha.js"></script> | ||
<script src="../node_modules/chai/chai.js"></script> | ||
|
||
<script src="../bower_components/requirejs/require.js"></script> | ||
<script src="../src/config.js"></script> | ||
<script> | ||
mocha.setup('bdd'); | ||
var assert = chai.assert; | ||
var allWidgets = [ | ||
{ path: "src/common/FAChar" }, | ||
{ path: "src/common/Icon" }, | ||
{ path: "src/common/List" }, | ||
{ path: "src/common/Menu" }, | ||
{ path: "src/common/ResizeSurface" }, | ||
{ path: "src/common/Shape" }, | ||
{ path: "src/common/Surface" }, | ||
{ path: "src/common/Text" }, | ||
{ path: "src/common/TextBox" }, | ||
{ path: "src/chart/Area" }, | ||
{ path: "src/chart/Bubble" }, | ||
{ path: "src/chart/Column" }, | ||
{ path: "src/chart/Line" }, | ||
{ path: "src/chart/MultiChart" }, | ||
{ path: "src/chart/MultiChartSurface" }, | ||
{ path: "src/chart/Pie" }, | ||
{ path: "src/chart/Scatter" }, | ||
{ path: "src/chart/Step" }, | ||
{ path: "src/chart/Summary" }, | ||
{ path: "src/form/Form" }, | ||
{ path: "src/form/Input" }, | ||
{ path: "src/form/Slider" }, | ||
{ path: "src/map/ChoroplethCounties" }, | ||
{ path: "src/map/ChoroplethCountries" }, | ||
{ path: "src/map/ChoroplethStates" }, | ||
{ path: "src/map/GMap" }, | ||
{ path: "src/tree/CirclePacking" }, | ||
{ path: "src/tree/Dendrogram" }, | ||
{ path: "src/tree/SunburstPartition" }, | ||
{ path: "src/graph/Edge" }, | ||
{ path: "src/graph/Graph" }, | ||
{ path: "src/graph/Vertex" }, | ||
{ path: "src/other/MorphText" }, | ||
{ path: "src/other/Table" }, | ||
{ path: "src/other/WordCloud" }, | ||
{ path: "src/marshaller/HTML" }, | ||
{ path: "src/marshaller/Graph" }, | ||
{ path: "src/layout/Surface" }, | ||
{ path: "src/layout/Cell" }, | ||
{ path: "src/layout/Grid" }, | ||
{ path: "src/layout/Border" }, | ||
{ path: "src/c3chart/Area" }, | ||
{ path: "src/c3chart/Bar" }, | ||
{ path: "src/c3chart/Column" }, | ||
{ path: "src/c3chart/Donut" }, | ||
{ path: "src/c3chart/Gauge" }, | ||
{ path: "src/c3chart/Line" }, | ||
{ path: "src/c3chart/Pie" }, | ||
{ path: "src/c3chart/Scatter" }, | ||
{ path: "src/c3chart/Step" }, | ||
{ path: "src/google/Area" }, | ||
{ path: "src/google/Bar" }, | ||
{ path: "src/google/Column" }, | ||
{ path: "src/google/Line" }, | ||
{ path: "src/google/Pie" }, | ||
{ path: "src/google/Scatter" }, | ||
{ path: "src/google/Timeline" }, | ||
{ path: "src/google/TreeMap" }, | ||
{ path: "src/amchart/Area" }, | ||
{ path: "src/amchart/Bar" }, | ||
{ path: "src/amchart/Bubble" }, | ||
{ path: "src/amchart/Candle" }, | ||
{ path: "src/amchart/FloatingColumn" }, | ||
{ path: "src/amchart/Funnel" }, | ||
{ path: "src/amchart/Gauge" }, | ||
{ path: "src/amchart/Line" }, | ||
{ path: "src/amchart/Pie" }, | ||
{ path: "src/amchart/Polar" }, | ||
{ path: "src/amchart/Pyramid" }, | ||
{ path: "src/amchart/Scatter" } | ||
] | ||
require(["./widgets"], function () { | ||
mocha.run(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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,23 @@ | ||
"use strict"; | ||
define(["require"], function (require) { | ||
describe("widgets", function () { | ||
allWidgets.forEach(function (widget) { | ||
var path = widget.path; | ||
describe(path, function () { | ||
it("require load", function (done) { | ||
require([path], function (Widget) { | ||
done(); | ||
}); | ||
}); | ||
|
||
it("features", function (done) { | ||
require([path], function (Widget) { | ||
assert.isFunction(Widget); | ||
assert.isFunction(Widget.prototype.constructor, "constructor"); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |