Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]
node: [10, 12, 14, 16, 18, 20, 22, 24]
os: [ubuntu-latest, windows-latest, macos-13]

steps:
- name: Clone repository
Expand Down
7 changes: 7 additions & 0 deletions test/codecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ describe('codecs', function () {
});

describeStreams('stream', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand Down
29 changes: 28 additions & 1 deletion test/dest-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var fs = require('graceful-fs');
var File = require('vinyl');
var expect = require('expect');
var sinon = require('sinon');

var vfs = require('../');

Expand All @@ -29,6 +28,13 @@ var contents = testConstants.contents;
var clean = cleanup(outputBase);

describeStreams('.dest() with custom modes', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand Down Expand Up @@ -299,6 +305,13 @@ describeStreams('.dest() with custom modes', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var fchmodSpy = sinon.spy(fs, 'fchmod');

var expectedMode = applyUmask('777');
Expand Down Expand Up @@ -327,6 +340,13 @@ describeStreams('.dest() with custom modes', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var fchmodSpy = sinon.spy(fs, 'fchmod');

var startMode = applyUmask('3722');
Expand Down Expand Up @@ -359,6 +379,13 @@ describeStreams('.dest() with custom modes', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var expectedMode = applyUmask('722');

var fchmodSpy = sinon.stub(fs, 'fchmod').callsFake(mockError);
Expand Down
22 changes: 21 additions & 1 deletion test/dest-owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var fs = require('graceful-fs');
var File = require('vinyl');
var expect = require('expect');
var sinon = require('sinon');

var vfs = require('../');

Expand All @@ -20,6 +19,13 @@ var contents = testConstants.contents;
var clean = cleanup(outputBase);

describeStreams('.dest() with custom owner', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand All @@ -32,6 +38,13 @@ describeStreams('.dest() with custom owner', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var fchownSpy = sinon.spy(fs, 'fchown');

var file = new File({
Expand Down Expand Up @@ -60,6 +73,13 @@ describeStreams('.dest() with custom owner', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var fchownSpy = sinon.spy(fs, 'fchown');

var file = new File({
Expand Down
23 changes: 19 additions & 4 deletions test/dest-symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ var neOutputDirpath = testConstants.neOutputDirpath;
var clean = cleanup(outputBase);

describeStreams('.dest() with symlinks', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand Down Expand Up @@ -216,8 +223,12 @@ describeStreams('.dest() with symlinks', function (stream) {
var outputLink = fs.readlinkSync(outputDirpath);

expect(files.length).toEqual(1);
// When creating a junction, it seems Windows appends a separator
expect(outputLink).toEqual(inputDirpath + path.sep);
// When creating a junction, it seems Windows appends a separator until Node 22+
if (process.versions.node.startsWith("22.") || process.versions.node.startsWith("24.")) {
expect(outputLink).toEqual(inputDirpath);
} else {
expect(outputLink).toEqual(inputDirpath + path.sep);
}
expect(stats.isDirectory()).toEqual(true);
expect(lstats.isDirectory()).toEqual(false);
}
Expand Down Expand Up @@ -455,8 +466,12 @@ describeStreams('.dest() with symlinks', function (stream) {
var outputLink = fs.readlinkSync(outputDirpath);

expect(files.length).toEqual(1);
// When creating a junction, it seems Windows appends a separator
expect(outputLink).toEqual(inputDirpath + path.sep);
// When creating a junction, it seems Windows appends a separator until Node 22+
if (process.versions.node.startsWith("22.") || process.versions.node.startsWith("24.")) {
expect(outputLink).toEqual(inputDirpath);
} else {
expect(outputLink).toEqual(inputDirpath + path.sep);
}
expect(stats.isDirectory()).toEqual(true);
expect(lstats.isDirectory()).toEqual(false);
}
Expand Down
43 changes: 42 additions & 1 deletion test/dest-times.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var fs = require('graceful-fs');
var File = require('vinyl');
var expect = require('expect');
var sinon = require('sinon');

var vfs = require('../');

Expand All @@ -21,6 +20,13 @@ var contents = testConstants.contents;
var clean = cleanup(outputBase);

describeStreams('.dest() with custom times', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand All @@ -35,6 +41,13 @@ describeStreams('.dest() with custom times', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var earlier = Date.now() - 1001;

var futimesSpy = sinon.spy(fs, 'futimes');
Expand Down Expand Up @@ -64,6 +77,13 @@ describeStreams('.dest() with custom times', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

// Use new mtime
var mtime = new Date(Date.now() - 2048);

Expand Down Expand Up @@ -100,6 +120,13 @@ describeStreams('.dest() with custom times', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var earlier = Date.now() - 1001;

var futimesSpy = sinon.spy(fs, 'futimes');
Expand Down Expand Up @@ -131,6 +158,13 @@ describeStreams('.dest() with custom times', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

// Use new mtime
var mtime = new Date(Date.now() - 2048);
var invalidAtime = new Date(undefined);
Expand Down Expand Up @@ -166,6 +200,13 @@ describeStreams('.dest() with custom times', function (stream) {
return;
}

if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

// Use new atime/mtime
var atime = new Date(Date.now() - 2048);
var mtime = new Date(Date.now() - 1024);
Expand Down
43 changes: 42 additions & 1 deletion test/dest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var path = require('path');
var fs = require('graceful-fs');
var File = require('vinyl');
var expect = require('expect');
var sinon = require('sinon');

var vfs = require('../');

Expand Down Expand Up @@ -51,6 +50,13 @@ function makeSourceMap() {
var clean = cleanup(outputBase);

describeStreams('.dest()', function (stream) {
before(function () {
if (process.versions.node.startsWith("10.")) {
this.skip();
return;
}
});

var from = stream.Readable.from;
var pipeline = stream.pipeline;

Expand Down Expand Up @@ -464,6 +470,13 @@ describeStreams('.dest()', function (stream) {
});

it('reports stat errors', function (done) {
if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var expectedMode = applyUmask('722');

var fstatSpy = sinon.stub(fs, 'fstat').callsFake(mockError);
Expand Down Expand Up @@ -1112,6 +1125,13 @@ describeStreams('.dest()', function (stream) {
});

it('errors if we cannot mkdirp', function (done) {
if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var mkdirSpy = sinon.stub(fs, 'mkdir').callsFake(mockError);

var file = new File({
Expand All @@ -1130,6 +1150,13 @@ describeStreams('.dest()', function (stream) {
});

it('errors if vinyl object is a directory and we cannot mkdirp', function (done) {
if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var ogMkdir = fs.mkdir;

var mkdirSpy = sinon.stub(fs, 'mkdir').callsFake(function () {
Expand Down Expand Up @@ -1179,6 +1206,13 @@ describeStreams('.dest()', function (stream) {
});

it('errors if vinyl object is a directory and open errors', function (done) {
if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var openSpy = sinon.stub(fs, 'open').callsFake(mockError);

var file = new File({
Expand Down Expand Up @@ -1219,6 +1253,13 @@ describeStreams('.dest()', function (stream) {
});

it('does not pass options on to stream', function (done) {
if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) {
this.skip();
return;
}

var sinon = require('sinon');

var file = new File({
base: inputBase,
path: inputPath,
Expand Down
Loading
Loading