Bump versions and add release notes
[dygraphs.git] / scripts / run-tests.sh
CommitLineData
2a1f00d8
DV
1#!/bin/bash
2# Starts the http-server and runs mocha-phantomjs-based tests
3# Note that you must run `npm run build` or `npm run watch` before running this.
87f78fb2
DV
4# Additional arguments are passed to mocha-phantomjs, e.g.
5# run-tests.sh --grep interaction-model
2a1f00d8
DV
6set -o errexit
7
8# Run http-server and save its PID
9http-server -p 8081 > /dev/null &
10SERVER_PID=$!
11function finish() {
12 kill -TERM $SERVER_PID
13}
14trap finish EXIT
15
16# the following sleep step is not really necessary
17# as http-server starts almost instantenously;
18# but letting the server settle might help prevent
19# possible racing conditions
20sleep 1
21
22# Start the tests
a6d0469d 23mocha-phantomjs http://localhost:8081/auto_tests/runner.html "$@"