Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-03-06 11:41:21 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-03-06 11:41:21 -0500
commit0d169ea9ebc35653805228e8af3cc3966ac93e05 (patch)
treec8064f64ad3ff73fed0fdc657b8e65411d415eb6 /progtest/test
parent0cb43d5e8a044db73bb13698137c444c05b8fd47 (diff)
downloadtame-0d169ea9ebc35653805228e8af3cc3966ac93e05.tar.gz
tame-0d169ea9ebc35653805228e8af3cc3966ac93e05.tar.bz2
tame-0d169ea9ebc35653805228e8af3cc3966ac93e05.zip
progtest: Return empty array of test cases if none providedv2.11.1
* progtest/src/reader/YamlTestReader.js (loadCases): Handle absence of any test cases. * progtest/test/reader/YamlTestReaderTest.js: New respective test.
Diffstat (limited to 'progtest/test')
-rw-r--r--progtest/test/reader/YamlTestReaderTest.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/progtest/test/reader/YamlTestReaderTest.js b/progtest/test/reader/YamlTestReaderTest.js
index 9fb26fd..bddc211 100644
--- a/progtest/test/reader/YamlTestReaderTest.js
+++ b/progtest/test/reader/YamlTestReaderTest.js
@@ -52,4 +52,14 @@ describe( "YamlTestReader", () =>
expect( Sut( mock_parser, case_ctor ).loadCases( yaml ) )
.to.deep.equal( [ { ok: parsed[0] } ] );
} );
+
+
+ it( "produces empty array given no tests", () =>
+ {
+ const mock_parser = { safeLoad: () => null };
+ const case_ctor = () => null; // unused
+
+ expect( Sut( mock_parser, case_ctor ).loadCases( "" ) )
+ .to.deep.equal( [] );
+ } );
} );