Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
added a compilation step in Gruntfile, a test suite, and expected res…
Browse files Browse the repository at this point in the history
…ults for the new sourceMapDir option
  • Loading branch information
johnnyfreeman authored and Tyler Kellen committed Dec 24, 2013
1 parent 970f9c3 commit 8a69fea
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function(grunt) {

// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp/bare', 'tmp/default', 'tmp/join']
tests: ['tmp/bare', 'tmp/default', 'tmp/join', 'tmp/sourceMapDir1', 'tmp/sourceMapDir2']
},

// Configuration to be run (and then tested).
Expand Down Expand Up @@ -88,6 +88,15 @@ module.exports = function(grunt) {
'tmp/maps/coffeeJoin.js': uniformConcatFixtures
}
},
compileSourceMapDir: {
options: {
sourceMap: true,
sourceMapDir: 'tmp/sourceMapDir2/'
},
files: {
'tmp/sourceMapDir1/coffee.js': ['test/fixtures/coffee1.coffee']
}
},
compileEachMap: {
options: {
sourceMap: true
Expand Down
17 changes: 17 additions & 0 deletions test/coffee_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,23 @@ exports.coffee = {
'test/expected/eachMap/litcoffee.js.map',
'Separate compilation of coffee and litcoffee files with source maps should generate map');

test.done();
},
compileSourceMapDir: function(test) {
'use strict';

test.expect(2);

assertFileEquality(test,
'tmp/sourceMapDir1/coffee.js',
'test/expected/sourceMapDir1/coffee.js',
'Compilation of single file with source maps should generate javascript');

assertFileEquality(test,
'tmp/sourceMapDir2/coffee.js.map',
'test/expected/sourceMapDir2/coffee.js.map',
'Compilation of single file with alternate source map dir should generate map');

test.done();
}
};
17 changes: 17 additions & 0 deletions test/expected/sourceMapDir1/coffee.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test/expected/sourceMapDir2/coffee.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8a69fea

Please sign in to comment.