#!/bin/bash

usage() {
    /etc/init.d/postgresql stop
    echo "Usage: $0 [nodejs10|nodejs6]"
    exit 1
}

echo "$0 $1"

# start PostgreSQL
/etc/init.d/postgresql start

echo "Node.js version:"
node -v

# install dependencies
NODEJS_VERSION=${1-nodejs10}

if [ "$NODEJS_VERSION" = "nodejs10" ];
then
    echo "Node.js version:"
    npm -v
    npm install
elif [ "$NODEJS_VERSION" = "nodejs6" ];
then
    npm install -g yarn@0.27.5
    yarn
else
    usage
fi

# run tests
DEBUG=windshaft:renderer:pg_mvt npm test

#!/bin/bash

usage() {
    /etc/init.d/postgresql stop
    echo "Usage: $0 [nodejs10|nodejs6]"
    exit 1
}

echo "$0 $1"

# start PostgreSQL
/etc/init.d/postgresql start

echo "Node.js version:"
node -v

# install dependencies
NODEJS_VERSION=${1-nodejs10}

if [ "$NODEJS_VERSION" = "nodejs10" ];
then
    echo "Node.js version:"
    npm -v
    npm install
elif [ "$NODEJS_VERSION" = "nodejs6" ];
then
    npm install -g yarn@0.27.5
    yarn
else
    usage
fi

# run tests
npm test

Revert "Set DEBUG env variable to run test"
Revert "Set DEBUG env variable to run test"

This reverts commit 7bd188dafb1e1ffdba04b225a425f0acd87109ca.
