Commit f0beb635 authored by Grand Francois's avatar Grand Francois
Browse files

ajout des outils de débuggage des tests unitaires avec Chrome Inspector (debug_test)

Showing with 84 additions and 1 deletion
+84 -1
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
npm-debug.log npm-debug.log
testem.log testem.log
/typings /typings
Makefile
# e2e # e2e
/e2e/*.js /e2e/*.js
......
Makefile 0 → 100644
SRC_DIR := src
BUILD_DIR := build
NODE_BASE := $(HOME)/Documents/dev/node-v6.10.2-linux-x64
NODE := $(NODE_BASE)/bin/node
JASMINE_CLI := ./node_modules/jasmine-node/lib/jasmine-node/cli.js
#$(error $(NODE))
SOURCE_FILES := $(shell find $(SRC_DIR) -name *.ts)
all : compile
compile : build-dir $(SOURCE_FILES)
npm run build
build-dir :
mkdir -p $(BUILD_DIR)
buildspec :
npm run buildspec
jasmine : buildspec
npm run jasmine
karma :
npm run karma
clean :
rm -rf $(BUILD_DIR)
debug_test 0 → 100755
#!/bin/bash
do_kill()
{
local pid=$1
if [[ -n $pid ]]; then
if [[ -n $(ps -ef|grep $pid|grep -v grep) ]]; then
echo "killing $pid..."
kill $jm_pid
else
echo "no process with pid $pid"
fi
fi
}
do_exit()
{
# echo "exits"
do_kill $jm_pid
}
syntax()
{
echo "syntaxe : $(basename $0) <fichier spec>"
exit 1
}
trap do_exit SIGINT
trap do_exit EXIT
if [[ $# != 1 ]]; then
syntax
fi
ni=$(ps -ef|grep node-inspector|grep -v grep)
if [[ -z $ni ]]; then
echo "starting node-inspector..."
node-inspector &
else
echo "node-inspector already running"
fi
echo
echo "debugging $1..."
node --debug-brk ./node_modules/jasmine-node/bin/jasmine-node $1 &
jm_pid=$!
echo
#ps -ef|grep jasmine-node|grep -v grep
#pid=$(ps -ef|grep jasmine-node|grep -v grep|awk '{print $2}')
#echo $pid $jm_pid
echo "starting Chrome...."
chromium-browser http://127.0.0.1:8080/?port=5858
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment