This commit is contained in:
yatsenko-julia 2022-02-14 17:38:28 +05:30 committed by GitHub
commit 5d91bc1ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -12,16 +12,18 @@ describe('fs.fsync', function() {
it('should return error when fd is not a number', function(done) {
var fs = util.fs();
fs.fsync('1', function(error) {
fs.fsync('notAnInteger', function(error) {
expect(error).to.exist;
expect(error.code).to.equal('EINVAL');
done();
});
});
it('should return error when fd is invalid', function(done) {
var fs = util.fs();
fs.fsync(1, function(error) {
it('should return an error if file descriptor is negative', function(done) {
let fs = util.fs();
// File descriptor should be a non-negative number
fs.fsync(-1, function(error) {
expect(error).to.exist;
expect(error.code).to.equal('EBADF');
done();