Skip to content

Commit

Permalink
tests: disable testing timestamp equity under windows
Browse files Browse the repository at this point in the history
This test will not pass until it would be fixed in nodejs
See: nodejs/node#2069
  • Loading branch information
nalajcie committed Feb 24, 2016
1 parent 217819f commit 147a84b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tasks/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(grunt) {
var fs = require('fs');
var chalk = require('chalk');
var fileSyncCmp = require('file-sync-cmp');
var isWindows = /^win/.test(process.platform);
var isWindows = process.platform === 'win32';

grunt.registerMultiTask('copy', 'Copy files.', function() {

Expand Down
18 changes: 13 additions & 5 deletions test/copy_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var grunt = require('grunt');
var fs = require('fs');
var isWindows = /^win/.test(process.platform);
var isWindows = process.platform === 'win32';

exports.copy = {
main: function(test) {
Expand Down Expand Up @@ -80,14 +80,22 @@ exports.copy = {
test.done();
},

timestamp: function(test) {
test.expect(4);

timestamp_equal: function(test) {
if (isWindows) {
// Known Issue: this test will not pass on Windows due to bug in nodejs (https://github.com/nodejs/node/issues/2069)
test.done();
return;
}
test.expect(2);
test.equal(fs.lstatSync('tmp/copy_test_timestamp/sub_folder').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/sub_folder').mtime.getTime());
test.equal(fs.lstatSync('tmp/copy_test_timestamp/test.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test.js').mtime.getTime());
test.done();
},

timestamp_changed: function(test) {
test.expect(2);
test.notEqual(fs.lstatSync('tmp/copy_test_timestamp/test1.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test.js').mtime.getTime());
test.notEqual(fs.lstatSync('tmp/copy_test_timestamp/test_process.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test_process.js').mtime.getTime());

test.done();
}
};

0 comments on commit 147a84b

Please sign in to comment.