Skip to content

Commit

Permalink
reproducer for issue pgilad#18, targetPrefix doesn't work when path c…
Browse files Browse the repository at this point in the history
…ontains no slash
  • Loading branch information
ppitonak committed Oct 22, 2014
1 parent 864baf7 commit b5dda51
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ module.exports = function (grunt) {
dest: 'test/compiled/layout.jade'
}]
},
withPrefixNoSlash: {
options: {
tasks: {
js: ['concat', 'uglify', 'filerev'],
css: ['concat', 'cssmin']
},
dirTasks: ['filerev'],
prefix: 'test',
targetPrefix: 'test'
},
files: [{
src: 'test/fixtures/withPrefixNoSlash.jade',
dest: 'test/compiled/withPrefixNoSlash.jade'
}]
},
alternate: {
options: {
tasks: {
Expand Down Expand Up @@ -129,6 +144,7 @@ module.exports = function (grunt) {
'jadeUsemin:basic',
'jadeUsemin:advanced',
'jadeUsemin:withPrefix',
'jadeUsemin:withPrefixNoSlash',
'jadeUsemin:alternate',
'jadeUsemin:empty',
'copy:test',
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/withPrefixNoSlash.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//-<!-- build:js compiled/jquery.min.js -->
script(src='/src/script1.js')
//-<!-- endbuild -->
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ exports.jadeUsemin = {
test.ok(/jquery.min.(\w+).js/.test(filename));
test.done();
},
withPrefixNoSlash: function (test) {
test.expect(2);
var layout = grunt.file.read('test/compiled/withPrefixNoSlash.jade');
test.ok(/compiled\/jquery\.min\.(\w+)\.js/.test(layout));
var filename = grunt.file.expand('test/compiled/jquery.min.*.js')[0];
filename = path.basename(filename);
test.ok(/jquery.min.(\w+).js/.test(filename));
test.done();
},
windowsPaths: function (test) {
test.expect(1);

Expand Down

0 comments on commit b5dda51

Please sign in to comment.