Skip to content

Commit

Permalink
Merge pull request #392 from tschaub/updates
Browse files Browse the repository at this point in the history
Remove conditions for untested versions
  • Loading branch information
tschaub authored Sep 26, 2024
2 parents 16b2846 + 9c87858 commit 29e2965
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 158 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
versioning-strategy: increase-if-necessary
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand Down
130 changes: 56 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions test/lib/fs.link-symlink.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const fs = require('fs');
const mock = require('../../lib/index.js');

const assert = helper.assert;
const inVersion = helper.inVersion;

describe('fs.link(srcpath, dstpath, callback)', function () {
beforeEach(function () {
Expand Down Expand Up @@ -198,7 +197,7 @@ describe('fs.symlink(srcpath, dstpath, [type], callback)', function () {

// https://github.com/nodejs/node/issues/34514
if (process.platform === 'win32') {
inVersion('>=15.0.0').it('supports Buffer input', function (done) {
it('supports Buffer input', function (done) {
fs.symlink(
Buffer.from('../file.txt'),
Buffer.from('dir/link.txt'),
Expand Down
25 changes: 0 additions & 25 deletions test/lib/fs.open-close.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const fs = require('fs');
const mock = require('../../lib/index.js');

const assert = helper.assert;
const inVersion = helper.inVersion;

describe('fs.open(path, flags, [mode], callback)', function () {
beforeEach(function () {
Expand Down Expand Up @@ -220,30 +219,6 @@ describe('fs.close(fd, callback)', function () {
});
});
});

inVersion('<14.0.0').it(
'promise fails for closed file descriptors',
function (done) {
fs.promises
.open('dir/file.txt', 'w')
.then(function (fd) {
return fd.close().then(function () {
// in Nodejs v14+, closing on closed file descriptor is silently ignored.
return fd.close();
});
})
.then(
function () {
done(new Error('should not succeed.'));
},
function (err) {
assert.instanceOf(err, Error);
assert.equal(err.code, 'EBADF');
done();
}
);
}
);
});

describe('fs.closeSync(fd)', function () {
Expand Down
5 changes: 5 additions & 0 deletions test/lib/fs.readFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ describe('fs.readFileSync(filename, [options])', function () {
});
afterEach(mock.restore);

it('works with utf-8', function () {
const content = fs.readFileSync('path/to/file.txt', 'utf-8').toString();
assert.equal(content, 'file content');
});

it('allows a file to be read synchronously', function () {
const data = fs.readFileSync('path/to/file.txt');
assert.isTrue(Buffer.isBuffer(data));
Expand Down
Loading

0 comments on commit 29e2965

Please sign in to comment.