Skip to content

Commit b763d7d

Browse files
committed
Use a separate grunt/config/jsx config file for tests.
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.
1 parent 2d61639 commit b763d7d

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module.exports = function(grunt) {
5656
grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
5757
grunt.registerTask('build:min', ['jsx:release', 'browserify:min']);
5858
grunt.registerTask('build:test', [
59-
'jsx:debug',
6059
'jsx:jasmine',
6160
'jsx:test',
6261
'browserify:jasmine',

bin/jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require("commoner").resolve(function(id) {
3434
// replacing constant expressions with literal (boolean) values.
3535
source = propagate(constants, source);
3636

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

grunt/config/jsx/debug.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"debug": true,
33
"constants": {
4-
"__MOCK__": true,
54
"__DEV__": true
65
}
76
}

grunt/config/jsx/jsx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var test = {
2525
"test/all.js",
2626
"**/__tests__/*.js"
2727
]),
28-
configFile: debug.configFile,
28+
configFile: "grunt/config/jsx/test.json",
2929
sourceDir: "src",
3030
outputDir: "build/modules"
3131
};

grunt/config/jsx/test.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"debug": true,
3+
"mocking": true,
4+
"constants": {
5+
"__DEV__": true
6+
}
7+
}

0 commit comments

Comments
 (0)