Merge pull request #674 from danvk/module
[dygraphs.git] / scripts / run-tests.sh
... / ...
CommitLineData
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.
4set -o errexit
5
6# Run http-server and save its PID
7http-server -p 8081 > /dev/null &
8SERVER_PID=$!
9function finish() {
10 kill -TERM $SERVER_PID
11}
12trap finish EXIT
13
14# the following sleep step is not really necessary
15# as http-server starts almost instantenously;
16# but letting the server settle might help prevent
17# possible racing conditions
18sleep 1
19
20# Start the tests
21mocha-phantomjs http://localhost:8081/auto_tests/runner.html