Skip to content

Commit e8d2b32

Browse files
committed
Prepare tests for PhantomJS (cf #102)
1 parent e2fafae commit e8d2b32

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ install:
33
npm install
44
vendors:
55
grunt
6-
test:
6+
testfx:
77
firefox test/index.html
8+
test: node_modules
9+
@./node_modules/mocha-phantomjs/bin/mocha-phantomjs --view 1024x768 test/index.html
810
i18n:
911
node node_modules/leaflet-i18n/bin/i18n.js --dir_path=src/js/ --dir_path=reqs/measurable/ --locale_dir_path=src/locale/ --locale_codes=en --mode=json --clean --default_values
1012
tx_push:

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
"grunt-contrib-concat": "^0.4.0",
1212
"grunt-contrib-copy": "^0.5.0",
1313
"happen": "~0.1.3",
14-
"mocha": "~1.12.0",
14+
"mocha": "^2.3.3",
15+
"mocha-phantomjs": "^4.0.1",
1516
"optimist": "~0.4.0",
17+
"phantomjs": "^1.9.18",
1618
"sinon": "^1.10.3",
1719
"uglify-js": "~2.2.3"
1820
},

test/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<script src="../src/js/leaflet.storage.js"></script>
3333
<script src="../contrib/js/storage.ui.default.js"></script>
3434
<link rel="stylesheet" href="../reqs/leaflet/leaflet.css" />
35-
<link rel="stylesheet" href="../reqs/draw/leaflet.draw.css" />
3635
<link rel="stylesheet" href="../reqs/minimap/Control.MiniMap.css" />
3736
<link rel="stylesheet" href="../reqs/editinosm/Leaflet.EditInOSM.css" />
3837
<link rel="stylesheet" href="../reqs/markercluster/MarkerCluster.css" />
@@ -93,7 +92,7 @@
9392
<div id="storage-alert-container"></div>
9493
<div id="storage-tooltip-container"></div>
9594
<script>
96-
var runner = mocha.run(function (failures) {
95+
var runner = (window.mochaPhantomJS || window.mocha).run(function (failures) {
9796
if (window.location.search.indexOf('debug') === -1) qs('#mocha').style.display = 'block';
9897
console.log(failures);
9998
});

0 commit comments

Comments
 (0)