@samitouri / QOS-React-2 / commits / b763d7d029
Fork 0

The library for web and native user interfaces.

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.

Ben Newman committed Jul 15, 2013 at 18:21 UTC b763d7d029dd63fb32fdcb2e581712b0ef946263
5 files changed +9 -4
Gruntfile.js
-1
@@ -56,7 +56,6 @@ module.exports = function(grunt) {
56 grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
57 grunt.registerTask('build:min', ['jsx:release', 'browserify:min']);
58 grunt.registerTask('build:test', [
59 - 'jsx:debug',
59 'jsx:jasmine',
60 'jsx:test',
61 'browserify:jasmine',
bin/jsx
+1 -1
@@ -34,7 +34,7 @@ require("commoner").resolve(function(id) {
34 // replacing constant expressions with literal (boolean) values.
35 source = propagate(constants, source);
36
37 - if (constants.__MOCK__) {
37 + if (context.config.mocking) {
38 // Make sure there is exactly one newline at the end of the module.
39 source = source.replace(/\s+$/m, "\n");
40
grunt/config/jsx/debug.json
-1
@@ -1,7 +1,6 @@
1 {
2 "debug": true,
3 "constants": {
4 - "__MOCK__": true,
4 "__DEV__": true
5 }
6 }
grunt/config/jsx/jsx.js
+1 -1
@@ -25,7 +25,7 @@ var test = {
25 "test/all.js",
26 "**/__tests__/*.js"
27 ]),
28 - configFile: debug.configFile,
28 + configFile: "grunt/config/jsx/test.json",
29 sourceDir: "src",
30 outputDir: "build/modules"
31 };
grunt/config/jsx/test.json new
+7
@@ -0,0 +1,7 @@
1 +{
2 + "debug": true,
3 + "mocking": true,
4 + "constants": {
5 + "__DEV__": true
6 + }
7 +}