Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-16 14:41:39 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-19 15:21:14 -0500
commit0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e (patch)
tree0103c1c471a0d70a12b497ccecfc71ad39540841 /progtest/test
parentf788edd675e3662192c2421ae142fb1f42d3da49 (diff)
downloadtame-0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e.tar.gz
tame-0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e.tar.bz2
tame-0b433e86f4497fa285bcf8a37d0dcd39bfa09c7e.zip
progtest: Async run each test serially
If that makes sense. The problem is that the browser needs to repaint after each test is run. See code comments.
Diffstat (limited to 'progtest/test')
-rw-r--r--progtest/test/TestRunnerTest.js32
1 files changed, 18 insertions, 14 deletions
diff --git a/progtest/test/TestRunnerTest.js b/progtest/test/TestRunnerTest.js
index fc06e04..eff50eb 100644
--- a/progtest/test/TestRunnerTest.js
+++ b/progtest/test/TestRunnerTest.js
@@ -86,20 +86,24 @@ describe( "TestRunner", () =>
]
];
- const results = Sut( NullTestReporter(), program )
- .runTests( test_cases );
-
- test_cases.forEach( ( test_case, i ) =>
- {
- const result = results[ i ];
-
- expect( result.desc ).to.equal( test_case.description );
- expect( result.i ).to.equal( i );
- expect( result.total ).to.equal(
- Object.keys( test_case.expect ).length
- );
- expect( result.failures ).to.deep.equal( expect_failures[ i ] );
- } );
+ Sut( NullTestReporter(), program )
+ .runTests( test_cases )
+ .then( results =>
+ {
+ test_cases.forEach( ( test_case, i ) =>
+ {
+ const result = results[ i ];
+
+ expect( result.desc ).to.equal( test_case.description );
+ expect( result.i ).to.equal( i );
+ expect( result.total ).to.equal(
+ Object.keys( test_case.expect ).length
+ );
+ expect( result.failures ).to.deep.equal(
+ expect_failures[ i ]
+ );
+ } );
+ } );
} );