Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-16 15:25:36 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-19 15:21:14 -0500
commit4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a (patch)
tree8bab6ec11f188bb0aadbc96623c4b8f79f192aeb /progtest/src
parent0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e (diff)
downloadtame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.tar.gz
tame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.tar.bz2
tame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.zip
progtest: Display reader errors in browser
Diffstat (limited to 'progtest/src')
-rw-r--r--progtest/src/TestRunner.js2
-rw-r--r--progtest/src/env.js16
2 files changed, 14 insertions, 4 deletions
diff --git a/progtest/src/TestRunner.js b/progtest/src/TestRunner.js
index d24f38f..504c1a1 100644
--- a/progtest/src/TestRunner.js
+++ b/progtest/src/TestRunner.js
@@ -97,7 +97,7 @@ module.exports = Class( 'TestRunner',
{
const total = dfns.length;
- return new Promise( resolve =>
+ return new Promise( ( resolve, reject ) =>
{
const results = [];
diff --git a/progtest/src/env.js b/progtest/src/env.js
index 7c09cf6..8eeb837 100644
--- a/progtest/src/env.js
+++ b/progtest/src/env.js
@@ -52,8 +52,18 @@ module.exports = {
.use( ConstResolver( program ) )
( yaml_reader, TestCase );
- return yaml => runner.runTests(
- reader.loadCases( yaml )
- );
+ return yaml => new Promise( ( resolve, reject ) =>
+ {
+ try
+ {
+ const cases = reader.loadCases( yaml );
+
+ resolve( runner.runTests( cases ) );
+ }
+ catch ( e )
+ {
+ reject( e );
+ }
+ } );
},
};