Skip to content

Commit

Permalink
Use a separate grunt/config/jsx config file for tests.
Browse files Browse the repository at this point in the history
No longer injecting __MOCK__ as a global constant (it's just a config
property now).

Turns out the `grunt jsx:debug` task was never necessary for tests.
  • Loading branch information
benjamn committed Jul 15, 2013
1 parent 2d61639 commit b763d7d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module.exports = function(grunt) {
grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
grunt.registerTask('build:min', ['jsx:release', 'browserify:min']);
grunt.registerTask('build:test', [
'jsx:debug',
'jsx:jasmine',
'jsx:test',
'browserify:jasmine',
Expand Down
2 changes: 1 addition & 1 deletion bin/jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require("commoner").resolve(function(id) {
// replacing constant expressions with literal (boolean) values.
source = propagate(constants, source);

if (constants.__MOCK__) {
if (context.config.mocking) {
// Make sure there is exactly one newline at the end of the module.
source = source.replace(/\s+$/m, "\n");

Expand Down
1 change: 0 additions & 1 deletion grunt/config/jsx/debug.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"debug": true,
"constants": {
"__MOCK__": true,
"__DEV__": true
}
}
2 changes: 1 addition & 1 deletion grunt/config/jsx/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var test = {
"test/all.js",
"**/__tests__/*.js"
]),
configFile: debug.configFile,
configFile: "grunt/config/jsx/test.json",
sourceDir: "src",
outputDir: "build/modules"
};
Expand Down
7 changes: 7 additions & 0 deletions grunt/config/jsx/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"debug": true,
"mocking": true,
"constants": {
"__DEV__": true
}
}

0 comments on commit b763d7d

Please sign in to comment.