Skip to content

Commit 89a67e5

Browse files
authored
chore(test): Add test for Windows extended-length paths (#225)
1 parent 3544dc6 commit 89a67e5

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

test/window-extended-length-paths.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
'use strict';
2+
3+
var expect = require('expect');
4+
var os = require('os');
5+
var path = require('path');
6+
7+
var childProcess = require('child_process');
8+
var exec = childProcess.exec;
9+
10+
var eraseTime = require('./tool/erase-time');
11+
var eraseLapse = require('./tool/erase-lapse');
12+
var tildify = require('../lib/shared/tildify');
13+
14+
var gulpfileDir = path.resolve(__dirname, 'fixtures/gulpfiles');
15+
var gulpfilePath = path.resolve(gulpfileDir, 'gulpfile.js');
16+
17+
var gulpJsPath = '\\\\?\\' + path.resolve(__dirname, '../bin/gulp.js');
18+
19+
describe('windows extended length paths', function() {
20+
it('Should run normaly even if using \'\\\\?\\\'prefix in paths', function(done) {
21+
if (os.platform() !== 'win32') {
22+
this.skip();
23+
return;
24+
}
25+
26+
var cmd = ['node', gulpJsPath, '--no-color', '--gulpfile', gulpfilePath].join(' ');
27+
28+
exec(cmd, function cb(err, stdout, stderr) {
29+
expect(err).toEqual(null);
30+
expect(stderr).toEqual('');
31+
32+
var workingDir = tildify(gulpfileDir);
33+
var usingGulpfile = tildify(gulpfilePath);
34+
35+
stdout = eraseLapse(eraseTime(stdout));
36+
expect(stdout).toEqual('' +
37+
'Working directory changed to ' + workingDir + '\n' +
38+
'Using gulpfile ' + usingGulpfile + '\n' +
39+
'Starting \'default\'...\n' +
40+
'Starting \'test1\'...\n' +
41+
'Starting \'noop\'...\n' +
42+
'Finished \'noop\' after ?\n' +
43+
'Finished \'test1\' after ?\n' +
44+
'Starting \'test3\'...\n' +
45+
'Starting \'described\'...\n' +
46+
'Finished \'described\' after ?\n' +
47+
'Finished \'test3\' after ?\n' +
48+
'Starting \'noop\'...\n' +
49+
'Finished \'noop\' after ?\n' +
50+
'Finished \'default\' after ?\n' +
51+
'');
52+
done();
53+
});
54+
});
55+
});

0 commit comments

Comments
 (0)