forked from phase2/grunt-drupal-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwatch.js
47 lines (43 loc) · 1.32 KB
/
watch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = function(grunt) {
/**
* Define "watch" tasks.
*
* Add a watch task that automatically runs the test suite when a file in
* the Drupal docroot changes (except for files in sites/.../files) or when
* a file in the testing features directory changes.
*/
grunt.loadNpmTasks('grunt-contrib-watch');
var Help = require('../lib/help')(grunt);
grunt.config(['watch', 'test'], {
files: [
'<%= config.srcPaths.drupal %>/**/*',
'!<%= config.srcPaths.drupal %>/sites/*/files/**/*',
'features/**/*'
],
tasks: ['test']
});
grunt.config(['watch', 'validate'], {
files: [
'<%= config.srcPaths.drupal %>/**/*',
'!<%= config.srcPaths.drupal %>/**/*.features.*inc',
'!<%= config.srcPaths.drupal %>/sites/**'
],
tasks: ['validate:newer']
});
grunt.config(['concurrent', 'watch-test'], {
tasks: ['watch:validate', 'watch:test'],
options: {
logConcurrentOutput: true
}
});
grunt.registerTask('watch-test', 'Backend operations watch task.',
function() {
grunt.loadNpmTasks('grunt-concurrent');
grunt.task.run('concurrent:watch-test');
});
Help.add({
task: 'watch-test',
group: 'Real-time Tooling',
description: 'Watch for changes that should trigger new testing and validation of the codebase.'
});
};