Codebase list node-grunt-contrib-copy / 147a84b
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
2 changed file(s) with 14 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1313 var fs = require('fs');
1414 var chalk = require('chalk');
1515 var fileSyncCmp = require('file-sync-cmp');
16 var isWindows = /^win/.test(process.platform);
16 var isWindows = process.platform === 'win32';
1717
1818 grunt.registerMultiTask('copy', 'Copy files.', function() {
1919
11
22 var grunt = require('grunt');
33 var fs = require('fs');
4 var isWindows = /^win/.test(process.platform);
4 var isWindows = process.platform === 'win32';
55
66 exports.copy = {
77 main: function(test) {
7979 test.done();
8080 },
8181
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);
8589 test.equal(fs.lstatSync('tmp/copy_test_timestamp/sub_folder').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/sub_folder').mtime.getTime());
8690 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);
8796 test.notEqual(fs.lstatSync('tmp/copy_test_timestamp/test1.js').mtime.getTime(), fs.lstatSync('test/fixtures/time_folder/test.js').mtime.getTime());
8897 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
9098 test.done();
9199 }
92100 };