Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove conditions for untested versions #392

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading