Skip to content

Commit

Permalink
add some test case for testError.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomohito Nakayama committed Feb 22, 2016
1 parent cca7235 commit a8b846e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/unit/testError.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,51 @@ describe('Error ', function () {
});

});


let testPath2 = './' + Math.random() + '.json';
describe('Error of link executer', function () {
it('should be handled in error listener', function (done) {

jf.filed( testPath2 )
.io(
function( obj, filePath) {
return { msg: 'Test value.' };
}
).link(
function(obj, filePath, executer){
executer.emit('error', errorObj );
},
function( err ){
expect( err ).to.eql( errorObj );
done();
}
).exec();

});

});

let testPath3 = './' + Math.random() + '.json';

describe('Error of copy executer', function () {
it('should be handled in error listener', function (done) {

jf.filed( testPath3 )
.io(
function( obj, filePath) {
return { msg: 'Test value.' };
}
).copy(
function(obj, filePath, executer){
executer.emit('error', errorObj );
},
function( err ){
expect( err ).to.eql( errorObj );
done();
}
).exec();

});

});

0 comments on commit a8b846e

Please sign in to comment.