grunt-copy-part-of-file
Version:
This plugin helps me copy a section from 1 file to another. I use it with angularjs to keep my index.html and my index-e2e.html file in sync
52 lines (41 loc) • 1.86 kB
JavaScript
;
var grunt = require('grunt');
exports.copy = {
setUp: function(done) {
// setup here if necessary
done();
},
replace_e2e_scripts: function(test) {
test.expect(1);
var actual = grunt.file.read('test/fixtures/index-harmony-e2e.html');
var expected = grunt.file.read('test/expected/index-harmony-e2e.html');
//console.log("test1", actual, expected);
test.equal(actual, expected, 'the destination file does not match what was expected');
test.done();
},
simple_replace_scripts: function(test) {
test.expect(1);
var actual = grunt.file.read('test/fixtures/simple-destination.html');
var expected = grunt.file.read('test/expected/simple-expected.html');
//console.log("actual: ", actual);
//console.log("expected: ", expected);
test.equal(actual, expected, 'the destination file does not match what was expected');
test.done();
},
line_comment_replace_scripts: function(test) {
test.expect(1);
var actual = grunt.file.read('test/fixtures/javascript-line-comment-destination.js');
var expected = grunt.file.read('test/expected/javascript-line-comment-expected.js');
//console.log("test1", actual, expected);
test.equal(actual, expected, 'the destination file does not match what was expected');
test.done();
},
block_comment_replace_scripts: function(test) {
test.expect(1);
var actual = grunt.file.read('test/fixtures/javascript-block-comment-destination.js');
var expected = grunt.file.read('test/expected/javascript-block-comment-expected.js');
//console.log("test1", actual, expected);
test.equal(actual, expected, 'the destination file does not match what was expected');
test.done();
}
};