1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-02 12:27:08 +01:00

Adjust error handling / tests.

This commit is contained in:
hacksalot
2016-02-01 22:56:08 -05:00
parent 70f45d468d
commit fd39cc9fd9
10 changed files with 34 additions and 23 deletions

View File

@ -63,7 +63,7 @@ var tests = [
' (multiple JRS resumes)'
],
[ '!new',
[ 'new',
[],
[],
opts,
@ -152,7 +152,7 @@ var tests = [
}
],
[ '!build',
[ 'build',
[ ft + 'jane-fullstacker.json'],
[ sb + 'shouldnt-exist.pdf' ],
EXTEND(true, {}, opts, { theme: 'awesome' }),
@ -172,16 +172,24 @@ describe('Testing API interface', function () {
shouldSucceed = false;
}
it( 'The ' + verb.toUpperCase() + ' command should ' + (shouldSucceed ? ' SUCCEED' : ' FAIL') + msg, function () {
it( 'The ' + verb.toUpperCase() + ' command should ' + (shouldSucceed ? ' NOT THROW' : ' THROW') + msg, function () {
function runIt() {
try {
var v = new FCMD.verbs[verb]();
v.on('hmr:error', function(ex) { throw ex; });
var r = v.invoke( src, dst, opts );
if( fnTest )
if( !fnTest( r.sheet ) )
throw "Test: Unexpected API result.";
var prom = v.invoke( src, dst, opts );
prom.then(
function( obj ) {
if( fnTest )
if( !fnTest( obj ) )
throw "Test: Unexpected API result.";
},
function( error ) {
throw error;
}
);
}
catch(ex) {
console.error(ex);

View File

@ -1,8 +1,8 @@
4|
0|--help
0|-h
0|--debug
0|-d
4|--debug
4|-d
5|notacommand
8|new
0|new test/sandbox/cli-test/new-empty-resume.auto.json