You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can reproduce the same problem with any sync method that does not return a value like fs.writeFileSync(). The bug is in Spy's #returnOrThrow function. When I change
function returnOrThrow() {
if (typeof result !== 'undefined') {
return result;
} else {
throw error;
}
}
javascript const spyfs = require( 'spyfs' ); const sfs = spyfs.spy( fs, action => { console.log( action ); } ); const fd = sfs.openSync( __filename, 'r' ); sfs.closeSync( fd ); // error, return undefined
The text was updated successfully, but these errors were encountered: