sudo: false # Use container-based architecture
script: >
- gulp travis &&
+ ./make-prod-combined.sh &&
+ ./make-tests.sh &&
+ ./run-tests.sh &&
curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/master/weigh_in.py &&
python weigh_in.py dist/dygraph-combined.js
<div id="mocha"></div>
<!-- Polyfills for PhantomJS -->
- <script src="../node_modules/babel/node_modules/babel-core/browser-polyfill.js"></script>
+ <script src="../node_modules/babel-core/browser-polyfill.js"></script>
<!-- Mocha -->
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script>
+ if (window.initMochaPhantomJS) {
+ window.initMochaPhantomJS();
+ }
+ </script>
+
+ <script>
var expect = chai.expect;
var assert = chai.assert;
function cleanupAfterEach() {
<script>
mocha.checkLeaks();
- if (window.mochaPhantomJS) {
- mochaPhantomJS.run();
- } else {
- mocha.run();
- }
+ mocha.run();
</script>
</body>
</html>
}
});
+// PhantomJS 1.9.x does not support setLineDash
+// When Travis-CI updates to Phantom2, this can be re-enabled.
+// See https://github.com/ariya/phantomjs/issues/12948
+if (!navigator.userAgent.match(/PhantomJS\/1.9/)) {
it('testGridLinePattern', function() {
var opts = {
width : 480,
}
}
});
+}
});
#!/bin/bash
+mkdir -p dist
+
browserify \
-v \
-t babelify \
--debug \
--standalone Dygraph \
src/dygraph.js \
- | uglifyjs -c -m \
> dist/dygraph.js
+
+# Create dist/dygraph.js.map
+cat dist/dygraph.js | exorcist --base . dist/dygraph.js.map > /dev/null
+
+# Create dist/dygraph.js.min{,.map}
+uglifyjs --compress --mangle \
+ --in-source-map dist/dygraph.js.map \
+ --source-map-include-sources \
+ --source-map dist/dygraph.min.js.map \
+ -o dist/dygraph.min.js \
+ dist/dygraph.js
+
+# Copy to the old location
+cp dist/dygraph.min.js dist/dygraph-combined.js
--- /dev/null
+#!/bin/bash
+browserify \
+ -v \
+ -t babelify \
+ -t [ envify --NODE_ENV development ] \
+ --debug \
+ -o dist/tests.js \
+ auto_tests/tests/*.js
},
"homepage": "https://github.com/danvk/dygraphs",
"devDependencies": {
+ "babel-core": "^5.8.25",
"babelify": "^6.3.0",
"browserify": "^11.2.0",
"chai": "^3.3.0",
"gulp-shell": "^0.4.0",
"gulp-sourcemaps": "^1.3.0",
"gulp-uglify": "^1.0.2",
+ "http-server": "^0.8.5",
"jshint": "^2.5.10",
"karma": "^0.12.31",
"karma-chai-plugins": "^0.2.4",
"karma-spec-reporter": "0.0.16",
"lcov-parse": "0.0.9",
"mocha": "^2.1.0",
+ "mocha-phantomjs": "^4.0.1",
"obvious-closure-library": "^20140401.0.2",
"parse-data-uri": "^0.2.0",
"phantomjs": "^1.9.7-8",
--- /dev/null
+#!/bin/bash
+# Starts the http-server and runs mocha-phantomjs-based tests
+# Note that you must run `npm run build` or `npm run watch` before running this.
+set -o errexit
+
+# Run http-server and save its PID
+http-server -p 8081 > /dev/null &
+SERVER_PID=$!
+function finish() {
+ kill -TERM $SERVER_PID
+}
+trap finish EXIT
+
+# the following sleep step is not really necessary
+# as http-server starts almost instantenously;
+# but letting the server settle might help prevent
+# possible racing conditions
+sleep 1
+
+# Start the tests
+mocha-phantomjs http://localhost:8081/auto_tests/runner.html