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
parent0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e (diff)
downloadtame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.tar.gz
tame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.tar.bz2
tame-4e3a86866acf00f4e58c4c3ab61bfc8cd9b4667a.zip
progtest: Display reader errors in browser
Diffstat (limited to 'progtest')
-rw-r--r--progtest/bin/runner.js6
-rw-r--r--progtest/src/TestRunner.js2
-rw-r--r--progtest/src/env.js16
3 files changed, 19 insertions, 5 deletions
diff --git a/progtest/bin/runner.js b/progtest/bin/runner.js
index d0a95ad..1124867 100644
--- a/progtest/bin/runner.js
+++ b/progtest/bin/runner.js
@@ -32,4 +32,8 @@ const runner = require( '../src/env' ).console(
program, process.stdout
);
-runner( case_yaml );
+// XXX: work around issue with consts not being initialized ahead of time
+program.rater( {} );
+
+runner( case_yaml )
+ .catch( e => console.error( e ) );
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 );
+ }
+ } );
},
};