Skip to content

Commit 29e2965

Browse files
authored
Merge pull request #392 from tschaub/updates
Remove conditions for untested versions
2 parents 16b2846 + 9c87858 commit 29e2965

8 files changed

+125
-158
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
versioning-strategy: increase-if-necessary
9+
- package-ecosystem: github-actions
10+
directory: "/"
11+
schedule:
12+
interval: weekly

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/checkout@v2
3535

3636
- name: Set Node.js version
37-
uses: actions/setup-node@v1
37+
uses: actions/setup-node@v4
3838
with:
3939
node-version: ${{ matrix.node }}
4040

package-lock.json

Lines changed: 56 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/lib/fs.link-symlink.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const fs = require('fs');
55
const mock = require('../../lib/index.js');
66

77
const assert = helper.assert;
8-
const inVersion = helper.inVersion;
98

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

199198
// https://github.com/nodejs/node/issues/34514
200199
if (process.platform === 'win32') {
201-
inVersion('>=15.0.0').it('supports Buffer input', function (done) {
200+
it('supports Buffer input', function (done) {
202201
fs.symlink(
203202
Buffer.from('../file.txt'),
204203
Buffer.from('dir/link.txt'),

test/lib/fs.open-close.spec.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const fs = require('fs');
55
const mock = require('../../lib/index.js');
66

77
const assert = helper.assert;
8-
const inVersion = helper.inVersion;
98

109
describe('fs.open(path, flags, [mode], callback)', function () {
1110
beforeEach(function () {
@@ -220,30 +219,6 @@ describe('fs.close(fd, callback)', function () {
220219
});
221220
});
222221
});
223-
224-
inVersion('<14.0.0').it(
225-
'promise fails for closed file descriptors',
226-
function (done) {
227-
fs.promises
228-
.open('dir/file.txt', 'w')
229-
.then(function (fd) {
230-
return fd.close().then(function () {
231-
// in Nodejs v14+, closing on closed file descriptor is silently ignored.
232-
return fd.close();
233-
});
234-
})
235-
.then(
236-
function () {
237-
done(new Error('should not succeed.'));
238-
},
239-
function (err) {
240-
assert.instanceOf(err, Error);
241-
assert.equal(err.code, 'EBADF');
242-
done();
243-
}
244-
);
245-
}
246-
);
247222
});
248223

249224
describe('fs.closeSync(fd)', function () {

test/lib/fs.readFile.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ describe('fs.readFileSync(filename, [options])', function () {
9595
});
9696
afterEach(mock.restore);
9797

98+
it('works with utf-8', function () {
99+
const content = fs.readFileSync('path/to/file.txt', 'utf-8').toString();
100+
assert.equal(content, 'file content');
101+
});
102+
98103
it('allows a file to be read synchronously', function () {
99104
const data = fs.readFileSync('path/to/file.txt');
100105
assert.isTrue(Buffer.isBuffer(data));

0 commit comments

Comments
 (0)