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/5] 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/5] 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.") } } From e94b6597afbe214a8e4bad68b38e0dd3b265f18f Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 25 Mar 2014 21:30:53 -0400 Subject: [PATCH 3/5] s/spaces/tab --- tests/test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test.js b/tests/test.js index a50f3d8f..18d1a96f 100644 --- a/tests/test.js +++ b/tests/test.js @@ -10,7 +10,8 @@ test.print = function(print) { print(test.failures[i].toString()) } print("tests: " + test.total + "\nfailures: " + test.failures.length) - if (test.failures.length > 0) { - throw new Error(test.failures.length + " tests did not pass.") - } + + if (test.failures.length > 0) { + throw new Error(test.failures.length + " tests did not pass.") + } } From 1ff4b3ccf6a7bfe6fc792a79fc9fc3b8e94bdae0 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 25 Mar 2014 21:48:23 -0400 Subject: [PATCH 4/5] push for travis --- tests/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.js b/tests/test.js index 18d1a96f..ccb6269a 100644 --- a/tests/test.js +++ b/tests/test.js @@ -12,6 +12,6 @@ test.print = function(print) { print("tests: " + test.total + "\nfailures: " + test.failures.length) if (test.failures.length > 0) { - throw new Error(test.failures.length + " tests did not pass.") + throw new Error(test.failures.length + " tests did not pass") } } From b6dd52bd6a8c5671f58d6f5a47760d8f96c9ab15 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 25 Mar 2014 21:54:15 -0400 Subject: [PATCH 5/5] add travis build icon --- README.md | 2 ++ archive/v0.1.1/mithril-tests.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index bfdce655..c3c18f36 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/lhorie/mithril.js.svg?branch=master)](https://travis-ci.org/lhorie/mithril.js) + # Mithril A Javascript Framework for Building Brilliant Applications diff --git a/archive/v0.1.1/mithril-tests.js b/archive/v0.1.1/mithril-tests.js index 1415912b..9bec759a 100644 --- a/archive/v0.1.1/mithril-tests.js +++ b/archive/v0.1.1/mithril-tests.js @@ -432,7 +432,12 @@ test.print = function(print) { print(test.failures[i].toString()) } print("tests: " + test.total + "\nfailures: " + test.failures.length) + + if (test.failures.length > 0) { + throw new Error(test.failures.length + " tests did not pass") + } } + var mock = {} mock.window = new function() { var window = {}