tests: disable testing timestamp equity under windows
This test will not pass until it would be fixed in nodejs
See: https://github.com/nodejs/node/issues/2069
nalajcie
8 years ago
13 | 13 |
var fs = require('fs');
|
14 | 14 |
var chalk = require('chalk');
|
15 | 15 |
var fileSyncCmp = require('file-sync-cmp');
|
16 | |
var isWindows = /^win/.test(process.platform);
|
|
16 |
var isWindows = process.platform === 'win32';
|
17 | 17 |
|
18 | 18 |
grunt.registerMultiTask('copy', 'Copy files.', function() {
|
19 | 19 |
|
1 | 1 |
|
2 | 2 |
var grunt = require('grunt');
|
3 | 3 |
var fs = require('fs');
|
4 | |
var isWindows = /^win/.test(process.platform);
|
|
4 |
var isWindows = process.platform === 'win32';
|
5 | 5 |
|
6 | 6 |
exports.copy = {
|
7 | 7 |
main: function(test) {
|
|
79 | 79 |
test.done();
|
80 | 80 |
},
|
81 | 81 |
|
82 | |
timestamp: function(test) {
|
83 | |
test.expect(4);
|
84 | |
|
|
82 |
timestamp_equal: function(test) {
|
|
83 |
if (isWindows) {
|
|
84 |
// Known Issue: this test will not pass on Windows due to bug in nodejs (https://github.com/nodejs/node/issues/2069)
|
|
85 |
test.done();
|
|
86 |
return;
|
|
87 |
}
|
|
88 |
test.expect(2);
|
85 | 89 |
test.equal(fs.lstatSync('tmp/copy_test_timestamp/sub_folder').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/sub_folder').mtime.getTime());
|
86 | 90 |
test.equal(fs.lstatSync('tmp/copy_test_timestamp/test.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test.js').mtime.getTime());
|
|
91 |
test.done();
|
|
92 |
},
|
|
93 |
|
|
94 |
timestamp_changed: function(test) {
|
|
95 |
test.expect(2);
|
87 | 96 |
test.notEqual(fs.lstatSync('tmp/copy_test_timestamp/test1.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test.js').mtime.getTime());
|
88 | 97 |
test.notEqual(fs.lstatSync('tmp/copy_test_timestamp/test_process.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test_process.js').mtime.getTime());
|
89 | |
|
90 | 98 |
test.done();
|
91 | 99 |
}
|
92 | 100 |
};
|