From a8d6f529d577098d3ab5f82f016578223f19f812 Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Sun, 23 Mar 2014 08:42:15 +0100 Subject: [PATCH 1/2] Make tests throw exception, add travis-ci integration. Relates to #23. --- .travis.yml | 6 ++++++ tests/test.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..94c28c09 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + +script: + - grunt test diff --git a/tests/test.js b/tests/test.js index a8d0e0cc..8c8d24e8 100644 --- a/tests/test.js +++ b/tests/test.js @@ -10,4 +10,7 @@ test.print = function(print) { print(test.failures[i].toString()) } print("tests: " + test.total + "\nfailures: " + test.failures.length) -} \ No newline at end of file + if (test.failures.length > 0) { + throw new Error(test.failures.length + " test did not pass.") + } +} From 3c34d8d6edac550bf35a49478936482142152dec Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Sun, 23 Mar 2014 08:44:10 +0100 Subject: [PATCH 2/2] Fix a typo. --- tests/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.js b/tests/test.js index 8c8d24e8..a50f3d8f 100644 --- a/tests/test.js +++ b/tests/test.js @@ -11,6 +11,6 @@ test.print = function(print) { } print("tests: " + test.total + "\nfailures: " + test.failures.length) if (test.failures.length > 0) { - throw new Error(test.failures.length + " test did not pass.") + throw new Error(test.failures.length + " tests did not pass.") } }