Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ script:
- grunt test
- sleep 1; while (ps aux | grep '[b]ehat' > /dev/null); do sleep 1; done
- for pid in `ps aux | grep drush | grep runserver | awk '{print $2}'`; do echo "Stopping drush pid $pid"; kill -SIGINT $pid; done;
- grunt package --quiet
- mocha --timeout 10000 node_modules/grunt-drupal-tasks/test/build.js
- mocha node_modules/grunt-drupal-tasks/test/library.js
6 changes: 4 additions & 2 deletions tasks/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ module.exports = function(grunt) {
cwd: '<%= config.srcPaths.drupal %>/static',
src: ['**', '.**'],
dest: '<%= config.buildPaths.html %>',
dot: true
dot: true,
follow: true
}
]
});
Expand All @@ -41,7 +42,8 @@ module.exports = function(grunt) {
cwd: '<%= config.buildPaths.temp %>',
src: ['**', '.**'],
dest: '<%= config.buildPaths.html %>',
dot: true
dot: true,
follow: true
}
]
});
Expand Down
6 changes: 4 additions & 2 deletions tasks/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ module.exports = function(grunt) {
cwd: '<%= config.buildPaths.html %>',
src: srcFiles,
dest: destPath + (grunt.config.get('config.packages.dest.docroot') || ''),
dot: true
dot: true,
follow: true
},
{
expand: true,
src: projFiles,
dest: destPath + (grunt.config.get('config.packages.dest.devResources') || ''),
dot: true
dot: true,
follow: true
}
],
options: {
Expand Down
54 changes: 54 additions & 0 deletions test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,60 @@ describe('grunt', function() {
});
});

// Ensure a custom library file is available under build.
var librariesBuildDest = (drupalCore == '8') ? 'build/html/libraries/example_lib/example.md' : 'build/html/sites/all/libraries/example_lib/example.md';
it('custom library file should exist in build', function(done) {
fs.exists(librariesBuildDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure a custom module file is available under build.
var modulesBuildDest = (drupalCore == '8') ? 'build/html/modules/custom/test.php' : 'build/html/sites/all/modules/custom/test.php';
it('custom module file should exist in build', function(done) {
fs.exists(modulesBuildDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure a custom theme file is available under build.
var themesBuildDest = (drupalCore == '8') ? 'build/html/themes/custom/example_theme/config.rb' : 'build/html/sites/all/themes/custom/example_theme/config.rb';
it('custom theme file should exist in build', function(done) {
fs.exists(themesBuildDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure a custom library file is available under package.
var librariesPackageDest = (drupalCore == '8') ? 'build/packages/package/libraries/example_lib/example.md' : 'build/packages/package/sites/all/libraries/example_lib/example.md';
it('custom library file should exist in package', function(done) {
fs.exists(librariesPackageDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure a custom module file is available under package.
var modulesPackageDest = (drupalCore == '8') ? 'build/packages/package/modules/custom/test.php' : 'build/packages/package/sites/all/modules/custom/test.php';
it('custom module file should exist in package', function(done) {
fs.exists(modulesPackageDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure a custom theme file is available under package.
var themesPackageDest = (drupalCore == '8') ? 'build/packages/package/themes/custom/example_theme/config.rb' : 'build/packages/package/sites/all/themes/custom/example_theme/config.rb';
it('custom theme file should exist in package', function(done) {
fs.exists(themesPackageDest, function (exists) {
assert.ok(exists);
done();
});
});

// Ensure the build/html/sites/all/themes/custom/example_theme/stylesheets/screen.css
// file exists, which should be created by compass.
var sassDest = (drupalCore == '8') ? 'build/html/themes/custom/example_theme/stylesheets/screen.css' : 'build/html/sites/all/themes/custom/example_theme/stylesheets/screen.css';
Expand Down
1 change: 1 addition & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ run_tests () {
grunt test
sleep 1; while (ps aux | grep '[b]ehat' > /dev/null); do sleep 1; done
for pid in `ps aux | grep drush | grep runserver | awk '{print $2}'`; do echo "Stopping drush pid $pid"; kill -SIGINT $pid; done;
grunt package --quiet
# end-to-end tests
mocha --timeout 10000 node_modules/grunt-drupal-tasks/test/build.js
# unit tests
Expand Down